diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-22 23:49:08 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-22 23:49:08 +0100 |
| commit | 46fadf4bf14360be046b9b770ddf205fad96a0a7 (patch) | |
| tree | 6e88bf6050e4f0cab877760e80f64bd708dd7400 /lib/libc/sys/resource/getpriority.c | |
| parent | 0f30d227497418c6d3bef7d52244407e30454504 (diff) | |
Add sys/resource.h implementation and nice(3)
Diffstat (limited to 'lib/libc/sys/resource/getpriority.c')
| -rw-r--r-- | lib/libc/sys/resource/getpriority.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libc/sys/resource/getpriority.c b/lib/libc/sys/resource/getpriority.c new file mode 100644 index 00000000..3df9eb30 --- /dev/null +++ b/lib/libc/sys/resource/getpriority.c @@ -0,0 +1,12 @@ +#include <sys/resource.h> +#include <syscall.h> + +int getpriority(int which, int who) +{ + int r = syscall(getpriority, which, who); + + if (r < 0) + return r; + + return 20 - r; +} |
