msq.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
  2. The GNU C Library is free software; you can redistribute it and/or
  3. modify it under the terms of the GNU Lesser General Public
  4. License as published by the Free Software Foundation; either
  5. version 2.1 of the License, or (at your option) any later version.
  6. The GNU C Library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Lesser General Public License for more details.
  10. You should have received a copy of the GNU Lesser General Public
  11. License along with the GNU C Library; if not, see
  12. <http://www.gnu.org/licenses/>. */
  13. #ifndef _SYS_MSG_H
  14. # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
  15. #endif
  16. #include <bits/types.h>
  17. /* Define options for message queue functions. */
  18. #define MSG_NOERROR 010000 /* no error if message is too big */
  19. #ifdef __USE_GNU
  20. # define MSG_EXCEPT 020000 /* recv any msg except of specified type */
  21. #endif
  22. /* Types used in the structure definition. */
  23. typedef unsigned long int msgqnum_t;
  24. typedef unsigned long int msglen_t;
  25. /* Structure of record for one message inside the kernel.
  26. The type `struct msg' is opaque. */
  27. struct msqid_ds
  28. {
  29. struct ipc_perm msg_perm; /* structure describing operation permission */
  30. unsigned int __pad1;
  31. __time_t msg_stime; /* time of last msgsnd command */
  32. unsigned int __pad2;
  33. __time_t msg_rtime; /* time of last msgrcv command */
  34. unsigned int __pad3;
  35. __time_t msg_ctime; /* time of last change */
  36. unsigned long int __msg_cbytes; /* current number of bytes on queue */
  37. msgqnum_t msg_qnum; /* number of messages currently on queue */
  38. msglen_t msg_qbytes; /* max number of bytes allowed on queue */
  39. __pid_t msg_lspid; /* pid of last msgsnd() */
  40. __pid_t msg_lrpid; /* pid of last msgrcv() */
  41. unsigned long int __uclibc_unused1;
  42. unsigned long int __uclibc_unused2;
  43. };
  44. #ifdef __USE_MISC
  45. # define msg_cbytes __msg_cbytes
  46. /* ipcs ctl commands */
  47. # define MSG_STAT 11
  48. # define MSG_INFO 12
  49. /* buffer for msgctl calls IPC_INFO, MSG_INFO */
  50. struct msginfo
  51. {
  52. int msgpool;
  53. int msgmap;
  54. int msgmax;
  55. int msgmnb;
  56. int msgmni;
  57. int msgssz;
  58. int msgtql;
  59. unsigned short int msgseg;
  60. };
  61. #endif /* __USE_MISC */