From 342414a6e0952c308c0cf27daab6ea24fc4cc172 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 27 Mar 1995 10:24:00 +0000 Subject: [PATCH] * sysdeps/unix/bsd/bsd4.4/revoke.S: New file. * sysdeps/stub/revoke.c: New file. * misc/Makefile (routines): Add revoke. * posix/unistd.h [__USE_BSD] (revoke): Declare it. * sysdeps/generic/pty.c (openpty, forkpty): Declare return types. (forkpty): Declare login_tty. * misc/logwtmp.c (logwtmp): Declare to return void. * misc/login_tty.c (login_tty): Include unistd.h. Declare return type. --- ChangeLog | 9 +++++++++ NEWS | 7 ++++++- misc/Makefile | 4 ++-- misc/logwtmp.c | 1 + posix/unistd.h | 3 +++ sysdeps/generic/pty.c | 3 +++ sysdeps/stub/revoke.c | 30 ++++++++++++++++++++++++++++++ sysdeps/unix/bsd/bsd4.4/revoke.S | 23 +++++++++++++++++++++++ 8 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 sysdeps/stub/revoke.c create mode 100644 sysdeps/unix/bsd/bsd4.4/revoke.S diff --git a/ChangeLog b/ChangeLog index 6006bcb..10e8ad1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ Mon Mar 27 02:23:15 1995 Roland McGrath + * sysdeps/unix/bsd/bsd4.4/revoke.S: New file. + * sysdeps/stub/revoke.c: New file. + * misc/Makefile (routines): Add revoke. + * posix/unistd.h [__USE_BSD] (revoke): Declare it. + * sysdeps/generic/pty.c (openpty, forkpty): Declare return types. + (forkpty): Declare login_tty. + * misc/logwtmp.c (logwtmp): Declare to return void. + * misc/login_tty.c (login_tty): Include unistd.h. Declare return type. + * posix/unistd.h [__USE_BSD] (ttyslot): Declare it. * posix/unistd.h [__USE_BSD] (L_SET, L_INCR, L_XTND): Define diff --git a/NEWS b/NEWS index 49cfc03..be5eb46 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -GNU C Library NEWS -- history of user-visible changes. 21 March 1995 +GNU C Library NEWS -- history of user-visible changes. 27 March 1995 Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. See the end for copying conditions. @@ -98,6 +98,11 @@ Version 1.10 * The new functions `ecvt', `fcvt', and `gcvt' provide an obsolete interface for formatting floating-point numbers. They are provided only for compatibility; new programs should use `sprintf' instead. + +* The new auxiliary library `-lutil' from 4.4 BSD contains various + functions for maintaining the login-record files (primarily of use to + system programs such as `login'), and convenient functions for + allocating and initializing a pseudo-terminal (pty) device. Version 1.09 diff --git a/misc/Makefile b/misc/Makefile index 3c87abf..53489c6 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -37,8 +37,8 @@ routines := brk sbrk sstk ioctl \ select \ acct chroot fsync sync reboot \ gethostid sethostid \ - mknod \ - swapon vhangup mktemp mkstemp \ + revoke vhangup mknod \ + swapon mktemp mkstemp \ ualarm usleep \ gtty stty \ ptrace \ diff --git a/misc/logwtmp.c b/misc/logwtmp.c index d55ac9e..5b3c8de 100644 --- a/misc/logwtmp.c +++ b/misc/logwtmp.c @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93"; #include #include +void logwtmp(line, name, host) char *line, *name, *host; { diff --git a/posix/unistd.h b/posix/unistd.h index 4468541..db95288 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -559,6 +559,9 @@ extern int sync __P ((void)); group of the control terminal. */ extern int vhangup __P ((void)); +/* Revoke the access of all descriptors currently open on FILE. */ +extern int revoke __P ((const char *__file)); + /* Turn accounting on if NAME is an existing file. The system will then write a record for each process as it terminates, to this file. If NAME is NULL, diff --git a/sysdeps/generic/pty.c b/sysdeps/generic/pty.c index 1644aee..a539a9b 100644 --- a/sysdeps/generic/pty.c +++ b/sysdeps/generic/pty.c @@ -47,6 +47,7 @@ static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; #include #include +int openpty(amaster, aslave, name, termp, winp) int *amaster, *aslave; char *name; @@ -97,12 +98,14 @@ openpty(amaster, aslave, name, termp, winp) return (-1); } +int forkpty(amaster, name, termp, winp) int *amaster; char *name; struct termios *termp; struct winsize *winp; { + extern int login_tty(); int master, slave, pid; if (openpty(&master, &slave, name, termp, winp) == -1) diff --git a/sysdeps/stub/revoke.c b/sysdeps/stub/revoke.c new file mode 100644 index 0000000..295dc2b --- /dev/null +++ b/sysdeps/stub/revoke.c @@ -0,0 +1,30 @@ +/* Revoke the access of all descriptors currently open on a file. +Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include +#include + +int +revoke (file) + const char *file; +{ + errno = ENOSYS; + return -1; +} +stub_warning (revoke) diff --git a/sysdeps/unix/bsd/bsd4.4/revoke.S b/sysdeps/unix/bsd/bsd4.4/revoke.S new file mode 100644 index 0000000..ee0cb4d --- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/revoke.S @@ -0,0 +1,23 @@ +/* Revoke the access of all descriptors currently open on a file. +Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include + +SYSCALL (revoke, 1) + ret -- 2.7.4