summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-01-14 05:35:32 +0000
committered <ed@FreeBSD.org>2010-01-14 05:35:32 +0000
commitc47f4ccef36eabbc9ea7c65e2a8e9b2e9814d08a (patch)
treecca50b6992f3e458c9b643cfea07b527623e9879 /lib
parent47afb8a1a7c815fd4e3f38832563ee8e7bae7e89 (diff)
downloadFreeBSD-src-c47f4ccef36eabbc9ea7c65e2a8e9b2e9814d08a.zip
FreeBSD-src-c47f4ccef36eabbc9ea7c65e2a8e9b2e9814d08a.tar.gz
Phase out ttyslot(3).
The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/Symbol.map1
-rw-r--r--lib/libc/gen/ttyname.323
-rw-r--r--lib/libc/gen/ttyslot.c4
3 files changed, 6 insertions, 22 deletions
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 534c81a..42404bc 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -272,7 +272,6 @@ FBSD_1.0 {
openlog;
closelog;
setlogmask;
- ttyslot;
ttyname_r;
ttyname;
timezone;
diff --git a/lib/libc/gen/ttyname.3 b/lib/libc/gen/ttyname.3
index c7b8cbc..e583833 100644
--- a/lib/libc/gen/ttyname.3
+++ b/lib/libc/gen/ttyname.3
@@ -34,8 +34,7 @@
.Sh NAME
.Nm ttyname ,
.Nm ttyname_r ,
-.Nm isatty ,
-.Nm ttyslot
+.Nm isatty
.Nd get name of associated terminal (tty) from file descriptor
.Sh LIBRARY
.Lb libc
@@ -47,8 +46,6 @@
.Fn ttyname_r "int fd" "char *buf" "size_t len"
.Ft int
.Fn isatty "int fd"
-.Ft int
-.Fn ttyslot void
.Sh DESCRIPTION
These functions operate on the system file descriptors for terminal
type devices.
@@ -89,13 +86,6 @@ The
.Fn ttyname_r
function
takes a buffer and length as arguments to avoid this problem.
-.Pp
-The
-.Fn ttyslot
-function
-fetches the current process' control terminal number from the
-.Xr ttys 5
-file entry.
.Sh RETURN VALUES
The
.Fn ttyname
@@ -110,12 +100,6 @@ The
.Fn ttyname_r
function returns 0 if successful.
Otherwise an error number is returned.
-.Pp
-The
-.Fn ttyslot
-function
-returns the unit number of the device file if found; otherwise
-the value zero is returned.
.Sh FILES
.Bl -tag -width ".Pa /etc/ttys" -compact
.It Pa /dev/\(**
@@ -142,10 +126,9 @@ is smaller than the length of the string to be returned.
.Xr ttys 5
.Sh HISTORY
The
-.Fn isatty ,
-.Fn ttyname ,
+.Fn isatty
and
-.Fn ttyslot
+.Fn ttyname
functions
appeared in
.At v7 .
diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c
index 31cc156..b2fac7c 100644
--- a/lib/libc/gen/ttyslot.c
+++ b/lib/libc/gen/ttyslot.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
-ttyslot()
+__ttyslot(void)
{
struct ttyent *ttyp;
int slot;
@@ -63,3 +63,5 @@ ttyslot()
endttyent();
return(0);
}
+
+__sym_compat(ttyslot, __ttyslot, FBSD_1.0);
OpenPOWER on IntegriCloud