]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/ttyslot.3
man3/t-v.3: srcfix: Use a single-font-style macro for a single argument
[thirdparty/man-pages.git] / man3 / ttyslot.3
index e4e8dd6a3c7ac4890a40f581519b4787543ed7c7..76938f9a741d6e9b707f2eef827f9796664cc620 100644 (file)
 .\" This replaces an earlier man page written by Walter Harms
 .\" <walter.harms@informatik.uni-oldenburg.de>.
 .\"
-.TH TTYSLOT 3 2016-03-15 "GNU" "Linux Programmer's Manual"
+.TH TTYSLOT 3 2017-09-15 "GNU" "Linux Programmer's Manual"
 .SH NAME
 ttyslot \- find the slot of the current user's terminal in some file
 .SH SYNOPSIS
 .BR "#include <unistd.h>" "       /See NOTES */"
-.sp
+.PP
 .B "int ttyslot(void);"
-.sp
+.PP
 .in -4n
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
 .in
-.sp
+.PP
 .ad l
 .BR ttyslot ():
 .RS 4
-Since glibc 2.20:
-    _BSD_SOURCE ||
-    _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_\ <\ 500
+Since glibc 2.24:
+    _DEFAULT_SOURCE
 .br
-Glibc 2.19 and earlier:
+From glibc 2.20 to 2.23:
     _DEFAULT_SOURCE ||
-    _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_\ <\ 500
+    _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE\ <\ 500
+.br
+Glibc 2.19 and earlier:
+    _BSD_SOURCE ||
+    _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE\ <\ 500
 .RE
 .ad b
 .SH DESCRIPTION
 The legacy function
 .BR ttyslot ()
 returns the index of the current user's entry in some file.
-.LP
+.PP
 Now "What file?" you ask.
 Well, let's first look at some history.
 .SS Ancient history
@@ -74,7 +77,7 @@ indicating the sequence of line speeds to try (\(aq\-\(aq was: start trying
 Thus a typical line was "18\-".
 A hang on some line was solved by changing the \(aq1\(aq to a \(aq0\(aq,
 signaling init, changing back again, and signaling init again.
-.LP
+.PP
 In UNIX\ V7 the format was changed: here the second character
 was the argument to
 .BR getty (8)
@@ -82,7 +85,7 @@ indicating the sequence of line speeds to try (\(aq0\(aq was: cycle through
 300-1200-150-110 baud; \(aq4\(aq was for the on-line console DECwriter)
 while the rest of the line contained the name of the tty.
 Thus a typical line was "14console".
-.LP
+.PP
 Later systems have more elaborate syntax.
 System V-like systems have
 .I /etc/inittab
@@ -142,7 +145,7 @@ The utmp file is found in various places on various systems, such as
 .IR /etc/utmp ,
 .IR /var/adm/utmp ,
 .IR /var/run/utmp .
-.LP
+.PP
 The glibc2 implementation of this function reads the file
 .BR _PATH_TTYS ,
 defined in
@@ -156,20 +159,20 @@ On BSD-like systems and Linux, the declaration of
 .BR ttyslot ()
 is provided by
 .IR <unistd.h> .
-On Systsem V-like systems, the declaration is provided by
+On System V-like systems, the declaration is provided by
 .IR <stdlib.h> .
 Since glibc 2.24,
-.IR <stdlib.h>
+.I <stdlib.h>
 also provides the declaration with the following
 feature test macro definitions:
 .PP
-.nf
 .in +4n
+.EX
 (_XOPEN_SOURCE >= 500 ||
         (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED))
     && ! (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
+.EE
 .in
-.fi
 .PP
 Minix also has
 .IR fttyslot ( fd ).