Change the return type of msgrcv() to ssize_t as required by POSIX.

It looks like the msgrcv() system call is already written in such a way
that the size is internally computed as a size_t and written into all of
td_retval[0]. This means that it is effectively already returning
ssize_t. It's just that the userspace prototype doesn't match up.
This commit is contained in:
ed 2016-07-28 12:22:01 +00:00
parent 910e26641a
commit 4eb594a8c4
3 changed files with 4 additions and 5 deletions

View File

@ -31,7 +31,7 @@
.\" $FreeBSD$
.\"
.\"/
.Dd July 9, 2009
.Dd July 28, 2016
.Dt MSGRCV 2
.Os
.Sh NAME
@ -43,7 +43,7 @@
.In sys/types.h
.In sys/ipc.h
.In sys/msg.h
.Ft int
.Ft ssize_t
.Fn msgrcv "int msqid" "void *msgp" "size_t msgsz" "long msgtyp" "int msgflg"
.Sh DESCRIPTION
The

View File

@ -428,7 +428,7 @@
225 AUE_MSGGET NOSTD { int msgget(key_t key, int msgflg); }
226 AUE_MSGSND NOSTD { int msgsnd(int msqid, const void *msgp, \
size_t msgsz, int msgflg); }
227 AUE_MSGRCV NOSTD { int msgrcv(int msqid, void *msgp, \
227 AUE_MSGRCV NOSTD { ssize_t msgrcv(int msqid, void *msgp, \
size_t msgsz, long msgtyp, int msgflg); }
228 AUE_SHMAT NOSTD { int shmat(int shmid, const void *shmaddr, \
int shmflg); }

View File

@ -169,8 +169,7 @@ struct msqid_kernel {
__BEGIN_DECLS
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);
ssize_t msgrcv(int, void *, size_t, long, int);
int msgsnd(int, const void *, size_t, int);
#if __BSD_VISIBLE
int msgsys(int, ...);