aboutsummaryrefslogtreecommitdiff
path: root/manual/job.texi
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2014-11-21 02:06:22 -0200
committerAlexandre Oliva <aoliva@redhat.com>2014-11-21 02:16:02 -0200
commit7729e0e91afbf8d45bb322d7e2d53f417fab01ed (patch)
treeb081908ff729dc647b179cb425fbe721e857cbe8 /manual/job.texi
parenta4ea5e2809a20521e4300725d5062768883ffc50 (diff)
downloadglibc-7729e0e91afbf8d45bb322d7e2d53f417fab01ed.zip
glibc-7729e0e91afbf8d45bb322d7e2d53f417fab01ed.tar.gz
glibc-7729e0e91afbf8d45bb322d7e2d53f417fab01ed.tar.bz2
ctermid: return string literal, document MT-Safety pitfall
for ChangeLog * sysdeps/posix/ctermid.c (ctermid): Return a pointer to a string literal if not passed a buffer. * manual/job.texi (ctermid): Update reasoning, note deviation from posix, suggest mtasurace when not passed a buffer, for future non-preliminary safety notes.
Diffstat (limited to 'manual/job.texi')
-rw-r--r--manual/job.texi8
1 files changed, 5 insertions, 3 deletions
diff --git a/manual/job.texi b/manual/job.texi
index 4f9bd81..095c26d 100644
--- a/manual/job.texi
+++ b/manual/job.texi
@@ -1039,10 +1039,12 @@ The function @code{ctermid} is declared in the header file
@comment stdio.h
@comment POSIX.1
@deftypefun {char *} ctermid (char *@var{string})
-@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+@safety{@prelim{}@mtsafe{@mtsposix{/!string}}@assafe{}@acsafe{}}
@c This function is a stub by default; the actual implementation, for
-@c posix systems, returns an internal buffer if passed a NULL string,
-@c but the internal buffer is always set to /dev/tty.
+@c posix systems, returns a pointer to a string literal if passed a NULL
+@c string. It's not clear we want to commit to being MT-Safe in the
+@c !string case, so maybe add mtasurace{:ctermid/!string} when we take
+@c prelim out, to make room for using a static buffer in the future.
The @code{ctermid} function returns a string containing the file name of
the controlling terminal for the current process. If @var{string} is
not a null pointer, it should be an array that can hold at least