summaryrefslogtreecommitdiffstats
path: root/man3/getutent.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/getutent.3')
-rw-r--r--man3/getutent.336
1 files changed, 24 insertions, 12 deletions
diff --git a/man3/getutent.3 b/man3/getutent.3
index bd0369db4..d2aefcfb0 100644
--- a/man3/getutent.3
+++ b/man3/getutent.3
@@ -10,7 +10,7 @@
.\" Modified Thu Jul 25 14:43:46 MET DST 1996 by Michael Haardt
.\" <michael@cantor.informatik.rwth-aachen.de>
.\"
-.TH getutent 3 2023-02-05 "Linux man-pages 6.03"
+.TH getutent 3 2023-07-20 "Linux man-pages 6.05.01"
.SH NAME
getutent, getutid, getutline, pututline, setutent, endutent,
utmpname \- access utmp file entries
@@ -145,40 +145,50 @@ database of past user logins
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
-.ad l
-.nh
.TS
allbox;
lb lb lbx
l l l.
Interface Attribute Value
T{
+.na
+.nh
.BR getutent ()
T} Thread safety T{
+.na
+.nh
MT-Unsafe init race:utent
race:utentbuf sig:ALRM timer
T}
T{
+.na
+.nh
.BR getutid (),
.BR getutline ()
T} Thread safety T{
+.na
+.nh
MT-Unsafe init race:utent
sig:ALRM timer
T}
T{
+.na
+.nh
.BR pututline ()
T} Thread safety T{
+.na
+.nh
MT-Unsafe race:utent
sig:ALRM timer
T}
T{
+.na
+.nh
.BR setutent (),
.BR endutent (),
.BR utmpname ()
T} Thread safety MT-Unsafe race:utent
.TE
-.hy
-.ad
.sp 1
In the above table,
.I utent
@@ -196,6 +206,8 @@ or
are used in parallel in different threads of a program,
then data races could occur.
.SH STANDARDS
+None.
+.SH HISTORY
XPG2, SVr4.
.PP
In XPG2 and SVID 2 the function
@@ -302,14 +314,14 @@ and
#include <time.h>
#include <unistd.h>
#include <utmp.h>
-
+\&
int
main(void)
{
struct utmp entry;
-
+\&
system("echo before adding entry:;who");
-
+\&
entry.ut_type = USER_PROCESS;
entry.ut_pid = getpid();
strcpy(entry.ut_line, ttyname(STDIN_FILENO) + strlen("/dev/"));
@@ -321,18 +333,18 @@ main(void)
entry.ut_addr = 0;
setutent();
pututline(&entry);
-
+\&
system("echo after adding entry:;who");
-
+\&
entry.ut_type = DEAD_PROCESS;
memset(entry.ut_line, 0, UT_LINESIZE);
entry.ut_time = 0;
memset(entry.ut_user, 0, UT_NAMESIZE);
setutent();
pututline(&entry);
-
+\&
system("echo after removing entry:;who");
-
+\&
endutent();
exit(EXIT_SUCCESS);
}