diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2002-08-17 02:36:16 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2002-08-17 02:36:16 +0000 |
| commit | d49fa1ca6ed75bd712b6eecb7383e9abe8b96943 (patch) | |
| tree | fe31f7ea9a8713005d8ba378b027671dbea5c058 /sys/compat | |
| parent | c068736a6139e9a60b6b4747f762a572e1b002f4 (diff) | |
Notes
Diffstat (limited to 'sys/compat')
| -rw-r--r-- | sys/compat/linux/linux_file.c | 3 | ||||
| -rw-r--r-- | sys/compat/linux/linux_ioctl.c | 54 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_fcntl.c | 3 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_filio.c | 2 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_sockio.c | 6 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_stream.c | 3 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_termios.c | 14 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_ttold.c | 35 |
8 files changed, 79 insertions, 41 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 847e23e50fb27..fc634ba3adfd3 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -143,7 +143,8 @@ linux_open(struct thread *td, struct linux_open_args *args) PROC_UNLOCK(p); if (!error) { if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td); + fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td->td_ucred, + td); fdrop(fp, td); } } else { diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 77e2942806226..05fc0bddd3b8b 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -113,7 +113,8 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) return (error); switch (args->cmd & 0xffff) { case LINUX_BLKGETSIZE: - error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, td); + error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, td->td_ucred, + td); fdrop(fp, td); if (error) return (error); @@ -560,7 +561,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) switch (args->cmd & 0xffff) { case LINUX_TCGETS: - error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td); + error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td->td_ucred, + td); if (error) break; bsd_to_linux_termios(&bios, &lios); @@ -572,7 +574,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; linux_to_bsd_termios(&lios, &bios); - error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td)); + error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td->td_ucred, + td)); break; case LINUX_TCSETSW: @@ -580,7 +583,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; linux_to_bsd_termios(&lios, &bios); - error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td)); + error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td->td_ucred, + td)); break; case LINUX_TCSETSF: @@ -588,11 +592,13 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; linux_to_bsd_termios(&lios, &bios); - error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td)); + error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td->td_ucred, + td)); break; case LINUX_TCGETA: - error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td); + error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td->td_ucred, + td); if (error) break; bsd_to_linux_termio(&bios, &lio); @@ -604,7 +610,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; linux_to_bsd_termio(&lio, &bios); - error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td)); + error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td->td_ucred, + td)); break; case LINUX_TCSETAW: @@ -612,7 +619,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; linux_to_bsd_termio(&lio, &bios); - error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td)); + error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td->td_ucred, + td)); break; case LINUX_TCSETAF: @@ -620,7 +628,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; linux_to_bsd_termio(&lio, &bios); - error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td)); + error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td->td_ucred, + td)); break; /* LINUX_TCSBRK */ @@ -637,7 +646,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) case LINUX_TCION: { int c; struct write_args wr; - error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td); + error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, + td->td_ucred, td); if (error) break; fdrop(fp, td); @@ -799,14 +809,16 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) fdrop(fp, td); return (EINVAL); } - error = (fo_ioctl(fp, TIOCSETD, (caddr_t)&line, td)); + error = (fo_ioctl(fp, TIOCSETD, (caddr_t)&line, td->td_ucred, + td)); break; } case LINUX_TIOCGETD: { int linux_line; int bsd_line = TTYDISC; - error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td); + error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, + td->td_ucred, td); if (error) return (error); switch (bsd_line) { @@ -1275,7 +1287,8 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) case LINUX_CDROMREADTOCHDR: { struct ioc_toc_header th; struct linux_cdrom_tochdr lth; - error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&th, td); + error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&th, + td->td_ucred, td); if (!error) { lth.cdth_trk0 = th.starting_track; lth.cdth_trk1 = th.ending_track; @@ -1290,7 +1303,8 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) struct ioc_read_toc_single_entry irtse; irtse.address_format = ltep->cdte_format; irtse.track = ltep->cdte_track; - error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse, td); + error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse, + td->td_ucred, td); if (!error) { lte = *ltep; lte.cdte_ctrl = irtse.entry.control; @@ -1331,7 +1345,8 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) bsdsc.track = 0; bsdsc.data_len = sizeof(struct cd_sub_channel_info); bsdsc.data = bsdinfo; - error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, td); + error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, + td->td_ucred, td); if (error) break; error = copyin((caddr_t)args->arg, &sc, @@ -1397,7 +1412,8 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) error = linux_to_bsd_dvd_struct(&lds, &bds); if (error) break; - error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)&bds, td); + error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)&bds, + td->td_ucred, td); if (error) break; error = bsd_to_linux_dvd_struct(&bds, &lds); @@ -1422,7 +1438,8 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) error = linux_to_bsd_dvd_authinfo(&lda, &bcode, &bda); if (error) break; - error = fo_ioctl(fp, bcode, (caddr_t)&bda, td); + error = fo_ioctl(fp, bcode, (caddr_t)&bda, td->td_ucred, + td); if (error) { if (lda.type == LINUX_DVD_HOST_SEND_KEY2) { lda.type = LINUX_DVD_AUTH_FAILURE; @@ -1759,7 +1776,8 @@ linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) fdrop(fp, td); return (EINVAL); } - error = (fo_ioctl(fp, KDSKBMODE, (caddr_t)&kbdmode, td)); + error = (fo_ioctl(fp, KDSKBMODE, (caddr_t)&kbdmode, + td->td_ucred, td)); break; } diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index e63ac02cde0cf..fa4ddf2cafc76 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -399,7 +399,8 @@ svr4_sys_open(td, uap) return (EBADF); /* XXX: correct errno? */ /* ignore any error, just give it a try */ if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td); + fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td->td_ucred, + td); fdrop(fp, td); } else { PROC_UNLOCK(p); diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c index ef9b8b67c8d1d..c2bad1d41b144 100644 --- a/sys/compat/svr4/svr4_filio.c +++ b/sys/compat/svr4/svr4_filio.c @@ -219,7 +219,7 @@ svr4_fil_ioctl(fp, td, retval, fd, cmd, data) #ifdef SVR4_DEBUG if (cmd == FIOASYNC) DPRINTF(("FIOASYNC\n")); #endif - error = fo_ioctl(fp, cmd, (caddr_t) &num, td); + error = fo_ioctl(fp, cmd, (caddr_t) &num, td->td_ucred, td); if (error) return error; diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c index 9f41e10efad0e..7bb25e0047067 100644 --- a/sys/compat/svr4/svr4_sockio.c +++ b/sys/compat/svr4/svr4_sockio.c @@ -125,7 +125,8 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, data) (void) strncpy(br.ifr_name, sr.svr4_ifr_name, sizeof(br.ifr_name)); if ((error = fo_ioctl(fp, SIOCGIFFLAGS, - (caddr_t) &br, td)) != 0) { + (caddr_t) &br, td->td_ucred, + td)) != 0) { DPRINTF(("SIOCGIFFLAGS (%s) %s: error %d\n", br.ifr_name, sr.svr4_ifr_name, error)); return error; @@ -149,7 +150,8 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, data) sc.svr4_ifc_len)); if ((error = fo_ioctl(fp, OSIOCGIFCONF, - (caddr_t) &sc, td)) != 0) + (caddr_t) &sc, td->td_ucred, + td)) != 0) return error; DPRINTF(("SIOCGIFCONF\n")); diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 2f0d5e31e3eba..1618ac1db50a9 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1267,7 +1267,8 @@ i_nread(fp, td, retval, fd, cmd, dat) * for us, and if we do, then we assume that we have at least one * message waiting for us. */ - if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td)) != 0) + if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td->td_ucred, + td)) != 0) return error; if (nread != 0) diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c index 5fdd5a63705eb..ab1e7991a442a 100644 --- a/sys/compat/svr4/svr4_termios.c +++ b/sys/compat/svr4/svr4_termios.c @@ -499,7 +499,8 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) case SVR4_TCGETA: case SVR4_TCGETS: DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S')); - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, + td->td_ucred, td)) != 0) return error; memset(&st, 0, sizeof(st)); @@ -526,7 +527,8 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) case SVR4_TCSETSF: DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n")); /* get full BSD termios so we don't lose information */ - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, + td->td_ucred, td)) != 0) return error; switch (cmd) { @@ -577,14 +579,15 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) print_svr4_termios(&st); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, cmd, (caddr_t) &bt, td); + return fo_ioctl(fp, cmd, (caddr_t) &bt, td->td_ucred, td); case SVR4_TIOCGWINSZ: DPRINTF(("TIOCGWINSZ\n")); { struct svr4_winsize ws; - error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, td); + error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, + td->td_ucred, td); if (error) return error; return copyout(&ws, data, sizeof(ws)); @@ -597,7 +600,8 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) if ((error = copyin(data, &ws, sizeof(ws))) != 0) return error; - return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, td); + return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, + td->td_ucred, td); } default: diff --git a/sys/compat/svr4/svr4_ttold.c b/sys/compat/svr4/svr4_ttold.c index 47a813580cff4..7e4f23478de89 100644 --- a/sys/compat/svr4/svr4_ttold.c +++ b/sys/compat/svr4/svr4_ttold.c @@ -192,8 +192,9 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) { pid_t pid; - if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, td)) != 0) - return error; + if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, + td->td_ucred, td)) != 0) + return error; DPRINTF(("TIOCGPGRP %d\n", pid)); @@ -211,14 +212,16 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) DPRINTF(("TIOCSPGRP %d\n", pid)); - return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, td); + return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, + td->td_ucred, td); } case SVR4_TIOCGSID: { #if defined(TIOCGSID) pid_t pid; - if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, + td->td_ucred, td)) != 0) return error; DPRINTF(("TIOCGSID %d\n", pid)); @@ -235,7 +238,8 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) struct sgttyb bs; struct svr4_sgttyb ss; - error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, td); + error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, + td->td_ucred, td); if (error) return error; @@ -260,7 +264,8 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) print_svr4_sgttyb("SVR4_TIOCSET{P,N}", &ss); #endif /* DEBUG_SVR4 */ cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN; - return fo_ioctl(fp, cmd, (caddr_t) &bs, td); + return fo_ioctl(fp, cmd, (caddr_t) &bs, + td->td_ucred, td); } case SVR4_TIOCGETC: @@ -268,7 +273,8 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) struct tchars bt; struct svr4_tchars st; - error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, td); + error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, + td->td_ucred, td); if (error) return error; @@ -291,7 +297,8 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) #ifdef DEBUG_SVR4 print_svr4_tchars("SVR4_TIOCSETC", &st); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, td); + return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, + td->td_ucred, td); } case SVR4_TIOCGLTC: @@ -299,7 +306,8 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) struct ltchars bl; struct svr4_ltchars sl; - error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, td); + error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, + td->td_ucred, td); if (error) return error; @@ -322,13 +330,15 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) #ifdef DEBUG_SVR4 print_svr4_ltchars("SVR4_TIOCSLTC", &sl); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, td); + return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, + td->td_ucred, td); } case SVR4_TIOCLGET: { int flags; - if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, td)) != 0) + if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, + td->td_ucred, td)) != 0) return error; DPRINTF(("SVR4_TIOCLGET %o\n", flags)); return copyout(&flags, data, sizeof(flags)); @@ -356,7 +366,8 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data) } DPRINTF(("SVR4_TIOCL{SET,BIS,BIC} %o\n", flags)); - return fo_ioctl(fp, cmd, (caddr_t) &flags, td); + return fo_ioctl(fp, cmd, (caddr_t) &flags, + td->td_ucred, td); } default: |
