1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-30 16:51:41 +00:00

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.
This commit is contained in:
Mike Barcroft 2002-12-18 18:22:06 +00:00
parent f37d6d4463
commit fd8f16a831
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108048

View File

@ -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_ */