Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/sunos32 make sunos32_sys_stime() & sunos32_sys_si...
details: https://anonhg.NetBSD.org/src/rev/c4ef18f38ba7
branches: trunk
changeset: 503386:c4ef18f38ba7
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Feb 05 06:27:57 2001 +0000
description:
make sunos32_sys_stime() & sunos32_sys_sigvec() work.
diffstat:
sys/compat/sunos32/sunos32_misc.c | 194 ++++++++++++++++++++++++++++++-------
1 files changed, 156 insertions(+), 38 deletions(-)
diffs (truncated from 425 to 300 lines):
diff -r eec5b031b2ee -r c4ef18f38ba7 sys/compat/sunos32/sunos32_misc.c
--- a/sys/compat/sunos32/sunos32_misc.c Mon Feb 05 06:04:41 2001 +0000
+++ b/sys/compat/sunos32/sunos32_misc.c Mon Feb 05 06:27:57 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_misc.c,v 1.3 2001/02/04 11:06:14 mrg Exp $ */
+/* $NetBSD: sunos32_misc.c,v 1.4 2001/02/05 06:27:57 mrg Exp $ */
/* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
/*
@@ -140,23 +140,54 @@
#include <nfs/nfs.h>
#include <nfs/nfsmount.h>
+static void sunos32_sigvec_to_sigaction(const struct netbsd32_sigvec *, struct sigaction *);
+static void sunos32_sigvec_from_sigaction(struct netbsd32_sigvec *, const struct sigaction *);
+
static int sunstatfs __P((struct statfs *, caddr_t));
+static void
+sunos32_sigvec_to_sigaction(sv, sa)
+ const struct netbsd32_sigvec *sv;
+ struct sigaction *sa;
+{
+/*XXX*/ extern void compat_43_sigmask_to_sigset __P((const int *, sigset_t *));
+
+ sa->sa_handler = (void *)(u_long)sv->sv_handler;
+ compat_43_sigmask_to_sigset(&sv->sv_mask, &sa->sa_mask);
+ sa->sa_flags = sv->sv_flags ^ SA_RESTART;
+}
+
+static
+void sunos32_sigvec_from_sigaction(sv, sa)
+ struct netbsd32_sigvec *sv;
+ const struct sigaction *sa;
+{
+/*XXX*/ extern void compat_43_sigset_to_sigmask __P((const sigset_t *, int *));
+
+ sv->sv_handler = (netbsd32_voidp)(u_long)sa->sa_handler;
+ compat_43_sigset_to_sigmask(&sa->sa_mask, &sv->sv_mask);
+ sv->sv_flags = sa->sa_flags ^ SA_RESTART;
+}
+
int
sunos32_sys_stime(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct sunos32_sys_stime_args *uap = v;
+ struct sunos32_sys_stime_args /* {
+ syscallarg(sunos32_time_tp) tp;
+ } */ *uap = v;
struct sys_settimeofday_args ap;
caddr_t sg = stackgap_init(p->p_emul);
+ struct netbsd32_timeval ntv;
struct timeval tv, *sgtvp;
int error;
- error = copyin((caddr_t)(u_long)SCARG(uap, tp), &tv.tv_sec, sizeof(tv.tv_sec));
+ error = copyin((caddr_t)(u_long)SCARG(uap, tp), &ntv.tv_sec, sizeof(ntv.tv_sec));
if (error)
return error;
+ tv.tv_sec = ntv.tv_sec;
tv.tv_usec = 0;
SCARG(&ap, tv) = sgtvp = stackgap_alloc(&sg, sizeof(struct timeval));
@@ -175,7 +206,12 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_wait4_args *uap = v;
+ struct sunos32_sys_wait4_args /* {
+ syscallarg(int) pid;
+ syscallarg(netbsd32_intp) status;
+ syscallarg(int) options;
+ syscallarg(netbsd32_rusagep_t) rusage;
+ } */ *uap = v;
if (SCARG(uap, pid) == 0)
SCARG(uap, pid) = WAIT_ANY;
@@ -188,7 +224,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_creat_args *uap = v;
+ struct sunos32_sys_creat_args /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(int) mode;
+ } */ *uap = v;
struct sys_open_args ua;
caddr_t sg = stackgap_init(p->p_emul);
@@ -206,7 +245,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_access_args *uap = v;
+ struct sunos32_sys_access_args /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(int) flags;
+ } */ *uap = v;
struct sys_access_args ua;
caddr_t sg = stackgap_init(p->p_emul);
@@ -254,7 +296,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_stat_args *uap = v;
+ struct sunos32_sys_stat_args /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(netbsd32_stat43p_t) ub;
+ } */ *uap = v;
struct stat43 sb32;
struct stat sb;
struct nameidata nd;
@@ -284,7 +329,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_lstat_args *uap = v;
+ struct sunos32_sys_lstat_args /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(netbsd32_stat43p_t) ub;
+ } */ *uap = v;
struct vnode *vp, *dvp;
struct stat sb, sb1;
struct stat43 sb32;
@@ -402,7 +450,11 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_omsync_args *uap = v;
+ struct sunos32_sys_omsync_args /* {
+ syscallarg(netbsd32_caddr_t) addr;
+ syscallarg(netbsd32_size_t) len;
+ syscallarg(int) flags;
+ } */ *uap = v;
struct netbsd32___msync13_args ouap;
SCARG(&ouap, addr) = SCARG(uap, addr);
@@ -418,7 +470,9 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_unmount_args *uap = v;
+ struct sunos32_sys_unmount_args /* {
+ syscallarg(netbsd32_charp) path;
+ } */ *uap = v;
struct sys_unmount_args ua;
SUNOS32TOP_UAP(path, const char);
@@ -457,7 +511,12 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_mount_args *uap = v;
+ struct sunos32_sys_mount_args /* {
+ syscallarg(netbsd32_charp) type;
+ syscallarg(netbsd32_charp) path;
+ syscallarg(int) flags;
+ syscallarg(netbsd32_caddr_t) data;
+ } */ *uap = v;
struct sys_mount_args ua;
int oflags = SCARG(uap, flags), nflags, error;
char fsname[MFSNAMELEN];
@@ -583,7 +642,9 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_sigpending_args *uap = v;
+ struct sunos32_sys_sigpending_args /* {
+ syscallarg(netbsd32_intp) mask;
+ } */ *uap = v;
sigset_t ss;
int mask;
@@ -623,7 +684,11 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_getdents_args *uap = v;
+ struct sunos32_sys_getdents_args /* {
+ syscallarg(int) fd;
+ syscallarg(netbsd32_charp) buf;
+ syscallarg(int) nbytes;
+ } */ *uap = v;
struct dirent *bdp;
struct vnode *vp;
caddr_t inp, buf; /* BSD-format */
@@ -748,7 +813,14 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_mmap_args *uap = v;
+ struct sunos32_sys_mmap_args /* {
+ syscallarg(netbsd32_voidp) addr;
+ syscallarg(netbsd32_size_t) len;
+ syscallarg(int) prot;
+ syscallarg(int) flags;
+ syscallarg(int) fd;
+ syscallarg(netbsd32_long) pos;
+ } */ *uap = v;
struct sys_mmap_args ua;
struct filedesc *fdp;
struct file *fp;
@@ -811,7 +883,12 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_mctl_args *uap = v;
+ struct sunos32_sys_mctl_args /* {
+ syscallarg(netbsd32_voidp) addr;
+ syscallarg(int) len;
+ syscallarg(int) func;
+ syscallarg(netbsd32_voidp) arg;
+ } */ *uap = v;
switch (SCARG(uap, func)) {
case MC_ADVISE: /* ignore for now */
@@ -829,7 +906,13 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_setsockopt_args *uap = v;
+ struct sunos32_sys_setsockopt_args /* {
+ syscallarg(int) s;
+ syscallarg(int) level;
+ syscallarg(int) name;
+ syscallarg(netbsd32_caddr_t) val;
+ syscallarg(int) valsize;
+ } */ *uap = v;
struct file *fp;
struct mbuf *m = NULL;
int error;
@@ -904,7 +987,9 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_uname_args *uap = v;
+ struct sunos32_sys_uname_args /* {
+ syscallarg(sunos32_utsnamep_t) name;
+ } */ *uap = v;
struct sunos_utsname sut;
memset(&sut, 0, sizeof(sut));
@@ -926,7 +1011,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_setpgrp_args *uap = v;
+ struct sunos32_sys_setpgrp_args /* {
+ syscallarg(int) pid;
+ syscallarg(int) pgid;
+ } */ *uap = v;
/*
* difference to our setpgid call is to include backwards
@@ -947,7 +1035,11 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_open_args *uap = v;
+ struct sunos32_sys_open_args /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(int) flags;
+ syscallarg(int) mode;
+ } */ *uap = v;
struct sys_open_args ua;
int l, r;
int noctty;
@@ -1027,7 +1119,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_ustat_args *uap = v;
+ struct sunos32_sys_ustat_args /* {
+ syscallarg(int) dev;
+ syscallarg(sunos32_ustatp_t) buf;
+ } */ *uap = v;
struct sunos_ustat us;
int error;
@@ -1102,7 +1197,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_statfs_args *uap = v;
+ struct sunos32_sys_statfs_args /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(sunos32_statfsp_t) buf;
+ } */ *uap = v;
struct mount *mp;
struct statfs *sp;
int error;
@@ -1129,7 +1227,10 @@
void *v;
register_t *retval;
{
- struct sunos32_sys_fstatfs_args *uap = v;
Home |
Main Index |
Thread Index |
Old Index