-/* $NetBSD: freebsd_file.c,v 1.2 1995/11/07 22:27:21 gwr Exp $ */
+/* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
const char freebsd_emul_path[] = "/emul/freebsd";
+static char * convert_from_freebsd_mount_type __P((int));
+
static char *
convert_from_freebsd_mount_type(type)
int type;
if ((type = convert_from_freebsd_mount_type(SCARG(uap, type))) == NULL)
return ENODEV;
s = stackgap_alloc(&sg, MFSNAMELEN + 1);
- if (error = copyout(type, s, strlen(type) + 1))
+ if ((error = copyout(type, s, strlen(type) + 1)) != 0)
return error;
SCARG(&bma, type) = s;
FREEBSD_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
-/* $NetBSD: freebsd_misc.c,v 1.1 1995/10/10 01:19:33 mycroft Exp $ */
+/* $NetBSD: freebsd_misc.c,v 1.2 1996/05/03 17:03:10 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
void *v;
register_t *retval;
{
+#ifdef notyet
struct freebsd_sys_rtprio_args /* {
syscallarg(int) function;
syscallarg(pid_t) pid;
syscallarg(struct freebsd_rtprio *) rtp;
} */ *uap = v;
+#endif
return ENOSYS; /* XXX */
}
void *v;
register_t *retval;
{
+#ifdef notyet
struct freebsd_ntp_adjtime_args /* {
syscallarg(struct freebsd_timex *) tp;
} */ *uap = v;
+#endif
return ENOSYS; /* XXX */
}
-/* $NetBSD: freebsd_ptrace.c,v 1.1 1995/10/10 01:19:34 mycroft Exp $ */
+/* $NetBSD: freebsd_ptrace.c,v 1.2 1996/05/03 17:03:12 christos Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou. All rights reserved.
retval);
case FREEBSD_PT_WRITE_U:
- if (error = freebsd_ptrace_setregs(&fr,
- SCARG(uap, addr), SCARG(uap, data)))
+ error = freebsd_ptrace_setregs(&fr,
+ SCARG(uap, addr), SCARG(uap, data));
+ if (error)
return error;
freebsd_to_netbsd_ptrace_regs(&fr,
&nrp->regs, &nrp->fpregs);
+/* $NetBSD: ibcs2_errno.c,v 1.2 1996/05/03 17:05:16 christos Exp $ */
+
/*
* ibcs2_errno.c
* Copyright (c) 1995 Scott Bartram
+/* $NetBSD: ibcs2_errno.h,v 1.2 1996/05/03 17:05:18 christos Exp $ */
+
/*
* ibcs2_errno.h
* Copyright (c) 1995 Scott Bartram
-/* $NetBSD: ibcs2_exec.c,v 1.10 1995/06/24 20:18:55 christos Exp $ */
+/* $NetBSD: ibcs2_exec.c,v 1.11 1996/05/03 17:05:19 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Scott Bartram
struct xexec *, struct xext *));
int exec_ibcs2_xout_setup_stack __P((struct proc *, struct exec_package *));
int coff_load_shlib __P((struct proc *, char *, struct exec_package *));
+static int coff_find_section __P((struct proc *, struct vnode *,
+ struct coff_filehdr *, struct coff_scnhdr *,
+ int));
+
extern int bsd2ibcs_errno[];
extern struct sysent ibcs2_sysent[];
struct proc *p;
struct exec_package *epp;
{
- u_long midmag, magic;
- u_short mid;
int error;
struct coff_filehdr *fp = epp->ep_hdr;
struct coff_aouthdr *ap;
if (error)
kill_vmcmds(&epp->ep_vmcmds);
-bad:
return error;
}
pos = COFF_HDR_SIZE;
for (i = 0; i < fp->f_nscns; i++, pos += sizeof(struct coff_scnhdr)) {
siz = sizeof(struct coff_scnhdr);
- if (error = vn_rdwr(UIO_READ, vp, (caddr_t) sh,
- siz, pos,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
- &resid, p)) {
+ error = vn_rdwr(UIO_READ, vp, (caddr_t) sh,
+ siz, pos, UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
+ &resid, p);
+ if (error) {
DPRINTF(("section hdr %d read error %d\n", i, error));
return error;
}
IBCS2_CHECK_ALT_EXIST(p, &sg, path);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p);
/* first get the vnode */
- if (error = namei(&nd)) {
+ if ((error = namei(&nd)) != 0) {
DPRINTF(("coff_load_shlib: can't find library %s\n", path));
return error;
}
siz = sizeof(struct coff_filehdr);
- if (error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t) fhp, siz, 0,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
- &resid, p)) {
+ error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t) fhp, siz, 0,
+ UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
+ if (error) {
DPRINTF(("filehdr read error %d\n", error));
vrele(nd.ni_vp);
return error;
struct proc *p;
struct exec_package *epp;
{
- u_long midmag, magic;
- u_short mid;
int error;
struct xexec *xp = epp->ep_hdr;
struct xext *xep;
+/* $NetBSD: ibcs2_fcntl.c,v 1.6 1996/05/03 17:05:20 christos Exp $ */
+
/*
* Copyright (c) 1995 Scott Bartram
* All rights reserved.
#include <compat/ibcs2/ibcs2_syscallargs.h>
#include <compat/ibcs2/ibcs2_util.h>
+static int cvt_o_flags __P((int));
+static void cvt_flock2iflock __P((struct flock *, struct ibcs2_flock *));
+static void cvt_iflock2flock __P((struct ibcs2_flock *, struct flock *));
+static int ioflags2oflags __P((int));
+static int oflags2ioflags __P((int));
+
static int
cvt_o_flags(flags)
int flags;
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return error;
vp = nd.ni_vp;
case IBCS2_F_SETFL:
SCARG(&fa, fd) = SCARG(uap, fd);
SCARG(&fa, cmd) = F_SETFL;
- SCARG(&fa, arg) = (void *)ioflags2oflags(SCARG(uap, arg));
+ SCARG(&fa, arg) = (void *)ioflags2oflags((int) SCARG(uap, arg));
return sys_fcntl(p, &fa, retval);
case IBCS2_F_GETLK:
-/* $NetBSD: ibcs2_ioctl.c,v 1.10 1995/12/26 17:56:36 mycroft Exp $ */
+/* $NetBSD: ibcs2_ioctl.c,v 1.11 1996/05/03 17:05:22 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Scott Bartram
38400,
};
+static void stios2btios __P((struct ibcs2_termios *, struct termios *));
+static void btios2stios __P((struct termios *, struct ibcs2_termios *));
+static void stios2stio __P((struct ibcs2_termios *, struct ibcs2_termio *));
+static void stio2stios __P((struct ibcs2_termio *, struct ibcs2_termios *));
+
static void
stios2btios(st, bt)
struct ibcs2_termios *st;
} */ *uap = v;
struct filedesc *fdp = p->p_fd;
struct file *fp;
- int (*ctl)();
+ int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *));
int error;
if (SCARG(uap, fd) < 0 || SCARG(uap, fd) >= fdp->fd_nfiles ||
SCARG(&sa, pid) = 0;
SCARG(&sa, pgid) = (int)SCARG(uap, data);
- if (error = sys_setpgid(p, &sa, retval))
+ if ((error = sys_setpgid(p, &sa, retval)) != 0)
return error;
return 0;
}
+/* $NetBSD: ibcs2_ipc.c,v 1.6 1996/05/03 17:05:23 christos Exp $ */
+
/*
* Copyright (c) 1995 Scott Bartram
* All rights reserved.
ibcs2_time_t msg_ctime;
};
+static void cvt_msqid2imsqid __P((struct msqid_ds *, struct ibcs2_msqid_ds *));
+static void cvt_imsqid2msqid __P((struct ibcs2_msqid_ds *, struct msqid_ds *));
+
static void
cvt_msqid2imsqid(bp, ibp)
-struct msqid_ds *bp;
-struct ibcs2_msqid_ds *ibp;
+ struct msqid_ds *bp;
+ struct ibcs2_msqid_ds *ibp;
{
ibp->msg_perm = bp->msg_perm;
ibp->msg_first = bp->msg_first;
static void
cvt_imsqid2msqid(ibp, bp)
-struct ibcs2_msqid_ds *ibp;
-struct msqid_ds *bp;
+ struct ibcs2_msqid_ds *ibp;
+ struct msqid_ds *bp;
{
bp->msg_perm = ibp->msg_perm;
bp->msg_first = ibp->msg_first;
case IBCS2_IPC_STAT:
error = compat_10_sys_msgsys(p, &margs, retval);
if (!error)
- cvt_msqid2imsqid(SCARG(&margs, a4),
+ cvt_msqid2imsqid((struct msqid_ds *)
+ SCARG(&margs, a4),
(struct ibcs2_msqid_ds *)SCARG(uap, a4));
return error;
case IBCS2_IPC_SET:
cvt_imsqid2msqid((struct ibcs2_msqid_ds *)SCARG(uap,
a4),
- SCARG(&margs, a4));
+ (struct msqid_ds *) SCARG(&margs, a4));
return compat_10_sys_msgsys(p, &margs, retval);
case IBCS2_IPC_RMID:
return compat_10_sys_msgsys(p, &margs, retval);
u_short semzcnt;
};
+static void cvt_semid2isemid __P((struct semid_ds *, struct ibcs2_semid_ds *));
+static void cvt_isemid2semid __P((struct ibcs2_semid_ds *, struct semid_ds *));
+#ifdef notdef
+static void cvt_sem2isem __P((struct sem *, struct ibcs2_sem *));
+static void cvt_isem2sem __P((struct ibcs2_sem *, struct sem *));
+
static void
cvt_sem2isem(bp, ibp)
-struct sem *bp;
-struct ibcs2_sem *ibp;
+ struct sem *bp;
+ struct ibcs2_sem *ibp;
{
ibp->semval = bp->semval;
ibp->sempid = bp->sempid;
static void
cvt_isem2sem(ibp, bp)
-struct ibcs2_sem *ibp;
-struct sem *bp;
+ struct ibcs2_sem *ibp;
+ struct sem *bp;
{
bp->semval = ibp->semval;
bp->sempid = ibp->sempid;
bp->semzcnt = ibp->semzcnt;
return;
}
+#endif
static void
cvt_semid2isemid(bp, ibp)
-struct semid_ds *bp;
-struct ibcs2_semid_ds *ibp;
+ struct semid_ds *bp;
+ struct ibcs2_semid_ds *ibp;
{
ibp->sem_perm = bp->sem_perm;
ibp->sem_base = (struct ibcs2_sem *)bp->sem_base;
static void
cvt_isemid2semid(ibp, bp)
-struct ibcs2_semid_ds *ibp;
-struct semid_ds *bp;
+ struct ibcs2_semid_ds *ibp;
+ struct semid_ds *bp;
{
bp->sem_perm = ibp->sem_perm;
bp->sem_base = (struct sem *)ibp->sem_base;
ibcs2_time_t shm_ctime;
};
+static void cvt_shmid2ishmid __P((struct shmid_ds *, struct ibcs2_shmid_ds *));
+static void cvt_ishmid2shmid __P((struct ibcs2_shmid_ds *, struct shmid_ds *));
+
static void
cvt_shmid2ishmid(bp, ibp)
-struct shmid_ds *bp;
-struct ibcs2_shmid_ds *ibp;
+ struct shmid_ds *bp;
+ struct ibcs2_shmid_ds *ibp;
{
ibp->shm_perm = bp->shm_perm;
ibp->shm_segsz = bp->shm_segsz;
static void
cvt_ishmid2shmid(ibp, bp)
-struct ibcs2_shmid_ds *ibp;
-struct shmid_ds *bp;
+ struct ibcs2_shmid_ds *ibp;
+ struct shmid_ds *bp;
{
bp->shm_perm = ibp->shm_perm;
bp->shm_segsz = ibp->shm_segsz;
-/* $NetBSD: ibcs2_misc.c,v 1.14 1996/01/07 06:11:13 mycroft Exp $ */
+/* $NetBSD: ibcs2_misc.c,v 1.15 1996/05/03 17:05:25 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Scott Bartram
syscallarg(int) cmd;
syscallarg(int) newlimit;
} */ *uap = v;
+#ifdef notyet
int error;
struct rlimit rl;
struct sys_setrlimit_args sra;
+#endif
#define IBCS2_GETFSIZE 1
#define IBCS2_SETFSIZE 2
#define IBCS2_GETPSIZE 3
syscallarg(int) a2;
syscallarg(int) a3;
} */ *uap = v;
- int error, status;
+ int error;
struct sys_wait4_args w4;
#define WAITPID_EFLAGS 0x8c4 /* OF, SF, ZF, PF */
void *v;
register_t *retval;
{
+#ifdef notyet
struct ibcs2_sys_mount_args /* {
syscallarg(char *) special;
syscallarg(char *) dir;
syscallarg(char *) data;
syscallarg(int) len;
} */ *uap = v;
-#ifdef notyet
int oflags = SCARG(uap, flags), nflags, error;
char fsname[MFSNAMELEN];
u_long *cookiebuf, *cookie;
int ncookies;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) {
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) {
if (error == EINVAL)
return sys_read(p, uap, retval);
else
* First we read into the malloc'ed buffer, then
* we massage it into user space, one record at a time.
*/
- if (error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, cookiebuf,
- ncookies)) {
+ error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, cookiebuf,
+ ncookies);
+ if (error) {
DPRINTF(("VOP_READDIR failed: %d\n", error));
goto out;
}
idb.ino = (bdp->d_fileno > 0xfffe) ? 0xfffe : bdp->d_fileno;
(void)copystr(bdp->d_name, idb.name, 14, &size);
bzero(idb.name + size, 14 - size);
- if (error = copyout(&idb, outp, sizeof(struct ibcs2_direct)))
+ error = copyout(&idb, outp, sizeof(struct ibcs2_direct));
+ if (error)
goto out;
/* advance past this real entry */
off = *cookie++; /* each entry points to the next */
syscallarg(ibcs2_gid_t *) gidset;
} */ *uap = v;
int error, i;
- ibcs2_gid_t igid, *iset;
+ ibcs2_gid_t *iset = NULL;
struct sys_getgroups_args sa;
gid_t *gp;
caddr_t sg = stackgap_init(p->p_emul);
iset = stackgap_alloc(&sg, SCARG(uap, gidsetsize) *
sizeof(ibcs2_gid_t));
}
- if (error = sys_getgroups(p, &sa, retval))
+ if ((error = sys_getgroups(p, &sa, retval)) != 0)
return error;
for (i = 0, gp = SCARG(&sa, gidset); i < retval[0]; i++)
iset[i] = (ibcs2_gid_t)*gp++;
syscallarg(ibcs2_gid_t *) gidset;
} */ *uap = v;
int error, i;
- ibcs2_gid_t igid, *iset;
+ ibcs2_gid_t *iset;
struct sys_setgroups_args sa;
gid_t *gp;
caddr_t sg = stackgap_init(p->p_emul);
iset = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) *
sizeof(ibcs2_gid_t *));
if (SCARG(&sa, gidsetsize)) {
- if (error = copyin((caddr_t)SCARG(uap, gidset), (caddr_t)iset,
- sizeof(ibcs2_gid_t *) *
- SCARG(uap, gidsetsize)))
+ error = copyin((caddr_t)SCARG(uap, gidset), (caddr_t)iset,
+ sizeof(ibcs2_gid_t *) * SCARG(uap, gidsetsize));
+ if (error)
return error;
}
for (i = 0, gp = SCARG(&sa, gidset); i < SCARG(&sa, gidsetsize); i++)
SCARG(&ga, which) = RLIMIT_NPROC;
SCARG(&ga, rlp) = stackgap_alloc(&sg, sizeof(struct rlimit *));
- if (error = sys_getrlimit(p, &ga, retval))
+ if ((error = sys_getrlimit(p, &ga, retval)) != 0)
return error;
*retval = SCARG(&ga, rlp)->rlim_cur;
return 0;
SCARG(&ga, which) = RLIMIT_NOFILE;
SCARG(&ga, rlp) = stackgap_alloc(&sg, sizeof(struct rlimit *));
- if (error = sys_getrlimit(p, &ga, retval))
+ if ((error = sys_getrlimit(p, &ga, retval)) != 0)
return error;
*retval = SCARG(&ga, rlp)->rlim_cur;
return 0;
SCARG(&sa, oldlenp) = &len;
SCARG(&sa, new) = NULL;
SCARG(&sa, newlen) = 0;
- if (error = sys___sysctl(p, &sa, retval))
+ if ((error = sys___sysctl(p, &sa, retval)) != 0)
return error;
*retval = value;
return 0;
void *v;
register_t *retval;
{
+#ifdef notyet
struct ibcs2_sys_getmsg_args /* {
syscallarg(int) fd;
syscallarg(struct ibcs2_stropts *) ctl;
syscallarg(struct ibcs2_stropts *) dat;
syscallarg(int *) flags;
} */ *uap = v;
+#endif
return 0;
}
void *v;
register_t *retval;
{
+#ifdef notyet
struct ibcs2_sys_putmsg_args /* {
syscallarg(int) fd;
syscallarg(struct ibcs2_stropts *) ctl;
syscallarg(struct ibcs2_stropts *) dat;
syscallarg(int) flags;
} */ *uap = v;
+#endif
return 0;
}
SCARG(&sa, tv) = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv)));
SCARG(&sa, tzp) = NULL;
- if (error = copyin((caddr_t)SCARG(uap, timep),
- &(SCARG(&sa, tv)->tv_sec), sizeof(long)))
+ error = copyin((caddr_t)SCARG(uap, timep),
+ &(SCARG(&sa, tv)->tv_sec), sizeof(long));
+ if (error)
return error;
SCARG(&sa, tv)->tv_usec = 0;
- if (error = sys_settimeofday(p, &sa, retval))
+ if ((error = sys_settimeofday(p, &sa, retval)) != 0)
return EPERM;
return 0;
}
if (SCARG(uap, buf)) {
struct ibcs2_utimbuf ubuf;
- if (error = copyin((caddr_t)SCARG(uap, buf), (caddr_t)&ubuf,
- sizeof(ubuf)))
+ error = copyin((caddr_t)SCARG(uap, buf), (caddr_t)&ubuf,
+ sizeof(ubuf));
+ if (error)
return error;
SCARG(&sa, tptr) = stackgap_alloc(&sg,
2 * sizeof(struct timeval *));
struct ibcs2_sys_nice_args /* {
syscallarg(int) incr;
} */ *uap = v;
- int error, cur_nice = p->p_nice;
+ int error;
struct sys_setpriority_args sa;
SCARG(&sa, which) = PRIO_PROCESS;
SCARG(&sa, who) = 0;
SCARG(&sa, prio) = p->p_nice + SCARG(uap, incr);
- if (error = sys_setpriority(p, &sa, retval))
+ if ((error = sys_setpriority(p, &sa, retval)) != 0)
return EPERM;
*retval = p->p_nice;
return 0;
#define IBCS2_DATALOCK 4
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return EPERM;
switch(SCARG(uap, cmd)) {
case IBCS2_UNLOCK:
#define SCO_AD_GETCMAJ 1
/* XXX: is this the right place for this call? */
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return (error);
switch(SCARG(uap, cmd)) {
void *v;
register_t *retval;
{
+#ifdef notyet
struct ibcs2_sys_poll_args /* {
syscallarg(struct ibcs2_pollfd *) fds;
syscallarg(long) nfds;
syscallarg(int) timeout;
} */ *uap = v;
+#endif
return EINVAL; /* XXX - TODO */
}
SCARG(&sa, fd) = SCARG(uap, fd);
SCARG(&sa, com) = FIONREAD;
SCARG(&sa, data) = stackgap_alloc(&sg, sizeof(int));
- if (error = sys_ioctl(p, &sa, retval))
+ if ((error = sys_ioctl(p, &sa, retval)) != 0)
return error;
*retval = (*((int*)SCARG(&sa, data))) ? 1 : 0;
return 0;
void *v;
register_t *retval;
{
+#ifdef notyet
struct xenix_sys_nap_args /* {
syscallarg(int) millisec;
} */ *uap = v;
+#endif
return ENOSYS;
}
-/* $NetBSD: ibcs2_signal.c,v 1.7 1995/10/07 06:26:52 mycroft Exp $ */
+/* $NetBSD: ibcs2_signal.c,v 1.8 1996/05/03 17:05:27 christos Exp $ */
/*
* Copyright (c) 1995 Scott Bartram
0, /* 31 */
};
+void ibcs2_to_bsd_sigset __P((const ibcs2_sigset_t *, sigset_t *));
+void bsd_to_ibcs2_sigset __P((const sigset_t *, ibcs2_sigset_t *));
+void ibcs2_to_bsd_sigaction __P((struct ibcs2_sigaction *,
+ struct sigaction *));
+void bsd_to_ibcs2_sigaction __P((struct sigaction *, struct ibcs2_sigaction *));
+
void
ibcs2_to_bsd_sigset(iss, bss)
const ibcs2_sigset_t *iss;
-/* $NetBSD: ibcs2_signal.h,v 1.7 1995/08/14 02:26:01 mycroft Exp $ */
+/* $NetBSD: ibcs2_signal.h,v 1.8 1996/05/03 17:05:28 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Scott Bartram
#define IBCS2_SIGNO(x) ((x) & IBCS2_SIGNO_MASK)
#define IBCS2_SIGCALL(x) ((x) & ~IBCS2_SIGNO_MASK)
-#define IBCS2_SIG_DFL (void(*)())0
-#define IBCS2_SIG_ERR (void(*)())-1
-#define IBCS2_SIG_IGN (void(*)())1
-#define IBCS2_SIG_HOLD (void(*)())2
+#define IBCS2_SIG_DFL (void(*) __P((int))) 0
+#define IBCS2_SIG_ERR (void(*) __P((int))) -1
+#define IBCS2_SIG_IGN (void(*) __P((int))) 1
+#define IBCS2_SIG_HOLD (void(*) __P((int))) 2
#define IBCS2_SIG_SETMASK 0
#define IBCS2_SIG_BLOCK 1
+/* $NetBSD: ibcs2_socksys.c,v 1.4 1996/05/03 17:05:29 christos Exp $ */
+
/*
* Copyright (c) 1994, 1995 Scott Bartram
* Copyright (c) 1994 Arne H Juul
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/tty.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#include <sys/mount.h>
#include <net/if.h>
+
+#include <sys/syscallargs.h>
+
#include <compat/ibcs2/ibcs2_socksys.h>
#include <compat/ibcs2/ibcs2_util.h>
};
int
-ibcs2_socksys(p, uap, retval)
+ibcs2_socksys(p, v, retval)
register struct proc *p;
- register struct ibcs2_socksys_args *uap;
+ void *v;
register_t *retval;
{
- register struct filedesc *fdp = p->p_fd;
- register struct file *fp;
+ register struct ibcs2_socksys_args *uap = v;
int error;
int realargs[7]; /* 1 for command, 6 for recvfrom */
* The others are (and should be) only legal on sockets.
*/
- if (error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs)))
+ error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs));
+ if (error)
return error;
DPRINTF(("ibcs2_socksys: %08x %08x %08x %08x %08x %08x %08x\n",
realargs[0], realargs[1], realargs[2], realargs[3],
+/* $NetBSD: ibcs2_socksys.h,v 1.2 1996/05/03 17:05:30 christos Exp $ */
+
/*
* Copyright (c) 1994, 1995 Scott Bartram
* Copyright (c) 1994 Arne H Juul
int flags;
};
+int ibcs2_socksys __P((struct proc *, void *, register_t *));
+
#endif /* _IBCS2_SOCKSYS_H */
+/* $NetBSD: ibcs2_stat.c,v 1.5 1996/05/03 17:05:32 christos Exp $ */
/*
* Copyright (c) 1995 Scott Bartram
* All rights reserved.
#include <compat/ibcs2/ibcs2_util.h>
#include <compat/ibcs2/ibcs2_utsname.h>
+static void bsd_stat2ibcs_stat __P((struct ostat *, struct ibcs2_stat *));
+static int cvt_statfs __P((struct statfs *, caddr_t, int));
static void
bsd_stat2ibcs_stat(st, st4)
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if (error = namei(&nd))
+ if ((error = namei(&nd)) != 0)
return (error);
mp = nd.ni_vp->v_mount;
sp = &mp->mnt_stat;
vrele(nd.ni_vp);
- if (error = VFS_STATFS(mp, sp, p))
+ if ((error = VFS_STATFS(mp, sp, p)) != 0)
return (error);
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len));
register struct statfs *sp;
int error;
- if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp))
+ if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
sp = &mp->mnt_stat;
- if (error = VFS_STATFS(mp, sp, p))
+ if ((error = VFS_STATFS(mp, sp, p)) != 0)
return (error);
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len));
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st));
- if (error = compat_43_sys_stat(p, &cup, retval))
+ if ((error = compat_43_sys_stat(p, &cup, retval)) != 0)
return error;
- if (error = copyin(SCARG(&cup, ub), &st, sizeof(st)))
+ if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0)
return error;
bsd_stat2ibcs_stat(&st, &ibcs2_st);
return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st),
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st));
- if (error = compat_43_sys_lstat(p, &cup, retval))
+ if ((error = compat_43_sys_lstat(p, &cup, retval)) != 0)
return error;
- if (error = copyin(SCARG(&cup, ub), &st, sizeof(st)))
+ if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0)
return error;
bsd_stat2ibcs_stat(&st, &ibcs2_st);
return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st),
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(st));
- if (error = compat_43_sys_fstat(p, &cup, retval))
+ if ((error = compat_43_sys_fstat(p, &cup, retval)) != 0)
return error;
- if (error = copyin(SCARG(&cup, sb), &st, sizeof(st)))
+ if ((error = copyin(SCARG(&cup, sb), &st, sizeof(st))) != 0)
return error;
bsd_stat2ibcs_stat(&st, &ibcs2_st);
return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st),
+/* $NetBSD: ibcs2_stropts.h,v 1.2 1996/05/03 17:05:33 christos Exp $ */
+
/*
* ibcs2_stropts.h
* Copyright (c) 1995 Scott Bartram
+/* $NetBSD: ibcs2_timeb.h,v 1.2 1996/05/03 17:05:34 christos Exp $ */
+
/*
* Copyright (c) 1995 Scott Bartram
* All rights reserved.
+/* $NetBSD: ibcs2_utime.h,v 1.2 1996/05/03 17:05:35 christos Exp $ */
+
/*
* Copyright (c) 1995 Scott Bartram
* All rights reserved.
-/* $OpenBSD: svr4_sockio.c,v 1.5 1996/05/02 13:06:53 deraadt Exp $ */
-/* $NetBSD: svr4_sockio.c,v 1.9 1996/04/22 01:17:33 christos Exp $ */
+/* $OpenBSD: svr4_sockio.c,v 1.6 1996/05/07 08:49:20 deraadt Exp $ */
+/* $NetBSD: svr4_sockio.c,v 1.10 1996/05/03 17:09:15 christos Exp $ */
/*
* Copyright (c) 1995 Christos Zoulas
if ((error = copyin(data, &sr, sizeof(sr))) != 0)
return error;
- (void) strcpy(br.ifr_name, sr.svr4_ifr_name);
+ (void) strncpy(br.ifr_name, sr.svr4_ifr_name,
+ sizeof(br.ifr_name));
+
if ((error = (*ctl)(fp, SIOCGIFFLAGS,
(caddr_t) &br, p)) != 0) {
DPRINTF(("SIOCGIFFLAGS %s: error %d\n",