On 28 August 2011 21:50, Father Chrysostomos <sprout@cpan.org> wrote: > setpgrp with one argument ignores it and leaves it on the stack: > > $ perl -le 'print join " ", setpgrp 27' > 27 1 > > The documentation says: > > setpgrp PID,PGRP > Sets the current process group for the specified PID, 0 for the > current process. Raises an exception when used on a machine > that doesn’t implement POSIX setpgid(2) or BSD setpgrp(2). If > the arguments are omitted, it defaults to "0,0". Note that the > BSD 4.2 version of "setpgrp" does not accept any arguments, so > only "setpgrp(0,0)" is portable. See also "POSIX::setsid()". > > So I think setpgrp(27) should be a compile-time error, a bit like the usual ‘too many’ or ‘not enough’ errors, but in between: maybe ‘Wrong number of arguments for setpgrp’. Or maybe default to "setpgrp(27,0)" ? That would be at least more consistent with the reported prototype : § bleadperl -wle 'print prototype "CORE::setpgrp"' ;$$Thread Previous | Thread Next