Name
setpgrp
Synopsis
setpgrp pid, pgrp
Description
Sets the current process group pgrp for the specified
pid (use a pid of 0
for
the current process). Invoking setpgrp
will
produce a fatal error if used on a machine that doesn’t implement
setpgrp(2)
. Some systems will ignore the
arguments you provide and always do setpgrp(0, $$)
.
Fortunately, those are the arguments you usually provide. (For better
portability, use the setpgid()
function in
the POSIX module, or if you’re really just trying to daemonize your script, consider
the POSIX::setsid()
function as well.)
Get Perl in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.