From b2590213ad1b934d667d67a80d4a4ff7c865a088 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 12 Dec 1995 21:04:33 +0000 Subject: (pty_open_hook): New function. --- term/ptyio.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'term') 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 () -- cgit v1.2.3