develooper Front page | perl.perl5.porters | Postings from August 2011

Re: setpgrp with one argument

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
August 29, 2011 00:22
Subject:
Re: setpgrp with one argument
Message ID:
CAMoYMM-uUw6ej5_fSHN-SgrpkhLGUQy_sCD2are=2iA_dUWq3A@mail.gmail.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About