Module Name: src
Committed By: martin
Date: Sun Jun 21 08:32:36 UTC 2015
Modified Files:
src/sys/compat/netbsd32: netbsd32_mqueue.c
Log Message:
Fix compat/versioning confusion and add the missing new versioned ones.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_mqueue.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/netbsd32/netbsd32_mqueue.c
diff -u src/sys/compat/netbsd32/netbsd32_mqueue.c:1.1 src/sys/compat/netbsd32/netbsd32_mqueue.c:1.2
--- src/sys/compat/netbsd32/netbsd32_mqueue.c:1.1 Sat Jun 20 19:58:40 2015
+++ src/sys/compat/netbsd32/netbsd32_mqueue.c Sun Jun 21 08:32:36 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_mqueue.c,v 1.1 2015/06/20 19:58:40 martin Exp $ */
+/* $NetBSD: netbsd32_mqueue.c,v 1.2 2015/06/21 08:32:36 martin Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mqueue.c,v 1.1 2015/06/20 19:58:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mqueue.c,v 1.2 2015/06/21 08:32:36 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -255,9 +255,75 @@ netbsd32_mq_receive(struct lwp *l, const
return error;
}
-#ifdef COMPAT_50
+int
+netbsd32___mq_timedsend50(struct lwp *l,
+ const struct netbsd32___mq_timedsend50_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(mqd_t) mqdes;
+ syscallarg(const netbsd32_charp) msg_ptr;
+ syscallarg(netbsd32_size_t) msg_len;
+ syscallarg(unsigned) msg_prio;
+ syscallarg(const netbsd32_timespecp_t) abs_timeout;
+ } */
+ struct timespec ts, *tsp;
+ struct netbsd32_timespec ts32;
+ int error;
+
+ /* Get and convert time value */
+ if (SCARG_P32(uap, abs_timeout)) {
+ error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
+ sizeof(ts32));
+ if (error)
+ return error;
+ netbsd32_to_timespec(&ts32, &ts);
+ tsp = &ts;
+ } else {
+ tsp = NULL;
+ }
+
+ return mq_send1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
+ SCARG(uap, msg_len), SCARG(uap, msg_prio), tsp);
+}
int
+netbsd32___mq_timedreceive50(struct lwp *l,
+ const struct netbsd32___mq_timedreceive50_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(mqd_t) mqdes;
+ syscallarg(netbsd32_charp) msg_ptr;
+ syscallarg(netbsd32_size_t) msg_len;
+ syscallarg(netbsd32_uintp) msg_prio;
+ syscallarg(const netbsd32_timespecp_t) abs_timeout;
+ } */
+ struct timespec ts, *tsp;
+ struct netbsd32_timespec ts32;
+ ssize_t mlen;
+ int error;
+
+ /* Get and convert time value */
+ if (SCARG_P32(uap, abs_timeout)) {
+ error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
+ sizeof(ts32));
+ if (error)
+ return error;
+ netbsd32_to_timespec(&ts32, &ts);
+ tsp = &ts;
+ } else {
+ tsp = NULL;
+ }
+
+ error = mq_recv1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
+ SCARG(uap, msg_len), SCARG_P32(uap, msg_prio), tsp, &mlen);
+ if (error == 0)
+ *retval = mlen;
+
+ return error;
+}
+
+#ifdef COMPAT_50
+int
compat_50_netbsd32_mq_timedsend(struct lwp *l,
const struct compat_50_netbsd32_mq_timedsend_args *uap,
register_t *retval)
@@ -270,7 +336,7 @@ compat_50_netbsd32_mq_timedsend(struct l
syscallarg(const netbsd32_timespec50p_t) abs_timeout;
} */
struct timespec ts, *tsp;
- struct netbsd32_timespec ts32;
+ struct netbsd32_timespec50 ts32;
int error;
/* Get and convert time value */
@@ -279,7 +345,7 @@ compat_50_netbsd32_mq_timedsend(struct l
sizeof(ts32));
if (error)
return error;
- netbsd32_to_timespec(&ts32, &ts);
+ netbsd32_to_timespec50(&ts32, &ts);
tsp = &ts;
} else {
tsp = NULL;
@@ -302,7 +368,7 @@ compat_50_netbsd32_mq_timedreceive(struc
syscallarg(const netbsd32_timespec50p_t) abs_timeout;
} */
struct timespec ts, *tsp;
- struct netbsd32_timespec ts32;
+ struct netbsd32_timespec50 ts32;
ssize_t mlen;
int error;
@@ -312,7 +378,7 @@ compat_50_netbsd32_mq_timedreceive(struc
sizeof(ts32));
if (error)
return error;
- netbsd32_to_timespec(&ts32, &ts);
+ netbsd32_to_timespec50(&ts32, &ts);
tsp = &ts;
} else {
tsp = NULL;