1ttyslot(3C)              Standard C Library Functions              ttyslot(3C)
2
3
4

NAME

6       ttyslot  -  find  the  slot of the current user  in the user accounting
7       database
8

SYNOPSIS

10       #include <stdlib.h>
11
12       int ttyslot(void);
13
14

DESCRIPTION

16       The ttyslot() function returns the index of the current user's entry in
17       the  user accounting database, /var/adm/utmpx. The current user's entry
18       is an entry for which the utline member matches the name of a  terminal
19       device associated with any of the process's file descriptors 0, 1 or 2.
20       The index is an ordinal number representing the record  number  in  the
21       database  of the current user's entry.  The first entry in the database
22       is represented by the return value 0.
23

RETURN VALUES

25       Upon successful completion, ttyslot() returns the index of the  current
26       user's  entry  in the user accounting database. If an error was encoun‐
27       tered while searching for the terminal name or if  none  of  the  above
28       file descriptors are associated with a terminal device, −1 is returned.
29

FILES

31       /var/adm/utmpx    user access and accounting information
32
33

ATTRIBUTES

35       See attributes(5) for descriptions of the following attributes:
36
37
38
39
40       ┌─────────────────────────────┬─────────────────────────────┐
41       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
42       ├─────────────────────────────┼─────────────────────────────┤
43       │MT-Level                     │Safe                         │
44       └─────────────────────────────┴─────────────────────────────┘
45

SEE ALSO

47       getutent(3C), ttyname(3C), utmpx(4), attributes(5)
48
49
50
51SunOS 5.11                        27 Oct 1998                      ttyslot(3C)
Impressum