[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#34956: ps formatting problem (fwd)



On Thu, 25 Mar 1999 11:32:24 -0500, Daniel Jacobowitz wrote:
>On Thu, Mar 25, 1999 at 02:55:03PM +1100, Craig Small wrote:
>> G'day glibc-ers,
>> 
>> I received this email from the upstream guy for procps.  I'm not sure
>> if you need to do this or not but here is the patch.
>
>Um, no, I don't think so.  I recommend you point him at the fputs(3)
>man page, where it says:

A better place to look is the C standard itself.  Quoting
http://wwwold.dkuug.dk/jtc1/sc22/open/n2794/n2794.txt (current draft of the
new standard, 'C9x'):

#       7.19.7.4  The fputs function
#
#       Synopsis
#
#       [#1]
#
#               #include <stdio.h>
#               int fputs(const char * restrict s,
#                       FILE * restrict stream);
#
#       Description
#
#       [#2] The fputs function writes the string pointed to by s to
#       the stream pointed  to  by  stream.   The  terminating  null
#       character is not written.
#
#       Returns
#
#       [#3] The fputs function returns EOF if a write error occurs;
#       otherwise it returns a nonnegative value.

Unix98 says the same thing; quoting
http://www.opengroup.org/onlinepubs/007908799/xsh/fputs.html:

# NAME
#
#   fputs - put a string on a stream 
#
# RETURN VALUE
#
#   Upon successful completion, fputs() returns a non-negative number. 
#   Otherwise it returns EOF, sets an error indicator for the stream and
#   errno is set to indicate the error.

There is a legitimate argument for this change: compatibility with Solaris
and IRIX, possibly all System V-derived systems.  Code that relies on this
behavior is not portable to BSD-derived systems, and glibc has chosen to
follow that lead instead.   (In general, glibc chooses BSD behavior when C
and POSIX specify nothing.)

This has come up repeatedly, and Ulrich has said repeatedly that he will not
change the behavior of glibc as distributed upstream.

zw


Reply to: