]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pidfd-util: add missing trailing argument for ioctl(PIDFD_GET_*_NAMESPACE)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Oct 2025 06:14:07 +0000 (15:14 +0900)
committerMike Yuan <me@yhndnzj.com>
Fri, 10 Oct 2025 22:13:26 +0000 (00:13 +0200)
Otherwise, it always fails with EINVAL.

src/basic/pidfd-util.c

index 9910819aa79d949258cf2c970996d823b234b103..b6614ffd3a573befa20966643c144c7663622f74 100644 (file)
@@ -56,7 +56,7 @@ int pidfd_get_namespace(int fd, unsigned long ns_type_cmd) {
         if (have_pidfs == 0 || !cached_supported)
                 return -EOPNOTSUPP;
 
-        int nsfd = ioctl(fd, ns_type_cmd);
+        int nsfd = ioctl(fd, ns_type_cmd, 0);
         if (nsfd < 0) {
                 /* Kernel returns EOPNOTSUPP if the ns type in question is disabled. Hence we need to look
                  * at precise errno instead of generic ERRNO_IS_(IOCTL_)NOT_SUPPORTED. */