msg.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* Copyright (C) 1995-1997,1999,2000,2003,2006,2007
  2. Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  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. #define _SYS_MSG_H
  18. #include <features.h>
  19. #define __need_size_t
  20. #include <stddef.h>
  21. /* Get common definition of System V style IPC. */
  22. #include <sys/ipc.h>
  23. /* Get system dependent definition of `struct msqid_ds' and more. */
  24. #include <bits/msq.h>
  25. /* Define types required by the standard. */
  26. #define __need_time_t
  27. #include <time.h>
  28. #ifndef __pid_t_defined
  29. typedef __pid_t pid_t;
  30. # define __pid_t_defined
  31. #endif
  32. #ifndef __ssize_t_defined
  33. typedef __ssize_t ssize_t;
  34. # define __ssize_t_defined
  35. #endif
  36. /* The following System V style IPC functions implement a message queue
  37. system. The definition is found in XPG2. */
  38. #ifdef __USE_GNU
  39. /* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
  40. struct msgbuf
  41. {
  42. long int mtype; /* type of received/sent message */
  43. char mtext[1]; /* text of the message */
  44. };
  45. #endif
  46. __BEGIN_DECLS
  47. /* Message queue control operation. */
  48. extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
  49. /* Get messages queue. */
  50. extern int msgget (key_t __key, int __msgflg) __THROW;
  51. /* Receive message from message queue.
  52. This function is a cancellation point and therefore not marked with
  53. __THROW. */
  54. extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz,
  55. long int __msgtyp, int __msgflg);
  56. /* Send message to message queue.
  57. This function is a cancellation point and therefore not marked with
  58. __THROW. */
  59. extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
  60. int __msgflg);
  61. __END_DECLS
  62. #endif /* sys/msg.h */