msg.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* Copyright (C) 1995,1996,1997,1999,2000,2003 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 Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the 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. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _SYS_MSG_H
  16. #define _SYS_MSG_H
  17. #include <features.h>
  18. /* Get common definition of System V style IPC. */
  19. #include <sys/ipc.h>
  20. /* Get system dependent definition of `struct msqid_ds' and more. */
  21. #include <bits/msq.h>
  22. /* Define types required by the standard. */
  23. #define __need_time_t
  24. #include <time.h>
  25. #ifndef __pid_t_defined
  26. typedef __pid_t pid_t;
  27. # define __pid_t_defined
  28. #endif
  29. #ifndef __ssize_t_defined
  30. typedef __ssize_t ssize_t;
  31. # define __ssize_t_defined
  32. #endif
  33. /* The following System V style IPC functions implement a message queue
  34. system. The definition is found in XPG2. */
  35. #ifdef __USE_GNU
  36. /* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
  37. struct msgbuf
  38. {
  39. long int mtype; /* type of received/sent message */
  40. char mtext[1]; /* text of the message */
  41. };
  42. #endif
  43. __BEGIN_DECLS
  44. /* Message queue control operation. */
  45. extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
  46. /* Get messages queue. */
  47. extern int msgget (key_t __key, int __msgflg) __THROW;
  48. /* Receive message from message queue.
  49. This function is a cancellation point and therefore not marked with
  50. __THROW. */
  51. extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz,
  52. long int __msgtyp, int __msgflg);
  53. /* Send message to message queue.
  54. This function is a cancellation point and therefore not marked with
  55. __THROW. */
  56. extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
  57. int __msgflg);
  58. __END_DECLS
  59. #endif /* sys/msg.h */