msq.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_MSG_H
  16. #error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
  17. #endif
  18. #include <sys/types.h>
  19. /* Define options for message queue functions. */
  20. #define MSG_NOERROR 010000 /* no error if message is too big */
  21. #define MSG_EXCEPT 020000 /* recv any msg except of specified type */
  22. /* Structure of record for one message inside the kernel.
  23. The type `struct __msg' is opaque. */
  24. struct msqid_ds
  25. {
  26. struct ipc_perm msg_perm; /* structure describing operation permission */
  27. __time_t msg_stime; /* time of last msgsnd command */
  28. __time_t msg_rtime; /* time of last msgrcv command */
  29. __time_t msg_ctime; /* time of last change */
  30. unsigned long int __msg_cbytes; /* current number of bytes on queue */
  31. unsigned long int msg_qnum; /* number of messages currently on queue */
  32. unsigned long int msg_qbytes; /* max number of bytes allowed on queue */
  33. __pid_t msg_lspid; /* pid of last msgsnd() */
  34. __pid_t msg_lrpid; /* pid of last msgrcv() */
  35. unsigned long int __uclibc_unused1;
  36. unsigned long int __uclibc_unused2;
  37. };
  38. #ifdef __USE_MISC
  39. # define msg_cbytes __msg_cbytes
  40. /* ipcs ctl commands */
  41. # define MSG_STAT 11
  42. # define MSG_INFO 12
  43. /* buffer for msgctl calls IPC_INFO, MSG_INFO */
  44. struct msginfo
  45. {
  46. int msgpool;
  47. int msgmap;
  48. int msgmax;
  49. int msgmnb;
  50. int msgmni;
  51. int msgssz;
  52. int msgtql;
  53. unsigned short int msgseg;
  54. };
  55. #endif /* __USE_MISC */