diff --git a/sys/sys/msg.h b/sys/sys/msg.h index 4a170a2dc401..d34a6d707d69 100644 --- a/sys/sys/msg.h +++ b/sys/sys/msg.h @@ -23,6 +23,8 @@ #ifndef _SYS_MSG_H_ #define _SYS_MSG_H_ +#include +#include #include /* @@ -32,15 +34,39 @@ #define MSG_NOERROR 010000 /* don't complain about too long msgs */ +typedef unsigned long msglen_t; +typedef unsigned long msgqnum_t; + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED +#endif + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED +#endif + +/* XXX namespace pollution. */ struct msg; struct msqid_ds { struct ipc_perm msg_perm; /* msg queue permission bits */ struct msg *msg_first; /* first message in the queue */ struct msg *msg_last; /* last message in the queue */ - u_long msg_cbytes; /* number of bytes in use on the queue */ - u_long msg_qnum; /* number of msgs in the queue */ - u_long msg_qbytes; /* max # of bytes on the queue */ + msglen_t msg_cbytes; /* number of bytes in use on the queue */ + msgqnum_t msg_qnum; /* number of msgs in the queue */ + msglen_t msg_qbytes; /* max # of bytes on the queue */ pid_t msg_lspid; /* pid of last msgsnd() */ pid_t msg_lrpid; /* pid of last msgrcv() */ time_t msg_stime; /* time of last msgsnd() */ @@ -52,6 +78,7 @@ struct msqid_ds { long msg_pad4[4]; }; +#if __BSD_VISIBLE /* * Structure describing a message. The SVID doesn't suggest any * particular name for this structure. There is a reference in the @@ -66,6 +93,7 @@ struct mymsg { long mtype; /* message type (+ve integer) */ char mtext[1]; /* message body */ }; +#endif #ifdef _KERNEL @@ -92,15 +120,18 @@ extern struct msginfo msginfo; #ifndef _KERNEL -#include - __BEGIN_DECLS -int msgsys(int, ...); int msgctl(int, int, struct msqid_ds *); int msgget(key_t, int); +/* XXX return value should be ssize_t. */ +int msgrcv(int, void *, size_t, long, int); +/* XXX second parameter missing const type-qualifier. */ int msgsnd(int, void *, size_t, int); -int msgrcv(int, void*, size_t, long, int); +#if __BSD_VISIBLE +int msgsys(int, ...); +#endif __END_DECLS + #endif #endif /* !_SYS_MSG_H_ */