<?xml version="1.0" encoding="utf-8"?>
<!--  RSS generated by Flaimo.com RSS Builder [2013-06-20 07:55:47]  --> <rss version="2.0" xmlns:im="http://purl.org/rss/1.0/item-images/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" >
<channel>
<docs>http://austingroupbugs.net/</docs>
<description>Austin Group Defect Tracker - ISSUES</description>
<link>http://austingroupbugs.net/</link>
<title>Austin Group Defect Tracker - ISSUES</title>
<image>
<title>Austin Group Defect Tracker - ISSUES</title>
<url>http://austingroupbugs.net/images/mantis_logo_button.gif</url>
<link>http://austingroupbugs.net/</link>
<description>Austin Group Defect Tracker - ISSUES</description>
</image>
<category>All Projects</category>
<ttl>10</ttl>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2013-06-20T07:55:45+00:00</sy:updateBase>
<item>
<title>0000712: typographic error: .I in short description</title>
<link>http://austingroupbugs.net/view.php?id=712</link>
<description>the short description in gets.html reads&lt;br /&gt;
&lt;br /&gt;
 gets - get a string from a .I stdin stream&lt;br /&gt;
&lt;br /&gt;
the .I seems to be from a failed *roff to html conversion&lt;br /&gt;
&lt;br /&gt;
the issue occures at least in&lt;br /&gt;
&lt;br /&gt;
functions/gets.html&lt;br /&gt;
functions/getline.html&lt;br /&gt;
functions/getdelim.html&lt;br /&gt;
functions/getchar.html&lt;br /&gt;
functions/getwchar.html&lt;br /&gt;
idx/ig.html</description>
<guid>http://austingroupbugs.net/view.php?id=712</guid>
<author>nsz &lt;nsz@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=712#bugnotes</comments>
</item>
<item>
<title>0000714: yn(n,0) is incorrect for odd n&lt;0</title>
<link>http://austingroupbugs.net/view.php?id=714</link>
<description>the return value description for y0, y1 and yn says:&lt;br /&gt;
&lt;br /&gt;
&quot;If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.&quot;&lt;br /&gt;
&lt;br /&gt;
&quot;If the correct result would cause overflow, -HUGE_VAL or 0.0 shall&lt;br /&gt;
be returned and a range error may occur.&quot;&lt;br /&gt;
&lt;br /&gt;
this is fine for y0 and y1 but it is inconsistent with the&lt;br /&gt;
mathematical definition of yn when n is negative and odd&lt;br /&gt;
&lt;br /&gt;
the sign is flipped according to yn(-n,x) = (-1)^n yn(n,x)&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 lim   yn(n,x) = +Inf, for all n&lt;0 and n%2==1&lt;br /&gt;
 x-&gt;+0&lt;br /&gt;
