about summary refs log tree commit diff
path: root/src/misc
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/getpriority.c2
-rw-r--r--src/misc/getrlimit.c2
-rw-r--r--src/misc/getrusage.c14
-rw-r--r--src/misc/ioctl.c2
-rw-r--r--src/misc/sched_yield.c2
-rw-r--r--src/misc/setpriority.c2
-rw-r--r--src/misc/setrlimit.c2
-rw-r--r--src/misc/uname.c2
8 files changed, 8 insertions, 20 deletions
diff --git a/src/misc/getpriority.c b/src/misc/getpriority.c
index 2fb26b2b..5c0b1682 100644
--- a/src/misc/getpriority.c
+++ b/src/misc/getpriority.c
@@ -3,7 +3,7 @@
 
 int getpriority(int which, id_t who)
 {
-	int ret = syscall2(__NR_getpriority, which, who);
+	int ret = syscall(SYS_getpriority, which, who);
 	if (ret < 0) return ret;
 	return 20-ret;
 }
diff --git a/src/misc/getrlimit.c b/src/misc/getrlimit.c
index 84a659d4..13835257 100644
--- a/src/misc/getrlimit.c
+++ b/src/misc/getrlimit.c
@@ -5,7 +5,7 @@
 int getrlimit(int resource, struct rlimit *rlim)
 {
 	long k_rlim[2];
-	if (syscall2(__NR_getrlimit, resource, (long)k_rlim) < 0)
+	if (syscall(SYS_getrlimit, resource, k_rlim) < 0)
 		return -1;
 	rlim->rlim_cur = k_rlim[0] == -1 ? -1 : (unsigned long)k_rlim[0];
 	rlim->rlim_max = k_rlim[1] == -1 ? -1 : (unsigned long)k_rlim[1];
diff --git a/src/misc/getrusage.c b/src/misc/getrusage.c
index 1b8850f9..a5cbd757 100644
--- a/src/misc/getrusage.c
+++ b/src/misc/getrusage.c
@@ -2,19 +2,7 @@
 #include <string.h>
 #include "syscall.h"
 
-/* this is a huge hack to make up for the kernel's stupid 32bit time_t
- * without having to recopy the whole rusage structure ourselves.. */
-
 int getrusage(int who, struct rusage *ru)
 {
-	struct { long tv_sec, tv_usec; } ktv[2];
-	char *fakeaddr = ((char *)ru + sizeof(struct timeval [2]) - sizeof ktv);
-	if (syscall2(__NR_getrusage, who, (long)fakeaddr) < 0)
-		return -1;
-	memcpy(ktv, fakeaddr, sizeof ktv);
-	ru->ru_utime.tv_sec  = ktv[0].tv_sec;
-	ru->ru_utime.tv_usec = ktv[0].tv_usec;
-	ru->ru_stime.tv_sec  = ktv[1].tv_sec;
-	ru->ru_stime.tv_usec = ktv[1].tv_usec;
-	return 0;
+	return syscall(SYS_getrusage, who, ru);
 }
diff --git a/src/misc/ioctl.c b/src/misc/ioctl.c
index 808b7c9c..5a41f0e8 100644
--- a/src/misc/ioctl.c
+++ b/src/misc/ioctl.c
@@ -9,5 +9,5 @@ int ioctl(int fd, int req, ...)
 	va_start(ap, req);
 	arg = va_arg(ap, void *);
 	va_end(ap);
-	return syscall3(__NR_ioctl, fd, req, (long)arg);
+	return syscall(SYS_ioctl, fd, req, arg);
 }
diff --git a/src/misc/sched_yield.c b/src/misc/sched_yield.c
index 8a68519e..6c0742b4 100644
--- a/src/misc/sched_yield.c
+++ b/src/misc/sched_yield.c
@@ -4,7 +4,7 @@
 
 int __yield()
 {
-	return syscall0(__NR_sched_yield);
+	return syscall(SYS_sched_yield);
 }
 
 weak_alias(__yield, sched_yield);
diff --git a/src/misc/setpriority.c b/src/misc/setpriority.c
index 26da4b83..866b3b6e 100644
--- a/src/misc/setpriority.c
+++ b/src/misc/setpriority.c
@@ -3,5 +3,5 @@
 
 int setpriority(int which, id_t who, int prio)
 {
-	return syscall3(__NR_getpriority, which, who, prio);
+	return syscall(SYS_getpriority, which, who, prio);
 }
diff --git a/src/misc/setrlimit.c b/src/misc/setrlimit.c
index 7fdfc4e5..68bd9d74 100644
--- a/src/misc/setrlimit.c
+++ b/src/misc/setrlimit.c
@@ -5,7 +5,7 @@
 int setrlimit(int resource, const struct rlimit *rlim)
 {
 	long k_rlim[2] = { rlim->rlim_cur, rlim->rlim_max };
-	return syscall2(__NR_setrlimit, resource, (long)k_rlim);
+	return syscall(SYS_setrlimit, resource, k_rlim);
 }
 
 LFS64(setrlimit);
diff --git a/src/misc/uname.c b/src/misc/uname.c
index fbe86643..46db90d3 100644
--- a/src/misc/uname.c
+++ b/src/misc/uname.c
@@ -4,5 +4,5 @@
 
 int uname(struct utsname *uts)
 {
-	return syscall1(__NR_uname, (long)uts);
+	return syscall(SYS_uname, uts);
 }