msg.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 1995, 1996, 1997, 1999, 2000 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. #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);
  46. /* Get messages queue. */
  47. extern int msgget (key_t __key, int __msgflg);
  48. /* Receive message from message queue. */
  49. extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz,
  50. long int __msgtyp, int __msgflg);
  51. /* Send message to message queue. */
  52. extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
  53. int __msgflg);
  54. __END_DECLS
  55. #endif /* sys/msg.h */