&lt;br /&gt;
it seems historical implementations got this wrong at x==0&lt;br /&gt;
eg. the original v7 implementation of yn starts with&lt;br /&gt;
&lt;br /&gt;
        if (x &lt;= 0) {&lt;br /&gt;
                errno = EDOM;&lt;br /&gt;
                return(-HUGE);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
but if x&gt;0 and x is close to 0 then yn(-odd,x) overflows&lt;br /&gt;
and the mathematically reasonable +Inf is returned which&lt;br /&gt;
is inconsistent with the description in posix&lt;br /&gt;
(i assume most historical implementations work this way)</description>
<guid>http://austingroupbugs.net/view.php?id=714</guid>
<author>nsz &lt;nsz@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=714#bugnotes</comments>
</item>
<item>
<title>0000713: in remquo quo should be unspecified when the result is NaN</title>
<link>http://austingroupbugs.net/view.php?id=713</link>
<description>the description of quo in remquo(x,y,quo) is&lt;br /&gt;
&lt;br /&gt;
&quot;In the object pointed to by quo, they store a value whose sign&lt;br /&gt;
is the sign of x/y and whose magnitude is congruent modulo 2^n&lt;br /&gt;
to the magnitude of the integral quotient of x/y, where n is an&lt;br /&gt;
implementation-defined integer greater than or equal to 3. If y&lt;br /&gt;
is zero, the value stored in the object pointed to by quo is&lt;br /&gt;
unspecified.&quot;&lt;br /&gt;
&lt;br /&gt;
quo does not seem to be correctly specified when x/y&lt;br /&gt;
is +-Inf or NaN, only the y==0 special case is handled&lt;br /&gt;
&lt;br /&gt;
this may affect ISO C as well</description>
<guid>http://austingroupbugs.net/view.php?id=713</guid>
<author>nsz &lt;nsz@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=713#bugnotes</comments>
</item>
<item>
<title>0000515: Typos on make's page</title>
<link>http://austingroupbugs.net/view.php?id=515</link>
<description>I found a couple of typos on make's page (section: Extended Description, subsection: Include Lines) but I don't really know whether they only apply to the online version or not.</description>
<guid>http://austingroupbugs.net/view.php?id=515</guid>
<author>Love4Boobies &lt;Love4Boobies@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=515#bugnotes</comments>
</item>
<item>
<title>0000711: Are the stdarg.h macros async-signal-safe?</title>
<link>http://austingroupbugs.net/view.php?id=711</link>
<description>XSH 2.4.3 lists functions which are async-signal-safe and does not include va_* in its list; however, va_* are specified to be macros and functions are not required to exist. Thus, it seems unclear to me whether variadic functions may access their arguments from an async-signal context.</description>
<guid>http://austingroupbugs.net/view.php?id=711</guid>
<author>dalias &lt;dalias@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=711#bugnotes</comments>
</item>
<item>
<title>0000703: Add errno values for clock</title>
<link>http://austingroupbugs.net/view.php?id=703</link>
<description>The clock() function has failure cases specified (unavailable or unrepresentable processor time usage) but does not have error codes defined. As the resolution of #686 imposes a common real-world failure case on implementations using 32-bit clock_t, it seems desirable to have the cause of failure reported in errno.</description>
<guid>http://austingroupbugs.net/view.php?id=703</guid>
<author>dalias &lt;dalias@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=703#bugnotes</comments>
</item>
<item>
<title>0000705: Add hash, type and ulimit to regular built-in utilities</title>
<link>http://austingroupbugs.net/view.php?id=705</link>
<description>Like cd, getopts, read, umask and wait, the utilities hash, type and ulimit are most simply implemented within the shell. hash reports on or modifies a list within the shell environment. type may report on aliases and functions only known within the shell environment. ulimit may modify a process property which would not affect the shell if it were to be done in a child process.&lt;br /&gt;
&lt;br /&gt;
Note that the current standard requires that hash, type and ulimit be exec'able (the latter two only for XSI implementations).</description>
<guid>http://austingroupbugs.net/view.php?id=705</guid>
<author>jilles &lt;jilles@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=705#bugnotes</comments>
</item>
<item>
<title>0000706: require subshell environment to have its own copy of ulimit</title>
<link>http://austingroupbugs.net/view.php?id=706</link>
<description>Users/scripts may expect that a ulimit command in a subshell environment does not affect any parent shell environment, like a cd or umask command. In fact, this is the case even in ksh93 which explicitly forks when a non-fork subshell environment tries to change ulimit. If the subshell environment is implemented via fork() or if the parent environment cannot execute any more commands, changes to ulimit do not affect the parent either.&lt;br /&gt;
&lt;br /&gt;
Some historical non-compliant implementations execute command substitutions invoking a single built-in utility in the current shell environment. Apart from the fact that this is non-compliant for other reasons, a lone ulimit command with a new value in a command substitution is also unlikely to occur in practice because there is normally no code to run with the new limit and such a command generates no output.</description>
<guid>http://austingroupbugs.net/view.php?id=706</guid>
<author>jilles &lt;jilles@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=706#bugnotes</comments>
</item>
<item>
<title>0000707: unclear symbolic constants in tar.h</title>
<link>http://austingroupbugs.net/view.php?id=707</link>
<description>The General definitions table contains the following entries:&lt;br /&gt;
&lt;br /&gt;
TVERSION    &quot;00&quot;    00 without a null byte.&lt;br /&gt;
TVERSLEN      2     Length of the above.&lt;br /&gt;
&lt;br /&gt;
This is unclear, or at least hard to implement. String constants do include the null byte.&lt;br /&gt;
&lt;br /&gt;
It seems sizeof(TVERSION) != TVERSLEN on most systems, contrary to above text.</description>
<guid>http://austingroupbugs.net/view.php?id=707</guid>
<author>tedu &lt;tedu@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=707#bugnotes</comments>
</item>
<item>
<title>0000708: Make mblen, mbtowc, and wctomb thread-safe for alignment with C11</title>
<link>http://austingroupbugs.net/view.php?id=708</link>
<description>Per C11 7.1.4 paragraph 5,&lt;br /&gt;
&lt;br /&gt;
&quot;Unless explicitly stated otherwise in the detailed descriptions that follow, library functions shall prevent data races as follows: A library function shall not directly or indirectly access objects accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's arguments. A library function shall not directly or indirectly modify objects accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's non-const arguments. Implementations may share their own internal objects between threads if the objects are not visible to users and are protected against data races.&quot;&lt;br /&gt;
&lt;br /&gt;
7.22.7 (Multibyte/wide character conversion functions) does not specify that these functions are not required to avoid data races with other calls. The only time they would even potentially be subject to data races is for state-dependent encodings, which are all but obsolete; for single-byte or modern multi-byte (i.e. UTF-8) encodings, these functions are pure.&lt;br /&gt;
&lt;br /&gt;
Note that 7.29.6.3 (Restartable multibyte/wide character conversion functions) does make exceptions that the &quot;r&quot; versions of these functions are not required to avoid data races when the state argument is NULL.</description>
<guid>http://austingroupbugs.net/view.php?id=708</guid>
<author>dalias &lt;dalias@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=708#bugnotes</comments>
</item>
<item>
<title>0000709: specification of when a string is converted to integer doesn't match existing practice</title>
<link>http://austingroupbugs.net/view.php?id=709</link>
<description>The extended description of expr says:&lt;br /&gt;
        A string argument is an argument that cannot be identified&lt;br /&gt;
        as an integer argument or as one of the expression operator&lt;br /&gt;
        symbols shown in the OPERANDS section.&lt;br /&gt;
&lt;br /&gt;
According to that, the &quot;010&quot; in each of the following commands:&lt;br /&gt;
    expr 010&lt;br /&gt;
    expr \( 010 \)&lt;br /&gt;
    expr 010 : '\(.*\)'&lt;br /&gt;
    expr 0 '|' 010&lt;br /&gt;
&lt;br /&gt;
is _not_ a string argument because they _can_ be identified as an&lt;br /&gt;
integer argument, which means that the output of each of those&lt;br /&gt;
should be &quot;10&quot;, but that isn't done in Solaris, Linux, FreeBSD, or&lt;br /&gt;
OpenBSD.  They all consistently output &quot;010&quot; for those.&lt;br /&gt;
&lt;br /&gt;
I believe that existing implementations all only convert a string&lt;br /&gt;
to an integer only when it is used as an operand of a binary operator&lt;br /&gt;
other than ':'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Side note: the HTML formatting of the table is misleading/wrong, as&lt;br /&gt;
the rows separators are identical within and between precedence.</description>
<guid>http://austingroupbugs.net/view.php?id=709</guid>
<author>philip-guenther &lt;philip-guenther@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=709#bugnotes</comments>
</item>
<item>
<title>0000710: read() and write() pages use &quot;file pointer&quot;</title>
<link>http://austingroupbugs.net/view.php?id=710</link>
<description>The read() and write() pages sometimes use the term &quot;file offset&quot; and&lt;br /&gt;
sometimes (in connection with pread() and pwrite()) use &quot;file pointer&quot;.&lt;br /&gt;
The correct term is &quot;file offset&quot;.&lt;br /&gt;
&lt;br /&gt;
This was corrected in Issue 7 for pwrite() in the DESCRIPTION section &lt;br /&gt;
(but oddly not for pread()), but has crept in again in the EINVAL error.</description>
<guid>http://austingroupbugs.net/view.php?id=710</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=710#bugnotes</comments>
</item>
<item>
<title>0000704: Clarify interoperability of wordfree(3)</title>
<link>http://austingroupbugs.net/view.php?id=704</link>
<description>It seems the wording of wordexp(3) / wordfree(3) permits the interpretation that wordfree(3) is only valid after a _successful_ wordexp(3) call.&lt;br /&gt;
&lt;br /&gt;
(Apple Mac OS X Snow Leopard behaves that way if one globbers the wordexp_t backing memory before calling wordexp(3), whereas the checked sources of FreeBSD [since first commit 2002] and NetBSD [ditto, 2004] zero the backing memory unless WRDE_APPEND is set, as i'd expected.)</description>
<guid>http://austingroupbugs.net/view.php?id=704</guid>
<author>steffen &lt;steffen@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=704#bugnotes</comments>
</item>
<item>
<title>0000693: Clarification on export status of make variables</title>
<link>http://austingroupbugs.net/view.php?id=693</link>
<description>Whereas the standard defines exactly the significance of the sources of macros / variables (command line, MAKEFLAGS environment variable, environment content, in the Makefile), it does not talk about the resulting export status of the macro / variable that will be passed down the call chain.&lt;br /&gt;
This shell snippet can be used for a quick test:&lt;br /&gt;
&lt;br /&gt;
	#!/bin/sh -&lt;br /&gt;
	[ -z &quot;${MAKE}&quot; ] &amp;&amp; MAKE=make&lt;br /&gt;
	SHELLVAR=shell&lt;br /&gt;
	export SHELLVAR MAKE&lt;br /&gt;
	cat &gt; t1.make &lt;&lt; \!&lt;br /&gt;
	SHELLVAR = t1&lt;br /&gt;
	all:&lt;br /&gt;
		@$(MAKE) -f t2.make all&lt;br /&gt;
	!&lt;br /&gt;
	cat &gt; t2.make &lt;&lt; \!&lt;br /&gt;
	all:&lt;br /&gt;
		@echo &quot;Should echo t1, but echoes $(SHELLVAR)&quot;&lt;br /&gt;
	!&lt;br /&gt;
	${MAKE} -f t1.make all&lt;br /&gt;
	rm -f t1.make t2.make &lt;br /&gt;
&lt;br /&gt;
GNU make (3.82, Slackware 14; 3.81, Mac OS X) echoes &quot;t1&quot;, FreeBSD 10.0 make(1), NetBSD 6.99.19 make(1), OpenBSD 5.3 make(1) as well as smake(1) 1.2 echo &quot;shell&quot;.</description>
<guid>http://austingroupbugs.net/view.php?id=693</guid>
<author>steffen &lt;steffen@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=693#bugnotes</comments>
</item>
<item>
<title>0000696: either NAME_MAX shouldn't be optional, or readdir_r() needs clarification</title>
<link>http://austingroupbugs.net/view.php?id=696</link>
<description>The &lt;limits.h&gt; description says this about the Pathname Variable Values, which include NAME_MAX:&lt;br /&gt;
    A definition of one of the symbolic constants in the following&lt;br /&gt;
    list shall be omitted from the &lt;limits.h&gt; header on specific&lt;br /&gt;
    implementations where the corresponding value is equal to or&lt;br /&gt;
    greater than the stated minimum, but where the value can vary&lt;br /&gt;
    depending on the file to which it is applied. The actual value&lt;br /&gt;
    supported for a specific pathname shall be provided by the&lt;br /&gt;
    pathconf() function.&lt;br /&gt;
&lt;br /&gt;
So implementations can leave NAME_MAX undefined if the limit varies.  Meanwhile, the readdir_r() description says:&lt;br /&gt;
    The storage pointed to by entry shall be large enough for a&lt;br /&gt;
    dirent with an array of char d_name members containing at least&lt;br /&gt;
    {NAME_MAX}+1 elements.&lt;br /&gt;
&lt;br /&gt;
If NAME_MAX really is optional, then the above text should be replaced with a discussion of NAME_MAX vs pathconf(dir, _PC_NAME_MAX).  And what should you do if pathconf() returns -1, which it does for 32bit Linux binaries accessing filesystems where statvfs() fails with EOVERFLOW?</description>
<guid>http://austingroupbugs.net/view.php?id=696</guid>
<author>philip-guenther &lt;philip-guenther@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=696#bugnotes</comments>
</item>
<item>
<title>0000697: Adding of a getdirentries() function</title>
<link>http://austingroupbugs.net/view.php?id=697</link>
<description>POSIX systems don't follow the Unix paradigm &quot;everything is a file&quot; for directories in that it is impossible to simply open(2) a directory and read(2) the descriptor to get access to the list of direntries therein.&lt;br /&gt;
&lt;br /&gt;
In the current POSIX standard there is no way to gain access to directory entries but by using the completely intransparent (in respect to internal resource usage; though today there is now fdopendir(3), but still) and unpredictable (&quot;directory status snapshot&quot;) opendir(3) / readdir(3) / closedir(3) family of functions.&lt;br /&gt;
&lt;br /&gt;
On the other hand all (to the best of my knowledge) POSIX systems support some kind of getdents(2), getdirentries(2) or getdirent(2) system call (with, despite their names, almost identical semantics).&lt;br /&gt;
This functionality can be used to fully control reading of directory entries, at least in respect to resource usage, and including the possibility to perform bulk reads.  A publically accessible example would be [1].&lt;br /&gt;
&lt;br /&gt;
[1] &lt;a href=&quot;http://code.google.com/p/plan9port/source/browse/src/lib9/dirread.c?r=6daaa8f20a12cc5eda13b0e13f293a4cd4174729&quot;&gt;http://code.google.com/p/plan9port/source/browse/src/lib9/dirread.c?r=6daaa8f20a12cc5eda13b0e13f293a4cd4174729&lt;/a&gt; [&lt;a href=&quot;http://code.google.com/p/plan9port/source/browse/src/lib9/dirread.c?r=6daaa8f20a12cc5eda13b0e13f293a4cd4174729&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]</description>
<guid>http://austingroupbugs.net/view.php?id=697</guid>
<author>steffen &lt;steffen@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=697#bugnotes</comments>
</item>
<item>
<title>0000615: pthread_setcancelstate should be async-signal-safe</title>
<link>http://austingroupbugs.net/view.php?id=615</link>
<description>In order to write a signal handler for an asynchronous signal which can run safely in a cancellable thread, pthread_setcancelstate must be used to disable cancellation for the duration of the signal handler. This is because acting on cancellation at a cancellation point that occurs during a signal handler is, from the perspective of the asynchronously interrupted code, asynchronous cancellation.&lt;br /&gt;
&lt;br /&gt;
Consider for example the case where the main flow of execution of the thread is in malloc at the time a signal arrives, and the signal handler calls an async-signal-safe function which is also a cancellation point (such as open/close).</description>
<guid>http://austingroupbugs.net/view.php?id=615</guid>
<author>dalias &lt;dalias@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=615#bugnotes</comments>
</item>
<item>
<title>0000592: consistent use of struct timespec</title>
<link>http://austingroupbugs.net/view.php?id=592</link>
<description>Most headers that use struct timespec require that it be defined as in &lt;time.h&gt; (&lt;aio.h&gt; line 7210, &lt;mqueue.h&gt; line 9846, &lt;pthread.h&gt; line 10543, &lt;sched.h&gt; line 10756, &lt;signal.h&gt; line 10967, &lt;sys/select.h&gt; line 12650, &lt;sys/stat.h&gt; line 13044).&lt;br /&gt;
&lt;br /&gt;
However, while &lt;semaphore.h&gt; permits the inclusion of &lt;time.h&gt; (line 10892), it does not require it and does not mandate that a forward reference to struct timespec be in place before the declaration of sem_timedwait(), which means that the declaration could be inadvertently declaring a pointer to a unique type if the headers are included in the wrong order.  Worse, &lt;trace.h&gt; directly uses struct timespec (line 14264), but does not require either the type to exist nor the use of &lt;time.h&gt;.  Both of these go against the goal of Issue 7 in making more headers self-contained.&lt;br /&gt;
&lt;br /&gt;
Finally, a number of functions list the inclusion of &lt;time.h&gt; in their SYNOPSIS section, supposedly to guarantee the correct struct timespec, although this is redundant as demonstrated by the requirements listed above.</description>
<guid>http://austingroupbugs.net/view.php?id=592</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=592#bugnotes</comments>
</item>
<item>
<title>0000700: Clarify strtoul's behaviour on strings representing negative numbers</title>
<link>http://austingroupbugs.net/view.php?id=700</link>
<description>In which cases does strtoul (and other strtou* functions) fail with ERANGE?  How is the range check performed?&lt;br /&gt;
&lt;br /&gt;
This ticket follows the discussion about strtoul on austin-group-l in May 2013.&lt;br /&gt;
&lt;br /&gt;
The RETURN VALUE section in&lt;br /&gt;
&lt;a href=&quot;http://pubs.opengroup.org/onlinepubs/009696799/functions/strtoul.html&quot;&gt;http://pubs.opengroup.org/onlinepubs/009696799/functions/strtoul.html&lt;/a&gt; [&lt;a href=&quot;http://pubs.opengroup.org/onlinepubs/009696799/functions/strtoul.html&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
says:&lt;br /&gt;
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].&lt;br /&gt;
&lt;br /&gt;
Some people understand this as &quot;if the value I read (the correct value) is outside the [0, ULONG_MAX] range, then strtoul fails with ERANGE&quot;.&lt;br /&gt;
&lt;br /&gt;
However, it seems that many implementations do the following:&lt;br /&gt;
1. Read independently the optional sign and the subject [0-9]+ sequence&lt;br /&gt;
2. If the subject sequence fits in the unsigned long type, then store it in an unsigned long variable.  Otherwise (outside the [0, ULONG_MAX] range), fail with ERANGE.&lt;br /&gt;
3. If there was a minus sign, then apply negation on the unsigned long variable as if it were a signed long.&lt;br /&gt;
&lt;br /&gt;
According to the discussion on the austin-group-l mailing list, it looks like this is what the POSIX standard (and the C standard) intend to specify.  But it looks like it is not clear enough in the specification.</description>
<guid>http://austingroupbugs.net/view.php?id=700</guid>
<author>fbauzac &lt;fbauzac@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=700#bugnotes</comments>
</item>
<item>
<title>0000699: setr?e[gu]id should be async-signal-safe</title>
<link>http://austingroupbugs.net/view.php?id=699</link>
<description>The standard already requires that setgid() and setuid() be async-signal safe; however, these two functions are inadequate to completely set all aspects of a process' identity when compared with the more powerful sete*id and setre*id variants.  Yet, when writing a multi-threaded application, the only time at which it is possible to safely set the identity of a child process is either by the use of posix_spawn() (which is limited in what it can do), or between the fork() and exec*() of the child process (where it is only safe to use async-signal-safe functions).  It makes no sense for the simpler function to be safe while the more complex function is unsafe, especially if the simpler one can be implemented in terms of the more complex one.&lt;br /&gt;
&lt;br /&gt;
As a side note: The standard intentionally doesn't document initgroups() or setgroups(), but presumably initgroups() may have the same non-safety issues as getpwuid_r, while setgroups() would be async-signal-safe.  Thus, a privileged application that can spawn child processes on behalf of another user would learn the uid, gid, and supplemental gids to use prior to forking, then change the identity of the child after forking.</description>
<guid>http://austingroupbugs.net/view.php?id=699</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=699#bugnotes</comments>
</item>
<item>
<title>0000686: Application usage for clock() conflicts with normative text</title>
<link>http://austingroupbugs.net/view.php?id=686</link>
<description>&quot;If the processor time used is not available or its value cannot be represented, the function shall return the value (clock_t)-1.&quot;&lt;br /&gt;
&lt;br /&gt;
vs&lt;br /&gt;
&lt;br /&gt;
&quot;The value returned by clock() may wrap around on some implementations. For example, on a machine with 32-bit values for clock_t, it wraps after 2147 seconds or 36 minutes.&quot;&lt;br /&gt;
&lt;br /&gt;
The former (aligned with ISO C) requires unrepresentable time values to result in (clock_t)-1; the latter seems to permit implementations to instead truncate the value.&lt;br /&gt;
&lt;br /&gt;
What's worse, if the value is truncated and clock_t is a signed type, the recommended application usage (subtracting clock_t values to measure intervals) causes the application to invoke undefined behavior via integer overflow. In particular, if the initial call to clock() returned A&gt;0 (by virtue of some processor time having been consumed before the start of main() or the point of first measurement), and a subsequent call returned B=INT_MIN just after overflow, then the recommended practice of computing B-A invokes undefined behavior.&lt;br /&gt;
&lt;br /&gt;
Note that the issue is exacerbated by the XSI requirement that CLOCKS_PER_SEC be 1000000, which makes overflow on 32-bit systems the norm rather than the exception.</description>
<guid>http://austingroupbugs.net/view.php?id=686</guid>
<author>dalias &lt;dalias@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=686#bugnotes</comments>
</item>
<item>
<title>0000690: clarify behavior when calling waitpid with SA_NOCLDWAIT</title>
<link>http://austingroupbugs.net/view.php?id=690</link>
<description>From the description for waitpid:&lt;br /&gt;
If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, and the process has no unwaited-for children that were transformed into zombie processes, the calling thread shall block until all of the children of the process containing the calling thread terminate, and wait() and waitpid() shall fail and set errno to [ECHILD].&lt;br /&gt;
&lt;br /&gt;
Similar text also appears in 2.4.3 Signal Actions of the base definitions.&lt;br /&gt;
The description for waitid (no p) doesn't indicate what its behavior is at all.&lt;br /&gt;
&lt;br /&gt;
Please clarify the interaction when waitpid is called with a pid parameter that matches no children. As specified, I believe a strict interpretation requires the calling thread to block even when calling waitpid with an invalid pid. A more desirable interpretation might allow waitpid to return immediately if the pid doesn't exist or is not a child.&lt;br /&gt;
&lt;br /&gt;
See attached source file.</description>
<guid>http://austingroupbugs.net/view.php?id=690</guid>
<author>tedu &lt;tedu@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=690#bugnotes</comments>
</item>
<item>
<title>0000672: Necessary step(s) to synchronize filename operations on disk</title>
<link>http://austingroupbugs.net/view.php?id=672</link>
<description>POSIX documents a way of ensuring data is actually sync'ed on permanent storage through fsync(), fdatasync() and aio_fsync().&lt;br /&gt;
&lt;br /&gt;
This way, previously written data, and/or modified meta-data, are guaranteed to be actually protected against a reasonably unexpected situation (system crash, power outage ...)&lt;br /&gt;
&lt;br /&gt;
However, when dealing with file entry handling, such as:&lt;br /&gt;
  * file creation (open(O_CREAT))&lt;br /&gt;
  * file renaming (rename())&lt;br /&gt;
  * symlinking (symlink())&lt;br /&gt;
  * hard-linking (link())&lt;br /&gt;
  * etc.&lt;br /&gt;
there is no documented way to actually give the same guarantee.&lt;br /&gt;
&lt;br /&gt;
Some implementations (such as the Linux glibc) have a somewhat (badly) documented way:&lt;br /&gt;
  * open the container directory in read-only (O_RDONLY)&lt;br /&gt;
  * apply fsync() or fdatasync() on it&lt;br /&gt;
&lt;br /&gt;
Please refer to the &quot;fsync()'ing a directory file descriptor&quot; thread on the austin-group-l mailing list for insightful comments on this issue.&lt;br /&gt;
&lt;br /&gt;
Several points were discussed, and these (possibly not fully correct) observations were made:&lt;br /&gt;
  * directory entries are not attributes of the files they point to, and can not expect to be synchronized [when fsync'ing the file]&lt;br /&gt;
  * tracking relationship between directory entries and file descriptors would be cumbersome (a file may be hard-linked in another directory, then have its initial entry being deleted, for example, or renamed to another location)&lt;br /&gt;
  * it is not clear whether a directory can be opened at all using open() (readdir() may be the only allowed interface), and what would be the open flags&lt;br /&gt;
  * it is not clear what fsync() on a directory file descriptor would do</description>
<guid>http://austingroupbugs.net/view.php?id=672</guid>
<author>xroche &lt;xroche@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=672#bugnotes</comments>
</item>
<item>
<title>0000687: Not all filesystems support posix_fallocate</title>
<link>http://austingroupbugs.net/view.php?id=687</link>
<description>As described in &lt;a href=&quot;http://austingroupbugs.net/view.php?id=684&quot;&gt;0000684&lt;/a&gt;, not every filesystem can (or can easily) support posix_fallocate().&lt;br /&gt;
&lt;br /&gt;
Applications need to know whether a filesystem supports posix_fallocate().  In addition to an error return from posix_fallocate() itself, it would be useful if an application could determine in advance whether or not a filesystem will support a call to posix_fallocate().</description>
<guid>http://austingroupbugs.net/view.php?id=687</guid>
<author>nick &lt;nick@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=687#bugnotes</comments>
</item>
<item>
<title>0000701: unget[w]c() and file position after discarding push back</title>
<link>http://austingroupbugs.net/view.php?id=701</link>
<description>The ungetc() description, as updated by TC1, includes the following:&lt;br /&gt;
&lt;br /&gt;
    The value of the file-position indicator for the stream after all&lt;br /&gt;
    pushed-back bytes have been read, or discarded by calling fseek(),&lt;br /&gt;
    fseeko(), fsetpos(), or rewind() (but not fflush()), shall be the&lt;br /&gt;
    same as it was before the bytes were pushed back.&lt;br /&gt;
&lt;br /&gt;
Similarly for ungetwc() (with &quot;characters&quot; instead of &quot;bytes&quot;).&lt;br /&gt;
&lt;br /&gt;
The &quot;discarded&quot; part of this requirement does not make any sense.&lt;br /&gt;
All of the listed functions which discard the push back also _set_ the&lt;br /&gt;
file position.  The file position will end up as whatever the function&lt;br /&gt;
sets it to, not &quot;the same as it was before the bytes [or characters]&lt;br /&gt;
were pushed back&quot;.&lt;br /&gt;
&lt;br /&gt;
Since these requirements derive from the C Standard, we should raise&lt;br /&gt;
this issue with the C committee.</description>
<guid>http://austingroupbugs.net/view.php?id=701</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://austingroupbugs.net/view.php?id=701#bugnotes</comments>
</item>
</channel>
</rss>
