Pid(3)

πŸ’– NAME πŸ’–

okay so you're reading Pid(3), the Linux::Pid page from User Contributed Perl Documentation β€” and it's literally here to get the native PID and the PPID on Linux. 🐧✨

πŸŽ€ SYNOPSIS πŸŽ€

bestie, here's the whole vibe:

use Linux::Pid;
print Linux::Pid::getpid(), "\t", Linux::Pid::getppid(), "\n";

use Linux::Pid qw(getpid getppid);
print getpid(), "\t", getppid(), "\n";

🌸 DESCRIPTION 🌸

so why would anyone use a module to get the PID and the PPID of a process when there are the $$ variable and the getppid() builtin? and we're not even mentioning the equivalent POSIX::getpid() and POSIX::getppid() functions, okay? πŸ™ˆ

the tea β˜• is this: it's useful on Linux, with multithreaded programs. Linux' C library, using the linux thread model, returns different values of the PID and the PPID from different threads. (other thread models such as NPTL don't have the same behaviour.) this module forces perl to call the underlying C functions getpid() and getppid(). slay. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

Copyright (c) 2002-2007 Rafael Garcia-Suarez. All rights reserved. this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🫢


that's the page, bestie πŸŽ€ β€” from perl v5.42.0, dated 2014-07-21, page Pid(3). bye! πŸ’–

πŸ“¦ where this page comes from