summaryrefslogtreecommitdiff
path: root/term/ptyio.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-12-12 21:04:33 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-12-12 21:04:33 +0000
commitb2590213ad1b934d667d67a80d4a4ff7c865a088 (patch)
tree1c040678e047ed473f20d097e8c5aef74e2bf870 /term/ptyio.c
parent91aa86d5aa6b652c4e977d6e1fa540394abfa36b (diff)
(pty_open_hook): New function.
Diffstat (limited to 'term/ptyio.c')
-rw-r--r--term/ptyio.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/term/ptyio.c b/term/ptyio.c
index fbb1c729..0d2455e3 100644
--- a/term/ptyio.c
+++ b/term/ptyio.c
@@ -49,6 +49,9 @@ static char control_byte = 0;
static int output_stopped;
static int pktnostop;
+
+static int ptyopen;
+
static void
@@ -58,6 +61,23 @@ ptyio_init ()
condition_implies (&pty_read_wakeup, &pty_select_wakeup);
}
+error_t
+pty_open_hook (struct trivfs_control *cntl,
+ uid_t *uids, u_int nuids,
+ uid_t *gids, u_int ngids,
+ int flags)
+{
+ if ((flags & (O_READ|O_WRITE)) == 0)
+ return 0;
+
+ if (ptyopen)
+ return EBUSY;
+
+ pty_open = 1;
+ report_carrier_on ();
+ return 0;
+}
+
static inline void
wake_reader ()