diff options
author | mike <mike@FreeBSD.org> | 2002-12-18 18:22:06 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-12-18 18:22:06 +0000 |
commit | 56ac494d9929ca6ee8266e21c637fcea1f8a15ea (patch) | |
tree | e586b00015079c5712ed845f139d6f5bfdd49a7c /sys | |
parent | f1592d04ae0028eaafcea213f43aa6c959f9cd55 (diff) | |
download | FreeBSD-src-56ac494d9929ca6ee8266e21c637fcea1f8a15ea.zip FreeBSD-src-56ac494d9929ca6ee8266e21c637fcea1f8a15ea.tar.gz |
o Add new types: msgqnum_t and msglen_t.
o Add typedefs for pid_t, time_t, size_t and ssize_t.
o Hide struct mymsg and msgsys() in the standards case.
o Add some comments about conformance bugs.
o Sort prototypes.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/msg.h | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/sys/sys/msg.h b/sys/sys/msg.h index 4a170a2..d34a6d7 100644 --- a/sys/sys/msg.h +++ b/sys/sys/msg.h @@ -23,6 +23,8 @@ #ifndef _SYS_MSG_H_ #define _SYS_MSG_H_ +#include <sys/cdefs.h> +#include <sys/_types.h> #include <sys/ipc.h> /* @@ -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 <sys/cdefs.h> - __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_ */ |