msq.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  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. struct msg *__msg_first; /* pointer to first message on queue */
  28. struct msg *__msg_last; /* pointer to last message on queue */
  29. __time_t msg_stime; /* time of last msgsnd command */
  30. __time_t msg_rtime; /* time of last msgrcv command */
  31. __time_t msg_ctime; /* time of last change */
  32. struct wait_queue *__wwait; /* ??? */
  33. struct wait_queue *__rwait; /* ??? */
  34. unsigned short int __msg_cbytes;/* current number of bytes on queue */
  35. unsigned short int msg_qnum; /* number of messages currently on queue */
  36. unsigned short int msg_qbytes;/* max number of bytes allowed on queue */
  37. __ipc_pid_t msg_lspid; /* pid of last msgsnd() */
  38. __ipc_pid_t msg_lrpid; /* pid of last msgrcv() */
  39. };
  40. #ifdef __USE_MISC
  41. # define msg_cbytes __msg_cbytes
  42. /* ipcs ctl commands */
  43. # define MSG_STAT 11
  44. # define MSG_INFO 12
  45. /* buffer for msgctl calls IPC_INFO, MSG_INFO */
  46. struct msginfo
  47. {
  48. int msgpool;
  49. int msgmap;
  50. int msgmax;
  51. int msgmnb;
  52. int msgmni;
  53. int msgssz;
  54. int msgtql;
  55. unsigned short int msgseg;
  56. };
  57. #endif /* __USE_MISC */