Commit 6ab01f7a authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

syscalls: Add set/get itimers syscalls

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 815168dd
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#define __NR_dup2 33 #define __NR_dup2 33
#define __NR_pause 34 #define __NR_pause 34
#define __NR_nanosleep 35 #define __NR_nanosleep 35
#define __NR_getitimer 36
#define __NR_setitimer 38
#define __NR_getpid 39 #define __NR_getpid 39
#define __NR_clone 56 #define __NR_clone 56
#define __NR_exit 60 #define __NR_exit 60
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define CR_SYSCALL_H_ #define CR_SYSCALL_H_
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h>
#include "types.h" #include "types.h"
#include "compiler.h" #include "compiler.h"
...@@ -157,6 +158,16 @@ static always_inline long sys_sigaction(int signum, const rt_sigaction_t *act, r ...@@ -157,6 +158,16 @@ static always_inline long sys_sigaction(int signum, const rt_sigaction_t *act, r
return syscall4(__NR_rt_sigaction, signum, (unsigned long)act, (unsigned long)oldact, sizeof(rt_sigset_t)); return syscall4(__NR_rt_sigaction, signum, (unsigned long)act, (unsigned long)oldact, sizeof(rt_sigset_t));
} }
static always_inline long sys_getitimer(int which, const struct itimerval *val)
{
return syscall2(__NR_getitimer, (unsigned long)which, (unsigned long)val);
}
static always_inline long sys_setitimer(int which, const struct itimerval *val, struct itimerval *old)
{
return syscall3(__NR_setitimer, (unsigned long)which, (unsigned long)val, (unsigned long)old);
}
static always_inline long sys_close(int fd) static always_inline long sys_close(int fd)
{ {
return syscall1(__NR_close, fd); return syscall1(__NR_close, fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment