msq.h 2.3 KB

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