This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH]man-pages-1.48 update for getutent
- From: "Amit D. Chaudhary" <amitc at brocade dot com>
- To: Andries Brouwer <aeb at cwi dot nl>
- Cc: libc-alpha <libc-alpha at sources dot redhat dot com>
- Date: Thu, 15 Aug 2002 13:48:03 -0700
- Subject: [PATCH]man-pages-1.48 update for getutent
Andries,
Please find attached a PATCH which adds a NOTE section to the
main3/getutent.3 manpage.
This bit us in the past and might be useful for others. I have a small
sample code, incase someone is interested.
For the glibc hackers, this happens due to static variables in
sysdeps/generic/utmp_file.c.
Thanks and Regards
Amit
diff -ur man-pages-1.48/man3/getutent.3 man-pages-1.48-getutent/man3/getutent.3
--- man-pages-1.48/man3/getutent.3 Mon Dec 17 05:33:43 2001
+++ man-pages-1.48-getutent/man3/getutent.3 Wed Aug 14 16:09:44 2002
@@ -83,6 +83,11 @@
\fBgetutent\fP(), \fBgetutid\fP(), \fBgetutline\fP() and \fBpututline\fP()
return a pointer to a \fBstatic struct utmp\fP on success, and NULL
on failure.
+.SH NOTE
+The above functions getutent, setutent and others are not thread-safe and
+the results can be unreliable if calls are mixed between multiple threads.
+.PP
+.nf
.SH EXAMPLE
The following example adds and removes a utmp record, assuming it is run
from within a pseudo terminal. For usage in a real application, you
Only in man-pages-1.48-getutent/man3: getutent.3.orig
Only in man-pages-1.48-getutent/man3: getutent.3~