OpenSolaris

Printable Version Enter a New Search
Bug ID 6485379
Synopsis setpgid should follow man page to set errno
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:brandz
Keywords
Responsible Engineer William Kucharski
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_52
Fixed In snv_52
Release Fixed solaris_nevada(snv_52) , solaris_10u4(s10u4_01) (Bug ID:2144882)
Related Bugs
Submit Date 24-October-2006
Last Update Date 19-January-2007
Description
part of setpgid man page:

	 EINVAL pgid is less than 0 (setpgid, setpgrp).

but current in lxzone, this is not true:
[root@lxzone1 tmp]# cat setpgid_7.c
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>

main()
{
        int rval=0, err=0;

        errno = 0;
        rval = setpgid((pid_t)0, (pid_t)-1);
        if ((rval != -1) || (errno != EINVAL))
        {
                err = errno;
                printf("setpgid(0, -1) did not fail as expected with errno = EINVAL\n");
                printf("setpgid() returned %d with errno = %d(%s)\n",
                        rval, err, strerror(err));
                return 1;
        }else
                printf("case passed!\n");

        return 0;
}

run in native linux OS:
miin:/tmp> uname -a
Linux miin 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux
miin:/tmp> ./setpgid_7
case passed!


run in solaris global:
bash-3.00# uname -a
SunOS covete 5.11 onnv-gate:2006-10-23 i86pc i386 i86pc
bash-3.00# ./setpgid_7
case passed!

run in linux zone:
[root@lxzone1 tmp]# hostname
lxzone1
[root@lxzone1 tmp]# ./setpgid_7
setpgid(0, -1) did not fail as expected with errno = EINVAL
setpgid() returned -1 with errno = 3(No such process)
Work Around
N/A
Comments
N/A