Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XSH errno

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Defect in XSH errno
From: yyyyyyyyyyyyyyy@xxxxxx
Date: Thu, 24 Jul 2003 14:19:29 +0200 (MEST)
        Defect report from : Andrew Josey , The Open Group

    @ page 294 line 9523 section errno objection {errno.iso.c.7.5}

    Since this standard defers to ISO C we should add clarification text
    in the next TC.

    Action:

    Add to end of paragraph 2

    "The value of errno may be set to non-zero by a function call
    whether or not there is an error, provided the use of errno
    is not documented for the function in IEEE Std 1003.1-2001"

No, I disagree.

This is formally incorrect: the C99 standard says
 "provided the use of errno is not documented in the description of
  the function in this International Standard."
and when quoting that you cannot make "this International Standard"
refer to POSIX instead of C99.

Also it is undesirable. Library functions can do whatever they want
with errno. Only when they return an error, is it allowed to examine
errno.

Only the few pages like getpwnam and getgrnam where one cannot
easily see from the function return value whether an error occurred
need further detail. It must be stated explicitly that when called
with errno=0 the no-error "not found" case leaves errno zero.
(Otherwise we are not even allowed to examine errno when the function
returns NULL.)

Andries

<Prev in Thread] Current Thread [Next in Thread>