<?xml version="1.0" encoding="utf-8"?>
<!--  RSS generated by Flaimo.com RSS Builder [2010-03-13 08:18:32]  --> <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://www.austingroupbugs.net/</docs>
<description>Austin Group Defect Tracker - ISSUES</description>
<link>http://www.austingroupbugs.net/</link>
<title>Austin Group Defect Tracker - ISSUES</title>
<image>
<title>Austin Group Defect Tracker - ISSUES</title>
<url>http://www.austingroupbugs.net/images/mantis_logo_button.gif</url>
<link>http://www.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>2010-03-13T08:18:31+00:00</sy:updateBase>
<item>
<title>0000217: The &quot;single subshell&quot; rule for $(( is not sufficient</title>
<link>http://www.austingroupbugs.net/view.php?id=217</link>
<description>In the description of command substitution the standard says:&lt;br /&gt;
&lt;br /&gt;
    If the command substitution consists of a single subshell, such as:&lt;br /&gt;
&lt;br /&gt;
    $( (command) )&lt;br /&gt;
&lt;br /&gt;
    a conforming application shall separate the &quot;$(&quot; and '(' into two&lt;br /&gt;
    tokens (that is, separate them with white space). This is required&lt;br /&gt;
    to avoid any ambiguities with arithmetic expansion.&lt;br /&gt;
&lt;br /&gt;
In a discussion on the mailing list in December 2009, Philip Guenther&lt;br /&gt;
demonstrated that there are ambiguous cases other than the &quot;single&lt;br /&gt;
subshell&quot; case.  He gave the example:&lt;br /&gt;
&lt;br /&gt;
    cat=1; EOH=3; echo $(( cat &lt;&lt;EOH&lt;br /&gt;
    + ( (&lt;br /&gt;
    EOH&lt;br /&gt;
    ) &amp;&amp; ( cat &lt;&lt;EOH&lt;br /&gt;
    ) ) + 1 +&lt;br /&gt;
    EOH&lt;br /&gt;
    ))&lt;br /&gt;
&lt;br /&gt;
Current shell implementations treat this as an arithmetic expansion.&lt;br /&gt;
&lt;br /&gt;
Thus the requirement on applications quoted above should be extended&lt;br /&gt;
to cover all ambiguous cases, not just the &quot;single subshell&quot; case.&lt;br /&gt;
&lt;br /&gt;
The same requirement should also apply to nested subshells, so that&lt;br /&gt;
shells which implement the &quot;(( arithmetic expression ))&quot; extension &lt;br /&gt;
can apply the same disambiguation rules consistently to $((...)) and&lt;br /&gt;
((...)).</description>
<guid>http://www.austingroupbugs.net/view.php?id=217</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=217#bugnotes</comments>
</item>
<item>
<title>0000225: ENXIO and 'may fail'</title>
<link>http://www.austingroupbugs.net/view.php?id=225</link>
<description>The standard is inconsistent on when ENXIO, in relation to a request outside the capabilities of a device, is required rather than optional.  This text is associated with actions related to read() and write().  After auditing all uses of ENXIO associated with this phrase, the only uses that were marked as 'shall fail' are fseek/fseeko, fsetpos, and pread.  The case of pread is already being dealt with in &lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=218&quot;&gt;0000218&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
From an application standpoint, the application must already be prepared to deal with an optional error.  From an implementation standpoint, relaxing ENXIO to optional has no impact if the situation was already being detected, and eases compliance if it was not.  From a conformance test standpoint, it is not easy to write a test that reliably and intentionally requests an action beyond the capability of a device, so there is nothing lost by relaxing the requirement.&lt;br /&gt;
&lt;br /&gt;
Other uses of ENXIO, such as open() failing if an underlying device is not present, should remain as 'shall fail'.</description>
<guid>http://www.austingroupbugs.net/view.php?id=225</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=225#bugnotes</comments>
</item>
<item>
<title>0000224: awk -F and FS</title>
<link>http://www.austingroupbugs.net/view.php?id=224</link>
<description>There are a couple of problems with the description of the awk -F option:&lt;br /&gt;
&lt;br /&gt;
    -F ERE&lt;br /&gt;
        Define the input field separator to be the extended regular&lt;br /&gt;
        expression ERE, before any input is read&lt;br /&gt;
&lt;br /&gt;
1. By a strict reading, the ERE option-argument is used directly as&lt;br /&gt;
an extended regular expression, but in practice the option-argument&lt;br /&gt;
is handled as if it were a string literal to be assigned to the FS&lt;br /&gt;
variable.  This makes a difference to the treatment of backslash&lt;br /&gt;
characters:&lt;br /&gt;
&lt;br /&gt;
    $ awk -F '\\\\' 'BEGIN { print FS }'&lt;br /&gt;
    \\&lt;br /&gt;
&lt;br /&gt;
Here the ERE used as input field separator is \\ not \\\\.   It is&lt;br /&gt;
the same as for:&lt;br /&gt;
&lt;br /&gt;
    $ awk 'BEGIN { FS=&quot;\\\\&quot;; print FS }'&lt;br /&gt;
    \\&lt;br /&gt;
&lt;br /&gt;
2. The input field separator (and consequently the FS variable) should&lt;br /&gt;
be set before execution of any BEGIN actions, not just before any&lt;br /&gt;
input is read, so that applications can use FS within BEGIN actions.&lt;br /&gt;
E.g.:&lt;br /&gt;
&lt;br /&gt;
    BEGIN { OFS=FS }</description>
<guid>http://www.austingroupbugs.net/view.php?id=224</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=224#bugnotes</comments>
</item>
<item>
<title>0000219: Missing statement about pwrite() on file incapable of seeking</title>
<link>http://www.austingroupbugs.net/view.php?id=219</link>
<description>The read() page has a statement at the end of the DESCRIPTION:&lt;br /&gt;
&lt;br /&gt;
    &quot;An attempt to perform a pread() on a file that is incapable of&lt;br /&gt;
    seeking shall result in an error.&quot;&lt;br /&gt;
&lt;br /&gt;
There is no equivalent statement for pwrite() on the write() page.</description>
<guid>http://www.austingroupbugs.net/view.php?id=219</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=219#bugnotes</comments>
</item>
<item>
<title>0000223: mq_* routines use char * for data buffer</title>
<link>http://www.austingroupbugs.net/view.php?id=223</link>
<description>The &lt;mqueue.h&gt; header provides the following functions:&lt;br /&gt;
&lt;br /&gt;
ssize_t  mq_receive(mqd_t, char *, size_t, unsigned *);&lt;br /&gt;
int      mq_send(mqd_t, const char *, size_t, unsigned);&lt;br /&gt;
int      mq_setattr(mqd_t, const struct mq_attr *restrict,&lt;br /&gt;
             struct mq_attr *restrict);&lt;br /&gt;
ssize_t  mq_timedreceive(mqd_t, char *restrict, size_t,&lt;br /&gt;
             unsigned *restrict, const struct timespec *restrict);&lt;br /&gt;
int      mq_timedsend(mqd_t, const char *, size_t, unsigned,&lt;br /&gt;
             const struct timespec *);&lt;br /&gt;
&lt;br /&gt;
For some reason I've never understood why these routines use char *'s for data buffers, while functions like write() and send() use a void *. Message queues don't use strings. Message queues are binary safe.</description>
<guid>http://www.austingroupbugs.net/view.php?id=223</guid>
<author>EdSchouten &lt;EdSchouten@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=223#bugnotes</comments>
</item>
<item>
<title>0000222: C.2.6.2 needs a reference to C.2.2.3</title>
<link>http://www.austingroupbugs.net/view.php?id=222</link>
<description>Section C.2.2.3 Double-Quotes contains a lot of rationale about&lt;br /&gt;
parameter expansion (within double-quotes).  Readers looking for&lt;br /&gt;
rationale about parameter expansion go to C.2.6.2, so it would&lt;br /&gt;
be useful if that section had a reference to C.2.2.3.</description>
<guid>http://www.austingroupbugs.net/view.php?id=222</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=222#bugnotes</comments>
</item>
<item>
<title>0000218: Inconsistencies in pread() and read() errors</title>
<link>http://www.austingroupbugs.net/view.php?id=218</link>
<description>The error conditions on the read() page associated with pipes/FIFOs&lt;br /&gt;
and sockets have the same inconsistencies between pread() and read(),&lt;br /&gt;
and between pread() and lseek(), as were reported for pwrite() in&lt;br /&gt;
&lt;a href=&quot;http://www.austingroupbugs.net/view.php?id=215&quot;&gt;0000215&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In addition, there are duplicate EOVERFLOW and ENXIO errors for&lt;br /&gt;
pread(), one in the &quot;these functions&quot; part and one specific to&lt;br /&gt;
pread().  The suggested changes remove the pread()-specific one&lt;br /&gt;
in each case, as the other one seems more correct.</description>
<guid>http://www.austingroupbugs.net/view.php?id=218</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=218#bugnotes</comments>
</item>
<item>
<title>0000221: poor wording about even quotes in double quoted parameter expansion</title>
<link>http://www.austingroupbugs.net/view.php?id=221</link>
<description>Section 2.2.3 Double-Quotes says:&lt;br /&gt;
&lt;br /&gt;
    Within the string of characters from an enclosed &quot;${&quot; to the&lt;br /&gt;
    matching '}', an even number of unescaped double-quotes or&lt;br /&gt;
    single-quotes, if any, shall occur.&lt;br /&gt;
&lt;br /&gt;
This wording is poor for two reasons:&lt;br /&gt;
&lt;br /&gt;
1. It is a requirement on the application, but is not worded as such.&lt;br /&gt;
&lt;br /&gt;
2. It is ambiguous, in that it could be taken to mean the total&lt;br /&gt;
number of unescaped single-quotes and double-quotes, taken together,&lt;br /&gt;
must be even.  The intention is for the requirement to apply&lt;br /&gt;
separately to single-quotes and double-quotes.</description>
<guid>http://www.austingroupbugs.net/view.php?id=221</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=221#bugnotes</comments>
</item>
<item>
<title>0000144: Standard lacks a (possibly XSI) interface to associate a session to a TTY; tcsetsid()</title>
<link>http://www.austingroupbugs.net/view.php?id=144</link>
<description>According to the General Terminal Interface chapter, it is implementation defined whether a session associates to a TTY when O_NOCTTY is not passed to open():&lt;br /&gt;
&lt;br /&gt;
The controlling terminal for a session is allocated by the session leader in an implementation-defined manner. If a session leader has no controlling terminal, and opens a terminal device file that is not already associated with a session without using the O_NOCTTY option (see open()), it is implementation-defined whether the terminal becomes the controlling terminal of the session leader.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the standard does not specify a way to associate them when the implementation does not do this by default (i.e. the BSDs). This means it's practically impossible to implement a network login service or terminal emulator only using the interfaces described in POSIX.</description>
<guid>http://www.austingroupbugs.net/view.php?id=144</guid>
<author>EdSchouten &lt;EdSchouten@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=144#bugnotes</comments>
</item>
<item>
<title>0000183: Broken link for break on HTML version of standard, for break in section C2.4</title>
<link>http://www.austingroupbugs.net/view.php?id=183</link>
<description>The section containing&lt;br /&gt;
&lt;quote&gt;&lt;br /&gt;
The restriction on ending a name with a &lt;colon&gt; is to allow future implementations that support named labels for flow control; see the RATIONALE for the break built-in utility.&lt;br /&gt;
&lt;/quote&gt;&lt;br /&gt;
&lt;br /&gt;
contains a broken link for the word break.</description>
<guid>http://www.austingroupbugs.net/view.php?id=183</guid>
<author>wpollock &lt;wpollock@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=183#bugnotes</comments>
</item>
<item>
<title>0000180: code formatting</title>
<link>http://www.austingroupbugs.net/view.php?id=180</link>
<description>I was looking up for loops (to see which expansions are done)&lt;br /&gt;
and I noticed the formatting of multi-line code snippets&lt;br /&gt;
was missing some newlines:&lt;br /&gt;
&lt;quote&gt;&lt;br /&gt;
The format for the for loop is as follows:&lt;br /&gt;
&lt;br /&gt;
for name [ in [word ... ]]do&lt;br /&gt;
    compound-listdone&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The same can be observed for the case, while, and other descriptions&lt;br /&gt;
of formats in that section.</description>
<guid>http://www.austingroupbugs.net/view.php?id=180</guid>
<author>ajosey &lt;ajosey@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=180#bugnotes</comments>
</item>
<item>
<title>0000175: HTML problem in XCU7 sleep example</title>
<link>http://www.austingroupbugs.net/view.php?id=175</link>
<description>(Originally reported by Konrad Schwarz on 12 Jan 2009)&lt;br /&gt;
&lt;pre&gt;
&gt; while true
&gt; do
&gt;     command    sleep 37
&gt; done
&gt;
&gt; should be formatted as
&gt;
&gt; while true
&gt; do
&gt;     command
&gt;     sleep 37
&gt; done
&lt;/pre&gt;</description>
<guid>http://www.austingroupbugs.net/view.php?id=175</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=175#bugnotes</comments>
</item>
<item>
<title>0000188: thread-safe getenv()</title>
<link>http://www.austingroupbugs.net/view.php?id=188</link>
<description>The standard says that getenv() need not be thread-safe.  Since there&lt;br /&gt;
is no getenv_r() function, this makes obtaining environment variable&lt;br /&gt;
values somewhat inconvenient in multi-threaded conforming applications.&lt;br /&gt;
I imagine there are a large number of applications that don't bother&lt;br /&gt;
to be careful with getenv() and just assume it is thread-safe.&lt;br /&gt;
It probably is thread-safe on most, if not all, implementations that&lt;br /&gt;
support POSIX threads.&lt;br /&gt;
&lt;br /&gt;
The reason getenv() is not required to be thread-safe is stated in&lt;br /&gt;
the rationale:&lt;br /&gt;
&lt;br /&gt;
    &quot;The getenv() function is inherently not thread-safe because it&lt;br /&gt;
    returns [sic] a value pointing to static data.&quot;&lt;br /&gt;
&lt;br /&gt;
(I added &quot;[sic]&quot; because it should say &quot;may return&quot; not &quot;returns&quot;.)&lt;br /&gt;
&lt;br /&gt;
I think it likely that the only POSIX implementations where getenv()&lt;br /&gt;
copies the value to an internal buffer are UNIX implementations where&lt;br /&gt;
the UNIX APIs have been added to an O/S that was not originally UNIX.&lt;br /&gt;
It's possible none of these implement POSIX threads, or if they do&lt;br /&gt;
then they may have made getenv() thread-safe by using per-thread&lt;br /&gt;
internal buffers instead of a single buffer.&lt;br /&gt;
&lt;br /&gt;
Therefore I think the standard should require getenv() to be&lt;br /&gt;
thread-safe.  If there are any implementations which copy to an&lt;br /&gt;
internal buffer, and either have POSIX threads or want to add POSIX&lt;br /&gt;
threads in the future, they can conform simply by using per-thread&lt;br /&gt;
internal buffers.</description>
<guid>http://www.austingroupbugs.net/view.php?id=188</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=188#bugnotes</comments>
</item>
<item>
<title>0000187: Specification of c99 -I option should introduce the concept of system directories</title>
<link>http://www.austingroupbugs.net/view.php?id=187</link>
<description>POSIX says: &quot;For headers whose names are enclosed in angle brackets (&quot;&lt;&gt;&quot;), the header shall be searched for only in directories named in -I options and then in the usual places.&quot;&lt;br /&gt;
&lt;br /&gt;
However some implementations such as GCC (e.g. used via c99 under Linux) do not behave in that way, and developers regard that as a defect in POSIX. See e.g.&lt;br /&gt;
&lt;br /&gt;
  &lt;a href=&quot;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40442&quot;&gt;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40442&lt;/a&gt; [&lt;a href=&quot;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40442&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
which has been closed with the comment &quot;Not a GCC bug, the POSIX list generally agreed the effects of reordering system directories should be unspecified or undefined.&quot;</description>
<guid>http://www.austingroupbugs.net/view.php?id=187</guid>
<author>Vincent Lefevre &lt;Vincent Lefevre@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=187#bugnotes</comments>
</item>
<item>
<title>0000185: setenv failure case</title>
<link>http://www.austingroupbugs.net/view.php?id=185</link>
<description>There is a typo in the EINVAL error for setenv.&lt;br /&gt;
&lt;br /&gt;
Meanwhile, many existing BSD implementations crash or give EFAULT, rather than failing with EINVAL, when invoking setenv(NULL,&quot;&quot;,0).  Therefore, use of a null pointer is already non-portable in practice, and removing the requirement for a null pointer check allows for a faster implementation.  Omission of a requirement for a check for a null pointer could invalidate existing applications, but the likelihood of a compliant application expecting setenv(NULL,&quot;&quot;,0) to fail with EINVAL is minimal (given that such an application could crash when ported to BSD, and that wasting the time on a call known to not update environ seems pointless).  On the other hand, omitting the requirement would allow more existing implementations to be compliant, without penalizing any existing implementation that performs the null pointer check, since the standard already has an overriding statement that if not explicitly mentioned otherwise, use of a null pointer gives unspecified behavior.  Therefore, this proposal includes a change to relax the requirement regarding a null pointer check.&lt;br /&gt;
&lt;br /&gt;
This is orthogonal to issue 167, although it touches the same interfaces.&lt;br /&gt;
&lt;br /&gt;
Meanwhile, note that neither putenv(&quot;=&quot;) nor getenv(&quot;&quot;) are required to fail with EINVAL, although in practice, behavior varies widely on whether environ can successfully be managed if it contains an entry whose first character is '='.  The desired action makes no attempt to change this.</description>
<guid>http://www.austingroupbugs.net/view.php?id=185</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=185#bugnotes</comments>
</item>
<item>
<title>0000173: Executing programs with &quot;bad&quot; file descriptors 0, 1 or 2</title>
<link>http://www.austingroupbugs.net/view.php?id=173</link>
<description>XSH7 section 2.5 states:&lt;br /&gt;
&lt;br /&gt;
    &quot;At program start-up, three streams are predefined and need not&lt;br /&gt;
    be opened explicitly: standard input (for reading conventional&lt;br /&gt;
    input), standard output (for writing conventional output), and&lt;br /&gt;
    standard error (for writing diagnostic output).&quot;&lt;br /&gt;
&lt;br /&gt;
The standard also provides the means to execute programs with fd 0&lt;br /&gt;
not open for reading, or fd 1 or 2 not open for writing.  However,&lt;br /&gt;
it does not fully address the issue of what happens to stdin, stdout&lt;br /&gt;
and stderr when a conforming application is executed in such a way.&lt;br /&gt;
The security aspects of the issue were addressed in SUSv3 TC1, which&lt;br /&gt;
resulted in implementations being allowed to automatically open these&lt;br /&gt;
fds when executing set-user-ID or set-group-ID programs (although it&lt;br /&gt;
only says this for exec, not for posix_spawn or the shell).  At the&lt;br /&gt;
same time a note was added to exec() application usage saying:&lt;br /&gt;
&lt;br /&gt;
    &quot;Applications should not depend on file descriptors 0, 1, and 2&lt;br /&gt;
    being closed after an exec.  A future version may allow these file&lt;br /&gt;
    descriptors to be automatically opened for any process.&quot;&lt;br /&gt;
&lt;br /&gt;
I think we should make this change to allow implementations to do the&lt;br /&gt;
automatic open for any process.  However, the issue would still remain&lt;br /&gt;
of what happens on implementations which do not open them, and what&lt;br /&gt;
happens if they are open but not readable (fd 0) or not writable (fd 1&lt;br /&gt;
or 2).  In practice, I believe what happens is that the stdin, stdout&lt;br /&gt;
and stderr streams are created and their underlying file descriptors&lt;br /&gt;
are set to 0, 1 and 2 respectively, regardless of whether they are&lt;br /&gt;
open or closed, and regardless of whether fd 0 is readable or fd 1 or&lt;br /&gt;
2 is writable.&lt;br /&gt;
&lt;br /&gt;
At first sight, it would seem that a simple solution is just to&lt;br /&gt;
modify section 2.5 to describe this existing practice.  The problem&lt;br /&gt;
with this solution is that the guarantee in section 2.5 about stdin,&lt;br /&gt;
stdout and stderr being open (and readable/writable) at program&lt;br /&gt;
startup comes from the C Standard.  I don't believe a modification&lt;br /&gt;
of this nature would be a valid extension to the C Standard - it&lt;br /&gt;
would create a conflict.&lt;br /&gt;
&lt;br /&gt;
I believe an appropriate solution would be to state that if a program&lt;br /&gt;
is executed with fd 0 not open for reading or with fd 1 or 2 not open&lt;br /&gt;
for writing then this means the program is not executed in a conforming&lt;br /&gt;
environment.  Thus the program is not required to behave as described&lt;br /&gt;
in the standards (C and POSIX).&lt;br /&gt;
&lt;br /&gt;
There is also a similar issue for the standard utilities, in that&lt;br /&gt;
they may misbehave in odd ways if executed with fd 0 not open for&lt;br /&gt;
reading or with fd 1 or 2 not open for writing.  The solution for&lt;br /&gt;
applications could be used to solve this issue as well.</description>
<guid>http://www.austingroupbugs.net/view.php?id=173</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=173#bugnotes</comments>
</item>
<item>
<title>0000215: Inconsistencies in pwrite() and write() errors</title>
<link>http://www.austingroupbugs.net/view.php?id=215</link>
<description>The error conditions on the pwrite() page associated with pipes/FIFOs&lt;br /&gt;
and sockets are inconsistently specified between pwrite() and write(),&lt;br /&gt;
and between pwrite() and lseek().&lt;br /&gt;
&lt;br /&gt;
* Line 71229 specifies EAGAIN when O_NONBLOCK flag is set and pwrite()&lt;br /&gt;
  or write() would block, regardless of the file type.  This conflicts&lt;br /&gt;
  with line 71251 which allows EWOULDBLOCK as an alternative error&lt;br /&gt;
  for write() when the file descriptor refers to a socket.  There is&lt;br /&gt;
  no equivalent &quot;EAGAIN or EWOULDBLOCK&quot; error specified for pwrite().&lt;br /&gt;
&lt;br /&gt;
* EPIPE for a pipe/FIFO is specified for both pwrite() and write(),&lt;br /&gt;
  but EPIPE for a socket is only specified for write().&lt;br /&gt;
&lt;br /&gt;
* ECONNRESET, EACCES, ENETDOWN, and ENETUNREACH are only specified&lt;br /&gt;
  for write().&lt;br /&gt;
&lt;br /&gt;
* EINVAL for a negative offset is required for pwrite() on all file&lt;br /&gt;
  types, whereas for lseek() it is only required for regular files,&lt;br /&gt;
  block special files, and directories.  (I.e. implementations are&lt;br /&gt;
  allowed to support lseek() to negative offsets on character&lt;br /&gt;
  special files.)&lt;br /&gt;
&lt;br /&gt;
* ESPIPE for pwrite() is only specified for a pipe/FIFO but should&lt;br /&gt;
  also be specified for a socket (cf. lseek()).&lt;br /&gt;
&lt;br /&gt;
When deciding how to correct these problems, a precedence issue&lt;br /&gt;
between the ESPIPE and other pwrite() errors needs to be&lt;br /&gt;
considered.  Normally the standard does not specify precedence&lt;br /&gt;
between different error conditions - if this convention is&lt;br /&gt;
followed, then the full set of write() errors associated with&lt;br /&gt;
pipes, FIFOs and sockets should also be specified for pwrite(),&lt;br /&gt;
to allow those conditions to be detected before ESPIPE.  However,&lt;br /&gt;
in practice it seems unlikely that any implementation of pwrite()&lt;br /&gt;
would get as far as detecting whether the write operation would&lt;br /&gt;
block, or is to a pipe/FIFO with no readers, or is to a socket&lt;br /&gt;
that has been shut down for writing etc., without having detected&lt;br /&gt;
the ESPIPE condition.  The ESPIPE can be detected using only the&lt;br /&gt;
file type, whereas these other conditions require further&lt;br /&gt;
file-type-dependent information (i.e. they can only be detected&lt;br /&gt;
after the file type has been determined).  Therefore the suggested&lt;br /&gt;
changes remove the existing pipe/FIFO/socket-related errors for&lt;br /&gt;
pwrite(), other than ESPIPE, instead of adding the missing ones.&lt;br /&gt;
&lt;br /&gt;
In addition there are a couple of editorial problems that would be&lt;br /&gt;
worth addressing.  Line 71230 refers to &quot;the write() operation&quot;, but&lt;br /&gt;
the error applies to both write() and pwrite(); and, the pwrite()&lt;br /&gt;
&quot;shall fail&quot; block should be moved to before the &quot;may fail&quot; errors.</description>
<guid>http://www.austingroupbugs.net/view.php?id=215</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=215#bugnotes</comments>
</item>
<item>
<title>0000213: Definition of pututxline() is slightly too restrictive to allow flexible implementations</title>
<link>http://www.austingroupbugs.net/view.php?id=213</link>
<description>We at The FreeBSD Project very recently migrated to utmpx for storing user accounting information. We entirely removed the existing utmp interface, because it would be very impractical for us to support both interfaces.&lt;br /&gt;
&lt;br /&gt;
When implementing utmpx I noticed the following. The behaviour of pututxline() is specified as follows:&lt;br /&gt;
&lt;br /&gt;
&quot;If the process has appropriate privileges, the pututxline() function shall write out the structure into the user accounting database. It shall use getutxid() to search for a record that satisfies the request. If this search succeeds, then the entry shall be replaced. Otherwise, a new entry shall be made at the end of the user accounting database.&quot;&lt;br /&gt;
&lt;br /&gt;
Now this definition comes with two problems:&lt;br /&gt;
&lt;br /&gt;
- It basically disallows an implementation which does not use the same file descriptor for the reading and the writing interface of the database. It clearly says that getutxid() must be used to search for a record that satisfies the request, while one could easily imagine an implementation which does not do this. For example, Solaris and NetBSD may spawn a setuid application to perform logging when unprivileged. This process may use getutxid() internally, but the point is that its side-effects are not noticeable by the calling process.&lt;br /&gt;
&lt;br /&gt;
- A more serious problem with this definition is that the usage of getutxid() would blow up the database. Say, a login service that uses utmpx uses random values for ut_id to reduce the likelihood of collisions. Then this would mean each login session will have a DEAD_PROCESS entry that will remain in the database indefinitely. We at FreeBSD use a slightly improved allocation algorithm. When writing a USER_PROCESS, LOGIN_PROCESS or INIT_PROCESS record, it searches the database for an entry which has the same value for ut_id. If none is found, it overwrites an arbitrary DEAD_PROCESS record. This means the database will never become bigger than the maximum amount of concurrent sessions.</description>
<guid>http://www.austingroupbugs.net/view.php?id=213</guid>
<author>EdSchouten &lt;EdSchouten@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=213#bugnotes</comments>
</item>
<item>
<title>0000210: fsblkcnt_t and fsfilcnt_t incorrectly marked XSI</title>
<link>http://www.austingroupbugs.net/view.php?id=210</link>
<description>The statvfs structure, where fsblkcnt_t and fsfilcnt_t are used, is now in base.  Therefore these type definitions should be, too.</description>
<guid>http://www.austingroupbugs.net/view.php?id=210</guid>
<author>drepper &lt;drepper@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=210#bugnotes</comments>
</item>
<item>
<title>0000205: Shell pipeline connection requirement too vague</title>
<link>http://www.austingroupbugs.net/view.php?id=205</link>
<description>The requirement for the way commands in a pipeline are connected&lt;br /&gt;
is stated as:&lt;br /&gt;
&lt;br /&gt;
    &quot;The standard output of all but the last command shall be&lt;br /&gt;
    connected to the standard input of the next command.&quot;&lt;br /&gt;
&lt;br /&gt;
This is too vague; it needs to say precisely how they are&lt;br /&gt;
connected.  Otherwise implementations could, for example,&lt;br /&gt;
connect the commands using a pseudo-terminal which would&lt;br /&gt;
cause some commands to behave differently (such as ls&lt;br /&gt;
writing multi-column output).</description>
<guid>http://www.austingroupbugs.net/view.php?id=205</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=205#bugnotes</comments>
</item>
<item>
<title>0000216: Control characters must have single-byte encodings</title>
<link>http://www.austingroupbugs.net/view.php?id=216</link>
<description>The design of the general terminal interface is such that the&lt;br /&gt;
characters which perform the terminal functions ERASE, KILL,&lt;br /&gt;
INTR, etc. have to be single-byte characters, since they are&lt;br /&gt;
assigned/obtained using a single numeric value in the&lt;br /&gt;
termios.c_cc[] array.&lt;br /&gt;
&lt;br /&gt;
Currently only those control characters that are in the portable&lt;br /&gt;
character set (alert, backspace, tab, carriage-return, newline,&lt;br /&gt;
vertical-tab, form-feed) have an explicit requirement that they&lt;br /&gt;
are represented in a single byte (P128 L3590).  However, the&lt;br /&gt;
absence of any mention of a way of encoding multiple bytes into&lt;br /&gt;
termios.c_cc[] entries means that there is an implicit requirement&lt;br /&gt;
for the other control characters as well.  The requirement should&lt;br /&gt;
be stated explicitly.&lt;br /&gt;
&lt;br /&gt;
In addition, there is a minor editorial problem in the beginning&lt;br /&gt;
of section 6.2 where it says &quot;The POSIX locale contains the&lt;br /&gt;
characters in Table 6-1 (on page 125), which have the properties&lt;br /&gt;
listed in Section 7.3.1 (on page 139).&quot;  Since 7.3.1 specifies&lt;br /&gt;
properties for both the portable character set (Table 6-1) and the&lt;br /&gt;
control character set (Table 6-2) in the POSIX locale, both tables&lt;br /&gt;
should be mentioned in section 6.2.</description>
<guid>http://www.austingroupbugs.net/view.php?id=216</guid>
<author>geoffclare &lt;geoffclare@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=216#bugnotes</comments>
</item>
<item>
<title>0000214: &quot;dot&quot; should mention the effect of `return'</title>
<link>http://www.austingroupbugs.net/view.php?id=214</link>
<description>The description of &quot;dot&quot; never mentions `return'.</description>
<guid>http://www.austingroupbugs.net/view.php?id=214</guid>
<author>Konrad_Schwarz &lt;Konrad_Schwarz@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=214#bugnotes</comments>
</item>
<item>
<title>0000212: editorial errors in &lt;time.h&gt;</title>
<link>http://www.austingroupbugs.net/view.php?id=212</link>
<description>TIMER_ABSTIME is not specified in C99, and is only used by clock_nanosleep and timer_settime, both of which are marked CX.&lt;br /&gt;
&lt;br /&gt;
There is a typo in the description of getdate_err.</description>
<guid>http://www.austingroupbugs.net/view.php?id=212</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=212#bugnotes</comments>
</item>
<item>
<title>0000211: inttypes should provide wchar_t</title>
<link>http://www.austingroupbugs.net/view.php?id=211</link>
<description>In the move to make all of the standard headers self-contained (as an extension to the C99 behavior of requiring inclusion of prerequisite headers), we overlooked the use of wchar_t in the &lt;inttypes.h&gt; declaration of wcstoimax and wcstoumax.</description>
<guid>http://www.austingroupbugs.net/view.php?id=211</guid>
<author>eblake &lt;eblake@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=211#bugnotes</comments>
</item>
<item>
<title>0000209: lockf is XSI, constants not</title>
<link>http://www.austingroupbugs.net/view.php?id=209</link>
<description>lockf() is still (and should be) XSI.  The constants to use with lockf() are not marked as such anymore.  This should be changed.</description>
<guid>http://www.austingroupbugs.net/view.php?id=209</guid>
<author>drepper &lt;drepper@example.com&gt;</author>
<comments>http://www.austingroupbugs.net/view.php?id=209#bugnotes</comments>
</item>
</channel>
</rss>
