]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: use /proc/self/mounts
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 31 Aug 2022 21:07:15 +0000 (15:07 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 31 Aug 2022 21:07:31 +0000 (15:07 -0600)
commit1686eb6f24b3f9f37e1393bd5139206dfd5e5259
tree536a2c4a574b36cadb3c2a292a6b749ef36c89d9
parentd569122a8c5f9943e1842b5b776a8b1f84182f18
api.c: use /proc/self/mounts

Use /proc/self/mount instead of /proc/mounts, which is a symbolic link
to the former. The symbolic link creation can be traced back to Linux
Kernel commit 59c7572e82d6 ("proc: remove fs/proc/proc_misc.c"). Also,
the /proc/mounts are not available in the cases where the /proc is
mounted with subset=pid option.

As per kernel docs filesystems/procs.rst:
"subset=pid hides all top level files and directories in the procfs that
are not related to tasks."

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 16be308b037bbe11a54b692c227e160f1132eabe)
src/api.c