mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 09:02:44 +00:00
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.
This commit is contained in:
parent
646420c8dc
commit
88b69f52ee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=202274
@ -14,6 +14,8 @@
|
|||||||
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
|
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# 20100114: removal of ttyslot(3)
|
||||||
|
OLD_FILES+=usr/share/man/man3/ttyslot.3.gz
|
||||||
# 20100113: remove utmp.h, replace it by utmpx.h
|
# 20100113: remove utmp.h, replace it by utmpx.h
|
||||||
OLD_FILES+=usr/share/man/man3/login.3.gz
|
OLD_FILES+=usr/share/man/man3/login.3.gz
|
||||||
OLD_FILES+=usr/share/man/man3/logout.3.gz
|
OLD_FILES+=usr/share/man/man3/logout.3.gz
|
||||||
|
@ -574,7 +574,6 @@ int swapon(const char *);
|
|||||||
int swapoff(const char *);
|
int swapoff(const char *);
|
||||||
int syscall(int, ...);
|
int syscall(int, ...);
|
||||||
off_t __syscall(quad_t, ...);
|
off_t __syscall(quad_t, ...);
|
||||||
int ttyslot(void);
|
|
||||||
int undelete(const char *);
|
int undelete(const char *);
|
||||||
int unwhiteout(const char *);
|
int unwhiteout(const char *);
|
||||||
void *valloc(size_t); /* obsoleted by malloc() */
|
void *valloc(size_t); /* obsoleted by malloc() */
|
||||||
|
@ -272,7 +272,6 @@ FBSD_1.0 {
|
|||||||
openlog;
|
openlog;
|
||||||
closelog;
|
closelog;
|
||||||
setlogmask;
|
setlogmask;
|
||||||
ttyslot;
|
|
||||||
ttyname_r;
|
ttyname_r;
|
||||||
ttyname;
|
ttyname;
|
||||||
timezone;
|
timezone;
|
||||||
|
@ -34,8 +34,7 @@
|
|||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm ttyname ,
|
.Nm ttyname ,
|
||||||
.Nm ttyname_r ,
|
.Nm ttyname_r ,
|
||||||
.Nm isatty ,
|
.Nm isatty
|
||||||
.Nm ttyslot
|
|
||||||
.Nd get name of associated terminal (tty) from file descriptor
|
.Nd get name of associated terminal (tty) from file descriptor
|
||||||
.Sh LIBRARY
|
.Sh LIBRARY
|
||||||
.Lb libc
|
.Lb libc
|
||||||
@ -47,8 +46,6 @@
|
|||||||
.Fn ttyname_r "int fd" "char *buf" "size_t len"
|
.Fn ttyname_r "int fd" "char *buf" "size_t len"
|
||||||
.Ft int
|
.Ft int
|
||||||
.Fn isatty "int fd"
|
.Fn isatty "int fd"
|
||||||
.Ft int
|
|
||||||
.Fn ttyslot void
|
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
These functions operate on the system file descriptors for terminal
|
These functions operate on the system file descriptors for terminal
|
||||||
type devices.
|
type devices.
|
||||||
@ -89,13 +86,6 @@ The
|
|||||||
.Fn ttyname_r
|
.Fn ttyname_r
|
||||||
function
|
function
|
||||||
takes a buffer and length as arguments to avoid this problem.
|
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
|
.Sh RETURN VALUES
|
||||||
The
|
The
|
||||||
.Fn ttyname
|
.Fn ttyname
|
||||||
@ -110,12 +100,6 @@ The
|
|||||||
.Fn ttyname_r
|
.Fn ttyname_r
|
||||||
function returns 0 if successful.
|
function returns 0 if successful.
|
||||||
Otherwise an error number is returned.
|
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
|
.Sh FILES
|
||||||
.Bl -tag -width ".Pa /etc/ttys" -compact
|
.Bl -tag -width ".Pa /etc/ttys" -compact
|
||||||
.It Pa /dev/\(**
|
.It Pa /dev/\(**
|
||||||
@ -142,10 +126,9 @@ is smaller than the length of the string to be returned.
|
|||||||
.Xr ttys 5
|
.Xr ttys 5
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
The
|
The
|
||||||
.Fn isatty ,
|
.Fn isatty
|
||||||
.Fn ttyname ,
|
|
||||||
and
|
and
|
||||||
.Fn ttyslot
|
.Fn ttyname
|
||||||
functions
|
functions
|
||||||
appeared in
|
appeared in
|
||||||
.At v7 .
|
.At v7 .
|
||||||
|
@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
ttyslot()
|
__ttyslot(void)
|
||||||
{
|
{
|
||||||
struct ttyent *ttyp;
|
struct ttyent *ttyp;
|
||||||
int slot;
|
int slot;
|
||||||
@ -63,3 +63,5 @@ ttyslot()
|
|||||||
endttyent();
|
endttyent();
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__sym_compat(ttyslot, __ttyslot, FBSD_1.0);
|
||||||
|
@ -158,7 +158,6 @@ ttyp1 none network off group=pty
|
|||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr login 1 ,
|
.Xr login 1 ,
|
||||||
.Xr getttyent 3 ,
|
.Xr getttyent 3 ,
|
||||||
.Xr ttyslot 3 ,
|
|
||||||
.Xr gettytab 5 ,
|
.Xr gettytab 5 ,
|
||||||
.Xr login.conf 5 ,
|
.Xr login.conf 5 ,
|
||||||
.Xr termcap 5 ,
|
.Xr termcap 5 ,
|
||||||
|
Loading…
Reference in New Issue
Block a user