Print this page
14249 pseudo-terminal nomenclature should reflect POSIX
Change-Id: Ib4a3cef899ff4c71b09cb0dc6878863c5e8357bc
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3utempter/utempter_add_record.3utempter
+++ new/usr/src/man/man3utempter/utempter_add_record.3utempter
1 1 .\" Copyright (c) 2009 Ed Schouten <ed@FreeBSD.org>
2 2 .\" All rights reserved.
3 3 .\"
4 4 .\" Redistribution and use in source and binary forms, with or without
5 5 .\" modification, are permitted provided that the following conditions
6 6 .\" are met:
7 7 .\" 1. Redistributions of source code must retain the above copyright
8 8 .\" notice, this list of conditions and the following disclaimer.
9 9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 10 .\" notice, this list of conditions and the following disclaimer in the
11 11 .\" documentation and/or other materials provided with the distribution.
12 12 .\"
13 13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 23 .\" SUCH DAMAGE.
24 24 .\"
25 25 .\"
26 -.Dd May 5, 2020
26 +.Dd February 5, 2022
27 27 .Dt UTEMPTER_ADD_RECORD 3UTEMPTER
28 28 .Os
29 29 .Sh NAME
30 30 .Nm utempter_add_record ,
31 31 .Nm utempter_remove_added_record ,
32 32 .Nm utempter_remove_record ,
33 33 .Nm addToUtmp ,
34 34 .Nm removeFromUtmp ,
35 35 .Nm removeLineFromUtmp
36 36 .Nd utempter compatibility interface
37 37 .Sh LIBRARY
38 38 .Lb libutempter
39 39 .Sh SYNOPSIS
40 40 .In utempter.h
41 41 .Ft int
42 42 .Fn utempter_add_record "int fd" "const char *host"
43 43 .Ft int
44 44 .Fn utempter_remove_added_record "void"
45 45 .Ft int
46 46 .Fn utempter_remove_record "int fd"
47 47 .Ft void
48 48 .Fn addToUtmp "const char *pty" "const char *host" "int fd"
49 49 .Ft void
50 50 .Fn removeFromUtmp "void"
51 51 .Ft void
52 52 .Fn removeLineFromUtmp "const char *pty" "int fd"
53 53 .Sh DESCRIPTION
54 54 These functions provide an interface for terminal emulators such as tmux,
55 55 screen, and xterm to record user sessions to
56 56 .Xr utmpx 4
57 57 database.
58 58 Note that they are best effort and may not succeed.
59 59 If consumers need to know for certain that they have successfully updated the
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
60 60 .Xr utmpx 4
61 61 database, these functions should not be used because they cannot communicate
62 62 that for compatibility reasons.
63 63 .Pp
64 64 The
65 65 .Fn utempter_add_record
66 66 and
67 67 .Fn addToUtmp
68 68 functions add a login record to the
69 69 .Xr utmpx 4
70 -database for the TTY belonging to the pseudo-terminal master file descriptor
70 +database for the TTY belonging to the pseudo-terminal manager file descriptor
71 71 .Fa fd ,
72 72 using the username corresponding with the real user ID of the calling
73 73 process and the optional hostname
74 74 .Fa host ,
75 75 limited to 256 characters, that is the size of
76 76 .Va ut_host
77 77 member of
78 78 .Vt struct utmpx
79 79 minus terminating NUL character.
80 80 .Pp
81 81 The
82 82 .Fn utempter_remove_record
83 83 and
84 84 .Fn removeLineFromUtmp
85 85 functions mark the login session as being closed for the TTY belonging
86 -to the pseudo-terminal master file descriptor
86 +to the pseudo-terminal manager file descriptor
87 87 .Fa fd .
88 88 .Pp
89 89 The
90 90 .Fn utempter_remove_added_record
91 91 and
92 92 .Fn removeFromUtmp
93 93 functions have the same properties as the previously mentioned
94 94 functions, except that they use an internally cached value of the file
95 95 descriptor passed to
96 96 .Fn utempter_add_record
97 97 and
98 98 .Fn addToUtmp .
99 99 .Pp
100 100 In this implementation, the
101 101 .Fa pty
102 102 arguments of
103 103 .Fn addToUtmp
104 104 and
105 105 .Fn removeLineFromUtmp
106 106 are ignored, and database entries are driven entirely by the
107 107 .Fa fd
108 108 argument.
109 109 .Sh RETURN VALUES
110 110 The
111 111 .Fn utempter_add_record ,
112 112 .Fn utempter_remove_added_record
113 113 and
114 114 .Fn utempter_remove_record
115 115 functions always return a value of 0.
116 116 .Sh INTERFACE STABILITY
117 117 .Fn utempter_add_record ,
118 118 .Fn utempter_remove_added_record ,
119 119 and
120 120 .Fn utempter_remove_record
121 121 are
122 122 .Sy Committed .
123 123 .Fn addToUtmp ,
124 124 .Fn removeFromUtmp ,
125 125 and
126 126 .Fn removeLineFromUtmp
127 127 are
128 128 .Sy Obsolete Committed .
129 129 .Sh MT-LEVEL
130 130 .Sy Unsafe
131 131 .Sh SEE ALSO
132 132 .Xr pututxline 3c ,
133 133 .Xr utmpx 3head ,
134 134 .Xr utmpx 4
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX