svn commit: r303435 - in head: lib/libc/sys sys/kern sys/sys
Ed Schouten
ed at FreeBSD.org
Thu Jul 28 12:22:03 UTC 2016
Author: ed
Date: Thu Jul 28 12:22:01 2016
New Revision: 303435
URL: https://svnweb.freebsd.org/changeset/base/303435
Log:
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.
Modified:
head/lib/libc/sys/msgrcv.2
head/sys/kern/syscalls.master
head/sys/sys/msg.h
Modified: head/lib/libc/sys/msgrcv.2
==============================================================================
--- head/lib/libc/sys/msgrcv.2 Thu Jul 28 12:06:40 2016 (r303434)
+++ head/lib/libc/sys/msgrcv.2 Thu Jul 28 12:22:01 2016 (r303435)
@@ -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
Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master Thu Jul 28 12:06:40 2016 (r303434)
+++ head/sys/kern/syscalls.master Thu Jul 28 12:22:01 2016 (r303435)
@@ -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); }
Modified: head/sys/sys/msg.h
==============================================================================
--- head/sys/sys/msg.h Thu Jul 28 12:06:40 2016 (r303434)
+++ head/sys/sys/msg.h Thu Jul 28 12:22:01 2016 (r303435)
@@ -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, ...);
More information about the svn-src-all
mailing list