• Bug#196251: setpgrp() doesn't work as expected

    From GOTO Masanori@1:229/2 to Robert Millan on Thu Aug 12 05:10:07 2004
    XPost: linux.debian.maint.glibc
    From: [email protected]

    reassign 196251 glibc-doc
    severity 196251 minor
    retitle 196251 glibc-doc: info should describe about setpgrp() + _BSM_SOURCE. thanks

    At Thu, 05 Jun 2003 19:16:23 +0200,
    Robert Millan wrote:
    The Glibc docs say:

    - Function: int setpgrp (pid_t PID, pid_t PGID)
    This is the BSD Unix name for `setpgid'. Both functions do exactly
    the same thing.

    but that isn't true, see the following test case:

    $ cat test.c
    #include <sys/types.h>
    #include <unistd.h>
    main ()
    {
    setpgid (0, 0);
    setpgrp (0, 0);
    }
    $ gcc test.c -o /dev/null
    test.c: In function `main':
    test.c:6: error: too many arguments to function `setpgrp'

    You need to compile -D_BSD_SOURCE if you want to use BSD's setpgrp.
    In default, glibc uses SYSV style. But it's good idea to describe
    about it. I'll update glibc-doc.

    I've found this when i hit the kludges in Xfree86 sources to workaround it, in the style of:

    #if defined(__linux__) || defined(__GNU__)
    #define setpgrp setpgid
    #endif

    I think it's no problem. However if removing this definition causes compilation error, it may mean XFree86 needs large update for the
    recent library specification. I expect freedesktop.org can answer
    this kind of problem.

    Regards,
    -- gotom


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Robert Millan@1:229/2 to GOTO Masanori on Thu Aug 12 05:40:06 2004
    XPost: linux.debian.maint.glibc
    From: [email protected]

    On Thu, Aug 12, 2004 at 11:52:46AM +0900, GOTO Masanori wrote:

    You need to compile -D_BSD_SOURCE if you want to use BSD's setpgrp.
    In default, glibc uses SYSV style. But it's good idea to describe
    about it. I'll update glibc-doc.

    Ok thanks.

    --
    Robert Millan

    (Debra and Ian) (Gnu's Not (UNiplexed Information and Computing System))/\ (kernel of *(Berkeley Software Distribution))


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)