mirror of https://github.com/mkerrisk/man-pages
30d0d39a4f
Thus, pidfd_open() is the preferred way of obtaining a PID file descriptor. Notes from a conversation with Christian Brauner: [[ > A further question... We now have three ways of getting a > process file descriptor [*]: > > open() of /proc/PID > pidfd_open() > clone()/clone3() with CLONE_PIDFD > > I thought the FD was supposed to be equivalent in all three cases. > However, if I try (on kernel 5.3) poll() an FD returned by opening > /proc/PID, poll() tells me POLLNVAL for the FD. Is that difference > intentional? (I am guessing it is not.) It's intentional. The short answer is that /proc/<pid> is a convenience for sending signals. The longer answer is that this stems from a heavy debate about what a process file descriptor was supposed to be and some people pushing for at least being able to use /proc/<pid> dirfds while ignoring security problems as soon as you're talking about returning those fds from clone(); not to mention the additional problems discovered when trying to implementing this. A "real" pidfd is one from CLONE_PIDFD or pidfd_open() and all features such as exit notification, read, and other future extensions will only be implemented on top of them. As much as we'd have liked to get rid of two different file descriptor types it doesn't hurt us much and is not that much different from what we will e.g. see with fsinfo() in the new mount api which needs to work on regular fds gotten via open()/openat() and mountfds gotten from fsopen() and fspick(). The mountfds will also allow for advanced operations that the other ones will not. There's even an argument to be made that fds you will get from open()/openat() and openat2() are different types since they have very different behavior; openat2() returning fds that are non arbitrarily upgradable etc. ]] Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> |
||
---|---|---|
man1 | ||
man2 | ||
man3 | ||
man4 | ||
man5 | ||
man6 | ||
man7 | ||
man8 | ||
scripts | ||
CONTRIBUTING | ||
Changes | ||
Changes.old | ||
Makefile | ||
README | ||
man-pages-5.03.Announce | ||
man-pages-5.03.lsm |
README
This package contains Linux man pages for sections 1 through 8. Some more information is given in the 'man-pages-x.y.Announce' file. Installing and uninstalling =========================== "make install" will copy these man pages to /usr/share/man/man[1-8]. To install to a path different from /usr, use "make install prefix=/install/path". "make remove" or "make uninstall" will remove any man page in this distribution from its destination. Use with caution, and remember to use "prefix" if desired, as with the "install" target. "make" or "make all" will perform "make uninstall" followed by "make install". Man page overlap and duplication ================================ Note that sometimes these pages are duplicates of pages also distributed in other packages. This has been reported about: man page also found in ------------------------------------- resolver.3 bind-utils, bind9utils resolv.conf.5 " passwd.5 shadow, passwd mailaddr.7 ? Copyrights ========== See the 'man-pages-x.y.Announce' file. Homepage ======== For much more about the Linux man-pages project, see http://www.kernel.org/doc/man-pages/index.html.