Don't define our own (incorrect!) dup(2); just use the NetBSD version.
This commit is contained in:
parent
e4ad645398
commit
ea5fdab7bb
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hpux_compat.c,v 1.55 2001/05/30 11:37:23 mrg Exp $ */
|
||||
/* $NetBSD: hpux_compat.c,v 1.56 2001/06/06 16:17:40 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -358,36 +358,6 @@ hpux_sys_writev(p, v, retval)
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* 4.3bsd dup allows dup2 to come in on the same syscall entry
|
||||
* and hence allows two arguments. HP-UX dup has only one arg.
|
||||
*/
|
||||
int
|
||||
hpux_sys_dup(p, v, retval)
|
||||
struct proc *p;
|
||||
void *v;
|
||||
register_t *retval;
|
||||
{
|
||||
struct hpux_sys_dup_args *uap = v;
|
||||
struct filedesc *fdp = p->p_fd;
|
||||
struct file *fp;
|
||||
int fd, error;
|
||||
|
||||
if (((unsigned)SCARG(uap, fd)) >= fdp->fd_nfiles ||
|
||||
(fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL)
|
||||
return (EBADF);
|
||||
if ((error = fdalloc(p, 0, &fd)))
|
||||
return (error);
|
||||
fdp->fd_ofiles[fd] = fp;
|
||||
fdp->fd_ofileflags[fd] =
|
||||
fdp->fd_ofileflags[SCARG(uap, fd)] &~ UF_EXCLOSE;
|
||||
fp->f_count++;
|
||||
if (fd > fdp->fd_lastfile)
|
||||
fdp->fd_lastfile = fd;
|
||||
*retval = fd;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
hpux_sys_utssys(p, v, retval)
|
||||
struct proc *p;
|
||||
|
@ -1,4 +1,4 @@
|
||||
$NetBSD: syscalls.master,v 1.25 2001/05/30 11:37:24 mrg Exp $
|
||||
$NetBSD: syscalls.master,v 1.26 2001/06/06 16:17:40 thorpej Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
39 STD { int hpux_sys_setpgrp_6x(void); }
|
||||
40 STD { int hpux_sys_lstat(const char *path, \
|
||||
struct hpux_stat *sb); }
|
||||
41 STD { int hpux_sys_dup(int fd); }
|
||||
41 NOARGS { int sys_dup(int fd); }
|
||||
42 NOARGS { int sys_pipe(void); }
|
||||
43 STD { int hpux_sys_times_6x(struct tms *tms); }
|
||||
44 NOARGS { int sys_profil(caddr_t samples, u_int size, \
|
||||
|
Loading…
Reference in New Issue
Block a user