Error in system.3 man page - Redhat

This is a discussion on Error in system.3 man page - Redhat ; I know I'm behind the times so maybe this has been fixed but I've poked around the web for a current version of the system() man page and can't find it. On RedHat Linux 7.x (.3, I think), my system.3 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Error in system.3 man page

  1. Error in system.3 man page

    I know I'm behind the times so maybe this has been fixed but I've
    poked around the web for a current version of the system() man page
    and can't find it.

    On RedHat Linux 7.x (.3, I think), my system.3 man page says:

    Return Value

    The value returned is 127 if the execve() call for /bin/sh
    fails, -1 if there was another error and the return code
    of the command otherwise.

    But my empirical results indicate that it returns 256x the return code
    of the command. Am I right or is there a more complex pattern I don't
    see? If I'm right, have more recent versions of the man page been
    corrected? If not, can I do it (in some CVS repository or something)
    or who do I send a correction to? (I'm a relative newbie at Linux.)

  2. Re: Error in system.3 man page

    cnelson@nycap.rr.com (Chris Nelson) writes:
    >I know I'm behind the times so maybe this has been fixed but I've
    >poked around the web for a current version of the system() man page
    >and can't find it.
    >
    >On RedHat Linux 7.x (.3, I think), my system.3 man page says:
    >
    > Return Value
    >
    > The value returned is 127 if the execve() call for /bin/sh
    > fails, -1 if there was another error and the return code
    > of the command otherwise.
    >
    >But my empirical results indicate that it returns 256x the return code
    >of the command. Am I right or is there a more complex pattern I don't
    >see? If I'm right, have more recent versions of the man page been
    >corrected? If not, can I do it (in some CVS repository or something)
    >or who do I send a correction to? (I'm a relative newbie at Linux.)



    Portable code should use the following to retrieve the termination status from system:

    #include

    int diag;

    diag = system("command");
    if (diag != -1) {
    if (diag == 127) {
    fprintf(stderr, "Unable to start command interpreter\n");
    } else {
    fprintf(stderr, "Command return status value is %d\n", WEXITSTATUS(diag));
    }
    } else {
    fprintf(stderr, "Unable to obtain termination status: %s\n", strerror(errno));
    }

    the definitive manual page for this is on The Open Group website. The
    operative text indicates that the termination status is returned in the
    format specified by waitpid(2).

    scott




  3. Re: Error in system.3 man page

    scott@slp53.sl.home (Scott Lurndal) wrote in message news:...
    > cnelson@nycap.rr.com (Chris Nelson) writes:
    > ...
    > Portable code should use the following to retrieve the termination status from system:
    >
    > ...
    >
    > the definitive manual page for this is on The Open Group website. The
    > operative text indicates that the termination status is returned in the
    > format specified by waitpid(2).
    >
    > scott
    >
    >
    >


    So why is the Linux page so wrong and how do I help it get fixed?

  4. Re: Error in system.3 man page

    cnelson@nycap.rr.com (Chris Nelson) writes:
    >scott@slp53.sl.home (Scott Lurndal) wrote in message news:...
    >> cnelson@nycap.rr.com (Chris Nelson) writes:
    >> ...
    >> Portable code should use the following to retrieve the termination status from system:
    >>
    >> ...
    >>
    >> the definitive manual page for this is on The Open Group website. The
    >> operative text indicates that the termination status is returned in the
    >> format specified by waitpid(2).
    >>
    >> scott
    >>
    >>
    >>

    >
    >So why is the Linux page so wrong and how do I help it get fixed?


    1) the redhat 8.0 pages are correct.

    2) opengroup has worked with the BSD community to provide the standard
    man pages to BSD distributions - you should encourage your distro
    vendor to work with the open group to get them in your distribution.

    scott

+ Reply to Thread