|
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)
|