summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/proc/proc.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2018-08-21 21:54:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-22 10:52:45 -0700
commit61d47c4e71c1f080e7412315c8685bc682a8e53a (patch)
tree4df72b36490c5ff56010a498502fe4bc02c6073b /tools/testing/selftests/proc/proc.h
parentbdf228a27278d398ad26a156f01811be405867f9 (diff)
downloadlinux-61d47c4e71c1f080e7412315c8685bc682a8e53a.tar.gz
linux-61d47c4e71c1f080e7412315c8685bc682a8e53a.tar.bz2
linux-61d47c4e71c1f080e7412315c8685bc682a8e53a.zip
proc: test /proc/self symlink
There are plans to change how /proc/self result is calculated, for that a test is necessary. Use direct system call because of this whole getpid caching story. Link: http://lkml.kernel.org/r/20180627195103.GB18113@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/proc/proc.h')
-rw-r--r--tools/testing/selftests/proc/proc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/proc/proc.h b/tools/testing/selftests/proc/proc.h
index 4e178166fd84..31ca4b0c007f 100644
--- a/tools/testing/selftests/proc/proc.h
+++ b/tools/testing/selftests/proc/proc.h
@@ -6,6 +6,13 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+static inline pid_t sys_getpid(void)
+{
+ return syscall(SYS_getpid);
+}
static inline bool streq(const char *s1, const char *s2)
{