Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump regenagain: make returning off_t work (without brea...
details: https://anonhg.NetBSD.org/src/rev/81eaa898efff
branches: trunk
changeset: 762525:81eaa898efff
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Feb 22 14:06:29 2011 +0000
description:
regenagain: make returning off_t work (without breaking other return
types on some archs)
diffstat:
sys/rump/include/rump/rump_syscalls.h | 2 +-
sys/rump/librump/rumpkern/rump_syscalls.c | 2268 ++++++++++++++++++----------
2 files changed, 1461 insertions(+), 809 deletions(-)
diffs (truncated from 4744 to 300 lines):
diff -r b4f9eec4ca7e -r 81eaa898efff sys/rump/include/rump/rump_syscalls.h
--- a/sys/rump/include/rump/rump_syscalls.h Tue Feb 22 14:05:20 2011 +0000
+++ b/sys/rump/include/rump/rump_syscalls.h Tue Feb 22 14:06:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_syscalls.h,v 1.45 2011/02/22 13:05:07 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.46 2011/02/22 14:06:30 pooka Exp $ */
/*
* System call protos in rump namespace.
diff -r b4f9eec4ca7e -r 81eaa898efff sys/rump/librump/rumpkern/rump_syscalls.c
--- a/sys/rump/librump/rumpkern/rump_syscalls.c Tue Feb 22 14:05:20 2011 +0000
+++ b/sys/rump/librump/rumpkern/rump_syscalls.c Tue Feb 22 14:06:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_syscalls.c,v 1.67 2011/02/22 13:05:07 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.68 2011/02/22 14:06:29 pooka Exp $ */
/*
* System call vector and marshalling for rump.
@@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.67 2011/02/22 13:05:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.68 2011/02/22 14:06:29 pooka Exp $");
#include <sys/param.h>
#include <sys/fstypes.h>
@@ -69,20 +69,24 @@
ssize_t
rump___sysimpl_read(int fd, void * buf, size_t nbyte)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ ssize_t rv = -1;
struct sys_read_args callarg;
SPARG(&callarg, fd) = fd;
SPARG(&callarg, buf) = buf;
SPARG(&callarg, nbyte) = nbyte;
- error = rsys_syscall(SYS_read, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_read, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(ssize_t) > sizeof(register_t))
+ rv = *(ssize_t *)retval;
+ else
+ rv = (ssize_t)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_read,rump_enosys)
@@ -90,20 +94,24 @@
ssize_t
rump___sysimpl_write(int fd, const void * buf, size_t nbyte)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ ssize_t rv = -1;
struct sys_write_args callarg;
SPARG(&callarg, fd) = fd;
SPARG(&callarg, buf) = buf;
SPARG(&callarg, nbyte) = nbyte;
- error = rsys_syscall(SYS_write, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_write, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(ssize_t) > sizeof(register_t))
+ rv = *(ssize_t *)retval;
+ else
+ rv = (ssize_t)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_write,rump_enosys)
@@ -111,20 +119,24 @@
int
rump___sysimpl_open(const char * path, int flags, mode_t mode)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_open_args callarg;
SPARG(&callarg, path) = path;
SPARG(&callarg, flags) = flags;
SPARG(&callarg, mode) = mode;
- error = rsys_syscall(SYS_open, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_open, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_open,rump_enosys)
@@ -132,18 +144,22 @@
int
rump___sysimpl_close(int fd)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_close_args callarg;
SPARG(&callarg, fd) = fd;
- error = rsys_syscall(SYS_close, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_close, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_close,rump_enosys)
@@ -151,19 +167,23 @@
int
rump___sysimpl_link(const char * path, const char * link)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_link_args callarg;
SPARG(&callarg, path) = path;
SPARG(&callarg, link) = link;
- error = rsys_syscall(SYS_link, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_link, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_link,rump_enosys)
@@ -171,18 +191,22 @@
int
rump___sysimpl_unlink(const char * path)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_unlink_args callarg;
SPARG(&callarg, path) = path;
- error = rsys_syscall(SYS_unlink, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_unlink, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_unlink,rump_enosys)
@@ -190,18 +214,22 @@
int
rump___sysimpl_chdir(const char * path)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_chdir_args callarg;
SPARG(&callarg, path) = path;
- error = rsys_syscall(SYS_chdir, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_chdir, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_chdir,rump_enosys)
@@ -209,18 +237,22 @@
int
rump___sysimpl_fchdir(int fd)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_fchdir_args callarg;
SPARG(&callarg, fd) = fd;
- error = rsys_syscall(SYS_fchdir, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_fchdir, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(sys_fchdir,rump_enosys)
@@ -228,20 +260,24 @@
int
rump___sysimpl_mknod(const char * path, mode_t mode, uint32_t dev)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct compat_50_sys_mknod_args callarg;
SPARG(&callarg, path) = path;
SPARG(&callarg, mode) = mode;
SPARG(&callarg, dev) = dev;
- error = rsys_syscall(SYS_compat_50_mknod, &callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_compat_50_mknod, &callarg, sizeof(callarg), retval);
rsys_seterrno(error);
- if (error) {
- rval[0] = -1;
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = (int)*retval;
}
- return rval[0];
+ return rv;
}
rsys_alias(compat_50_sys_mknod,rump_enosys)
@@ -249,19 +285,23 @@
int
rump___sysimpl_chmod(const char * path, mode_t mode)
{
- register_t rval[2] = {0, 0};
+ register_t retval[2] = {0, 0};
int error = 0;
+ int rv = -1;
struct sys_chmod_args callarg;
SPARG(&callarg, path) = path;
SPARG(&callarg, mode) = mode;
Home |
Main Index |
Thread Index |
Old Index