- small ioctl naming changes.
- pass ioctl fd explicitly.
This commit is contained in:
parent
3b309224fd
commit
5fda4b10a2
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: svr4_filio.c,v 1.4 1996/03/30 22:37:52 christos Exp $ */
|
/* $NetBSD: svr4_filio.c,v 1.5 1996/04/11 12:54:40 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994 Christos Zoulas
|
* Copyright (c) 1994 Christos Zoulas
|
||||||
|
@ -53,17 +53,17 @@
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
svr4_filioctl(fp, cmd, data, p, retval)
|
svr4_fil_ioctl(fp, p, retval, fd, cmd, data)
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
u_long cmd;
|
|
||||||
caddr_t data;
|
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
register_t *retval;
|
register_t *retval;
|
||||||
{
|
|
||||||
struct filedesc *fdp = p->p_fd;
|
|
||||||
int error;
|
|
||||||
int fd;
|
int fd;
|
||||||
|
u_long cmd;
|
||||||
|
caddr_t data;
|
||||||
|
{
|
||||||
|
int error;
|
||||||
int num;
|
int num;
|
||||||
|
struct filedesc *fdp = p->p_fd;
|
||||||
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
|
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
|
||||||
fp->f_ops->fo_ioctl;
|
fp->f_ops->fo_ioctl;
|
||||||
|
|
||||||
|
@ -71,12 +71,10 @@ svr4_filioctl(fp, cmd, data, p, retval)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SVR4_FIOCLEX:
|
case SVR4_FIOCLEX:
|
||||||
fd = fp - fdp->fd_ofiles[0];
|
|
||||||
fdp->fd_ofileflags[fd] |= UF_EXCLOSE;
|
fdp->fd_ofileflags[fd] |= UF_EXCLOSE;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case SVR4_FIONCLEX:
|
case SVR4_FIONCLEX:
|
||||||
fd = fp - fdp->fd_ofiles[0];
|
|
||||||
fdp->fd_ofileflags[fd] &= ~UF_EXCLOSE;
|
fdp->fd_ofileflags[fd] &= ~UF_EXCLOSE;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: svr4_ioctl.c,v 1.15 1996/03/30 22:37:57 christos Exp $ */
|
/* $NetBSD: svr4_ioctl.c,v 1.16 1996/04/11 12:54:41 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994 Christos Zoulas
|
* Copyright (c) 1994 Christos Zoulas
|
||||||
|
@ -92,6 +92,8 @@ svr4_sys_ioctl(p, v, retval)
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
struct filedesc *fdp;
|
struct filedesc *fdp;
|
||||||
u_long cmd;
|
u_long cmd;
|
||||||
|
int (*fun) __P((struct file *, struct proc *, register_t *,
|
||||||
|
int, u_long, caddr_t));
|
||||||
#ifdef DEBUG_SVR4
|
#ifdef DEBUG_SVR4
|
||||||
char dir[4];
|
char dir[4];
|
||||||
char c;
|
char c;
|
||||||
|
@ -115,22 +117,28 @@ svr4_sys_ioctl(p, v, retval)
|
||||||
|
|
||||||
switch (cmd & 0xff00) {
|
switch (cmd & 0xff00) {
|
||||||
case SVR4_tIOC:
|
case SVR4_tIOC:
|
||||||
return svr4_ttoldioctl(fp, cmd, SCARG(uap, data), p, retval);
|
fun = svr4_ttold_ioctl;
|
||||||
|
break;
|
||||||
|
|
||||||
case SVR4_TIOC:
|
case SVR4_TIOC:
|
||||||
return svr4_termioctl(fp, cmd, SCARG(uap, data), p, retval);
|
fun = svr4_term_ioctl;
|
||||||
|
break;
|
||||||
|
|
||||||
case SVR4_STR:
|
case SVR4_STR:
|
||||||
return svr4_streamioctl(fp, cmd, SCARG(uap, data), p, retval);
|
fun = svr4_stream_ioctl;
|
||||||
|
break;
|
||||||
|
|
||||||
case SVR4_FIOC:
|
case SVR4_FIOC:
|
||||||
return svr4_filioctl(fp, cmd, SCARG(uap, data), p, retval);
|
fun = svr4_fil_ioctl;
|
||||||
|
break;
|
||||||
|
|
||||||
case SVR4_SIOC:
|
case SVR4_SIOC:
|
||||||
return svr4_sockioctl(fp, cmd, SCARG(uap, data), p, retval);
|
fun = svr4_sock_ioctl;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINTF(("Unimplemented ioctl %lx\n", cmd));
|
DPRINTF(("Unimplemented ioctl %lx\n", cmd));
|
||||||
return 0; /* XXX: really ENOSYS */
|
return 0; /* XXX: really ENOSYS */
|
||||||
}
|
}
|
||||||
|
return (*fun)(fp, p, retval, SCARG(uap, fd), cmd, SCARG(uap, data));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: svr4_ioctl.h,v 1.4 1995/10/07 06:27:42 mycroft Exp $ */
|
/* $NetBSD: svr4_ioctl.h,v 1.5 1996/04/11 12:54:43 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994 Christos Zoulas
|
* Copyright (c) 1994 Christos Zoulas
|
||||||
|
@ -43,15 +43,17 @@
|
||||||
#define SVR4_IOW(g,n,t) SVR4_IOC(SVR4_IOC_IN, (g), (n), sizeof(t))
|
#define SVR4_IOW(g,n,t) SVR4_IOC(SVR4_IOC_IN, (g), (n), sizeof(t))
|
||||||
#define SVR4_IOWR(g,n,t) SVR4_IOC(SVR4_IOC_INOUT,(g), (n), sizeof(t))
|
#define SVR4_IOWR(g,n,t) SVR4_IOC(SVR4_IOC_INOUT,(g), (n), sizeof(t))
|
||||||
|
|
||||||
int svr4_streamioctl __P((struct file *fp, u_long cmd, caddr_t data,
|
int svr4_stream_ti_ioctl __P((struct file *, struct proc *, register_t *,
|
||||||
struct proc *p, register_t *retval));
|
int, u_long, caddr_t));
|
||||||
int svr4_termioctl __P((struct file *fp, u_long cmd, caddr_t data,
|
int svr4_stream_ioctl __P((struct file *, struct proc *, register_t *,
|
||||||
struct proc *p, register_t *retval));
|
int, u_long, caddr_t));
|
||||||
int svr4_ttoldioctl __P((struct file *fp, u_long cmd, caddr_t data,
|
int svr4_term_ioctl __P((struct file *, struct proc *, register_t *,
|
||||||
struct proc *p, register_t *retval));
|
int, u_long, caddr_t));
|
||||||
int svr4_filioctl __P((struct file *fp, u_long cmd, caddr_t data,
|
int svr4_ttold_ioctl __P((struct file *, struct proc *, register_t *,
|
||||||
struct proc *p, register_t *retval));
|
int, u_long, caddr_t));
|
||||||
int svr4_sockioctl __P((struct file *fp, u_long cmd, caddr_t data,
|
int svr4_fil_ioctl __P((struct file *, struct proc *, register_t *,
|
||||||
struct proc *p, register_t *retval));
|
int, u_long, caddr_t));
|
||||||
|
int svr4_sock_ioctl __P((struct file *, struct proc *, register_t *,
|
||||||
|
int, u_long, caddr_t));
|
||||||
|
|
||||||
#endif /* !_SVR4_IOCTL_H_ */
|
#endif /* !_SVR4_IOCTL_H_ */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: svr4_sockio.c,v 1.7 1996/03/30 22:38:14 christos Exp $ */
|
/* $NetBSD: svr4_sockio.c,v 1.8 1996/04/11 12:54:44 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995 Christos Zoulas
|
* Copyright (c) 1995 Christos Zoulas
|
||||||
|
@ -76,12 +76,13 @@ bsd_to_svr4_flags(bf)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
svr4_sockioctl(fp, cmd, data, p, retval)
|
svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
u_long cmd;
|
|
||||||
caddr_t data;
|
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
register_t *retval;
|
register_t *retval;
|
||||||
|
int fd;
|
||||||
|
u_long cmd;
|
||||||
|
caddr_t data;
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
|
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: svr4_ttold.c,v 1.8 1996/03/30 22:38:27 christos Exp $ */
|
/* $NetBSD: svr4_ttold.c,v 1.9 1996/04/11 12:54:45 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994 Christos Zoulas
|
* Copyright (c) 1994 Christos Zoulas
|
||||||
|
@ -147,12 +147,13 @@ bsd_ltchars_to_svr4_ltchars(bl, sl)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
svr4_ttoldioctl(fp, cmd, data, p, retval)
|
svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
u_long cmd;
|
|
||||||
caddr_t data;
|
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
register_t *retval;
|
register_t *retval;
|
||||||
|
int fd;
|
||||||
|
u_long cmd;
|
||||||
|
caddr_t data;
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
|
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
|
||||||
|
|
Loading…
Reference in New Issue