[CRIU] [crtools-bot] util: add socket syscalls
Cyrill Gorcunov
gorcunov at openvz.org
Wed Feb 1 10:26:33 EST 2012
The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit fd7c44dd8629d503b08421ec8b7ecb6effc0fc81
Author: Andrey Vagin <avagin at openvz.org>
Date: Wed Feb 1 13:00:48 2012 +0300
util: add socket syscalls
Signed-off-by: Andrey Vagin <avagin at openvz.org>
Acked-by: Pavel Emelyanov <xemul at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
include/syscall-codes.h | 4 ++++
include/syscall.h | 22 ++++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/include/syscall-codes.h b/include/syscall-codes.h
index 5215590..55bec35 100644
--- a/include/syscall-codes.h
+++ b/include/syscall-codes.h
@@ -22,6 +22,10 @@
#define __NR_getitimer 36
#define __NR_setitimer 38
#define __NR_getpid 39
+#define __NR_socket 41
+#define __NR_sendmsg 46
+#define __NR_recvmsg 47
+#define __NR_bind 49
#define __NR_clone 56
#define __NR_exit 60
#define __NR_wait4 61
diff --git a/include/syscall.h b/include/syscall.h
index 9fdb00f..4ef2ea1 100644
--- a/include/syscall.h
+++ b/include/syscall.h
@@ -349,6 +349,28 @@ static long sys_capset(struct cap_header *h, struct cap_data *d)
return syscall2(__NR_capset, (long)h, (long)d);
}
+static int sys_socket(int domain, int type, int protocol)
+{
+ return syscall3(__NR_socket, (long) domain, (long) type, (long) protocol);
+}
+
+struct sockaddr *addr;
+static int sys_bind(int sockfd, const struct sockaddr *addr, int addrlen)
+{
+ return syscall3(__NR_bind, (long)sockfd, (long)addr, (long) addrlen);
+}
+
+struct msghdr;
+static long sys_sendmsg(int sockfd, const struct msghdr *msg, int flags)
+{
+ return syscall3(__NR_sendmsg, (long)sockfd, (long)msg, (long) flags);
+}
+
+static long sys_recvmsg(int sockfd, struct msghdr *msg, int flags)
+{
+ return syscall3(__NR_recvmsg, (long)sockfd, (long)msg, (long) flags);
+}
+
#ifndef CLONE_NEWUTS
#define CLONE_NEWUTS 0x04000000
#endif
More information about the CRIU
mailing list