projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 88/12/14 15:30:11 by sklower
[unix-history]
/
usr
/
src
/
sys
/
kern
/
tty_tty.c
diff --git
a/usr/src/sys/kern/tty_tty.c
b/usr/src/sys/kern/tty_tty.c
index
cdb4ace
..
882b7f5
100644
(file)
--- a/
usr/src/sys/kern/tty_tty.c
+++ b/
usr/src/sys/kern/tty_tty.c
@@
-1,28
+1,35
@@
-/* tty_tty.c 4.10 82/08/22 */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)tty_tty.c 7.2 (Berkeley) %G%
+ */
/*
* Indirect driver for controlling tty.
*
* THIS IS GARBAGE: MUST SOON BE DONE WITH struct inode * IN PROC TABLE.
*/
/*
* Indirect driver for controlling tty.
*
* THIS IS GARBAGE: MUST SOON BE DONE WITH struct inode * IN PROC TABLE.
*/
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-#include "../h/proc.h"
-#include "../h/uio.h"
+#include "param.h"
+#include "systm.h"
+#include "conf.h"
+#include "dir.h"
+#include "user.h"
+#include "ioctl.h"
+#include "tty.h"
+#include "proc.h"
+#include "uio.h"
/*ARGSUSED*/
syopen(dev, flag)
/*ARGSUSED*/
syopen(dev, flag)
+ dev_t dev;
+ int flag;
{
{
- if (u.u_ttyp == NULL) {
- u.u_error = ENXIO;
- return;
- }
- (*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag);
+ if (u.u_ttyp == NULL)
+ return (ENXIO);
+ return ((*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag));
}
/*ARGSUSED*/
}
/*ARGSUSED*/
@@
-31,11
+38,9
@@
syread(dev, uio)
struct uio *uio;
{
struct uio *uio;
{
- if (u.u_ttyp == NULL) {
- u.u_error = ENXIO;
- return;
- }
- (*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd, uio);
+ if (u.u_ttyp == NULL)
+ return (ENXIO);
+ return ((*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd, uio));
}
/*ARGSUSED*/
}
/*ARGSUSED*/
@@
-44,11
+49,9
@@
sywrite(dev, uio)
struct uio *uio;
{
struct uio *uio;
{
- if (u.u_ttyp == NULL) {
- u.u_error = ENXIO;
- return;
- }
- (*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd, uio);
+ if (u.u_ttyp == NULL)
+ return (ENXIO);
+ return ((*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd, uio));
}
/*ARGSUSED*/
}
/*ARGSUSED*/
@@
-62,17
+65,24
@@
syioctl(dev, cmd, addr, flag)
if (cmd == TIOCNOTTY) {
u.u_ttyp = 0;
u.u_ttyd = 0;
if (cmd == TIOCNOTTY) {
u.u_ttyp = 0;
u.u_ttyd = 0;
- u.u_procp->p_pgrp = 0;
- return;
- }
- if (u.u_ttyp == NULL) {
- u.u_error = ENXIO;
- return;
+ if (SESS_LEADER(u.u_procp)) {
+ /*
+ * XXX - check posix draft
+ */
+ u.u_ttyp->t_session = 0;
+ u.u_ttyp->t_pgid = 0;
+ }
+ return (0);
}
}
- (*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag);
+ if (u.u_ttyp == NULL)
+ return (ENXIO);
+ return ((*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag));
}
}
+/*ARGSUSED*/
syselect(dev, flag)
syselect(dev, flag)
+ dev_t dev;
+ int flag;
{
if (u.u_ttyp == NULL) {
{
if (u.u_ttyp == NULL) {