Add xmknod()

This commit is contained in:
christos 1996-02-02 01:17:24 +00:00
parent 4aacfbf721
commit 9840c3ca68
2 changed files with 48 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_misc.c,v 1.30 1996/01/30 20:05:33 mycroft Exp $ */
/* $NetBSD: svr4_misc.c,v 1.31 1996/02/02 01:17:24 christos Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -92,6 +92,9 @@ static void bsd_statfs_to_svr4_statvfs __P((const struct statfs *,
struct svr4_statvfs *));
static struct proc *svr4_pfind __P((pid_t pid));
static int svr4_mknod __P((struct proc *, register_t *, char *,
svr4_dev_t, svr4_mode_t));
int
svr4_sys_wait(p, v, retval)
register struct proc *p;
@ -360,6 +363,32 @@ svr4_sys_fchroot(p, v, retval)
return 0;
}
static int
svr4_mknod(p, retval, path, dev, mode)
struct proc *p;
register_t *retval;
char *path;
svr4_dev_t dev;
svr4_mode_t mode;
{
caddr_t sg = stackgap_init(p->p_emul);
SVR4_CHECK_ALT_EXIST(p, &sg, path);
if (S_ISFIFO(mode)) {
struct sys_mkfifo_args ap;
SCARG(&ap, path) = path;
SCARG(&ap, mode) = mode;
return sys_mkfifo(p, &ap, retval);
} else {
struct sys_mknod_args ap;
SCARG(&ap, path) = path;
SCARG(&ap, mode) = mode;
SCARG(&ap, dev) = dev;
return sys_mknod(p, &ap, retval);
}
}
int
svr4_sys_mknod(p, v, retval)
@ -368,23 +397,23 @@ svr4_sys_mknod(p, v, retval)
register_t *retval;
{
struct svr4_sys_mknod_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul);
SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
if (S_ISFIFO(SCARG(uap, mode))) {
struct sys_mkfifo_args ap;
SCARG(&ap, path) = SCARG(uap, path);
SCARG(&ap, mode) = SCARG(uap, mode);
return sys_mkfifo(p, &ap, retval);
} else {
struct sys_mknod_args ap;
SCARG(&ap, path) = SCARG(uap, path);
SCARG(&ap, mode) = SCARG(uap, mode);
SCARG(&ap, dev) = SCARG(uap, dev);
return sys_mknod(p, &ap, retval);
}
return svr4_mknod(p, retval,
SCARG(uap, path), SCARG(uap, dev), SCARG(uap, mode));
}
int
svr4_sys_xmknod(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_sys_xmknod_args *uap = v;
return svr4_mknod(p, retval,
SCARG(uap, path), SCARG(uap, dev), SCARG(uap, mode));
}
int
svr4_sys_vhangup(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.15 1995/12/19 07:13:27 christos Exp $
$NetBSD: syscalls.master,v 1.16 1996/02/02 01:17:28 christos Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -209,7 +209,8 @@
struct svr4_xstat *ub); }
125 STD { int svr4_sys_fxstat(int two, int fd, \
struct svr4_xstat *sb); }
126 UNIMPL xmknod
126 STD { int svr4_sys_xmknod(int two, char *path, \
svr4_dev_t dev, svr4_mode_t mode); }
127 UNIMPL clocal
128 STD { int svr4_sys_setrlimit(int which, \
struct ogetrlimit *rlp); }