msq.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. __time_t msg_stime; /* time of last msgsnd command */
  31. __time_t msg_rtime; /* time of last msgrcv command */
  32. __time_t msg_ctime; /* time of last change */
  33. unsigned long int __msg_cbytes; /* current number of bytes on queue */
  34. msgqnum_t msg_qnum; /* number of messages currently on queue */
  35. msglen_t msg_qbytes; /* max number of bytes allowed on queue */
  36. __pid_t msg_lspid; /* pid of last msgsnd() */
  37. __pid_t msg_lrpid; /* pid of last msgrcv() */
  38. unsigned long int __unused1;
  39. unsigned long int __unused2;
  40. };
  41. #ifdef __USE_MISC
  42. # define msg_cbytes __msg_cbytes
  43. /* ipcs ctl commands */
  44. # define MSG_STAT 11
  45. # define MSG_INFO 12
  46. /* buffer for msgctl calls IPC_INFO, MSG_INFO */
  47. struct msginfo
  48. {
  49. int msgpool;
  50. int msgmap;
  51. int msgmax;
  52. int msgmnb;
  53. int msgmni;
  54. int msgssz;
  55. int msgtql;
  56. unsigned short int msgseg;
  57. };
  58. #endif /* __USE_MISC */