msg.h 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _SYS_MSG_H
  2. #define _SYS_MSG_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <sys/ipc.h>
  7. #define __NEED_pid_t
  8. #define __NEED_key_t
  9. #define __NEED_time_t
  10. #define __NEED_size_t
  11. #define __NEED_ssize_t
  12. #include <bits/alltypes.h>
  13. typedef unsigned long msgqnum_t;
  14. typedef unsigned long msglen_t;
  15. #include <bits/msg.h>
  16. #define __msg_cbytes msg_cbytes
  17. #define MSG_NOERROR 010000
  18. #define MSG_EXCEPT 020000
  19. #define MSG_STAT (11 | (IPC_STAT & 0x100))
  20. #define MSG_INFO 12
  21. #define MSG_STAT_ANY (13 | (IPC_STAT & 0x100))
  22. struct msginfo {
  23. int msgpool, msgmap, msgmax, msgmnb, msgmni, msgssz, msgtql;
  24. unsigned short msgseg;
  25. };
  26. int msgctl (int, int, struct msqid_ds *);
  27. int msgget (key_t, int);
  28. ssize_t msgrcv (int, void *, size_t, long, int);
  29. int msgsnd (int, const void *, size_t, int);
  30. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  31. struct msgbuf {
  32. long mtype;
  33. char mtext[1];
  34. };
  35. #endif
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif