summaryrefslogtreecommitdiff
path: root/tools/include/nolibc
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2022-02-07 19:23:39 +0300
committerPaul E. McKenney <paulmck@kernel.org>2022-04-21 03:05:44 +0300
commit830acd088edc1604ee46916188491ef634441fc6 (patch)
tree6d70ecba579dc380d0136250bfced11954c60fb4 /tools/include/nolibc
parent6e277371a5c4c73deb799aabfd5613ee3758e810 (diff)
downloadlinux-830acd088edc1604ee46916188491ef634441fc6.tar.xz
tools/nolibc/sys: make getpgrp(), getpid(), gettid() not set errno
These syscalls never fail so there is no need to extract and set errno for them. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc')
-rw-r--r--tools/include/nolibc/sys.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index 539af457a91b..ef017cc0a580 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -458,13 +458,7 @@ pid_t sys_getpgrp(void)
static __attribute__((unused))
pid_t getpgrp(void)
{
- pid_t ret = sys_getpgrp();
-
- if (ret < 0) {
- SET_ERRNO(-ret);
- ret = -1;
- }
- return ret;
+ return sys_getpgrp();
}
@@ -481,13 +475,7 @@ pid_t sys_getpid(void)
static __attribute__((unused))
pid_t getpid(void)
{
- pid_t ret = sys_getpid();
-
- if (ret < 0) {
- SET_ERRNO(-ret);
- ret = -1;
- }
- return ret;
+ return sys_getpid();
}
@@ -504,13 +492,7 @@ pid_t sys_gettid(void)
static __attribute__((unused))
pid_t gettid(void)
{
- pid_t ret = sys_gettid();
-
- if (ret < 0) {
- SET_ERRNO(-ret);
- ret = -1;
- }
- return ret;
+ return sys_gettid();
}