Commit ed20cef6 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

headers: Move prctl constants to prctl.h

Move prctl constants into own header. They are
arch independent.

The x86 specific ARCH_SET_GS should be fetched from <asm/prctl.h>
(instead of defining own ones).
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f8ddc742
...@@ -9,33 +9,8 @@ ...@@ -9,33 +9,8 @@
#include "asm/bitops.h" #include "asm/bitops.h"
#include "asm/int.h" #include "asm/int.h"
/* prctl.h */
#define PR_SET_NAME 15
#define PR_GET_NAME 16
#define PR_CAPBSET_DROP 24
#define PR_GET_SECUREBITS 27
#define PR_SET_SECUREBITS 28
#define SECURE_NO_SETUID_FIXUP 2 #define SECURE_NO_SETUID_FIXUP 2
#define PR_SET_MM 35
# define PR_SET_MM_START_CODE 1
# define PR_SET_MM_END_CODE 2
# define PR_SET_MM_START_DATA 3
# define PR_SET_MM_END_DATA 4
# define PR_SET_MM_START_STACK 5
# define PR_SET_MM_START_BRK 6
# define PR_SET_MM_BRK 7
# define PR_SET_MM_ARG_START 8
# define PR_SET_MM_ARG_END 9
# define PR_SET_MM_ENV_START 10
# define PR_SET_MM_ENV_END 11
# define PR_SET_MM_AUXV 12
# define PR_SET_MM_EXE_FILE 13
#define PR_GET_TID_ADDRESS 40
#define CLONE_CHILD_USEPID 0x02000000 #define CLONE_CHILD_USEPID 0x02000000
#define CLONE_VFORK 0x00004000 #define CLONE_VFORK 0x00004000
......
...@@ -10,42 +10,11 @@ ...@@ -10,42 +10,11 @@
#include "protobuf/core.pb-c.h" #include "protobuf/core.pb-c.h"
/* prctl */
#define ARCH_SET_GS 0x1001
#define ARCH_SET_FS 0x1002
#define ARCH_GET_FS 0x1003
#define ARCH_GET_GS 0x1004
#define FS_TLS 0 #define FS_TLS 0
#define GS_TLS 1 #define GS_TLS 1
/* prctl.h */
#define PR_SET_NAME 15
#define PR_GET_NAME 16
#define PR_CAPBSET_DROP 24
#define PR_GET_SECUREBITS 27
#define PR_SET_SECUREBITS 28
#define SECURE_NO_SETUID_FIXUP 2 #define SECURE_NO_SETUID_FIXUP 2
#define PR_SET_MM 35
# define PR_SET_MM_START_CODE 1
# define PR_SET_MM_END_CODE 2
# define PR_SET_MM_START_DATA 3
# define PR_SET_MM_END_DATA 4
# define PR_SET_MM_START_STACK 5
# define PR_SET_MM_START_BRK 6
# define PR_SET_MM_BRK 7
# define PR_SET_MM_ARG_START 8
# define PR_SET_MM_ARG_END 9
# define PR_SET_MM_ENV_START 10
# define PR_SET_MM_ENV_END 11
# define PR_SET_MM_AUXV 12
# define PR_SET_MM_EXE_FILE 13
#define PR_GET_TID_ADDRESS 40
#define CLONE_CHILD_USEPID 0x02000000 #define CLONE_CHILD_USEPID 0x02000000
#define CLONE_VFORK 0x00004000 #define CLONE_VFORK 0x00004000
......
#include <asm/prctl.h>
#include <unistd.h> #include <unistd.h>
#include "restorer.h" #include "restorer.h"
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "log.h" #include "log.h"
#include "util-pie.h" #include "util-pie.h"
#include "syscall.h" #include "syscall.h"
#include "prctl.h"
#include "files.h" #include "files.h"
#include "sk-inet.h" #include "sk-inet.h"
#include "proc_parse.h" #include "proc_parse.h"
......
#ifndef __CR_PRCTL_H__
#define __CR_PRCTL_H__
#ifndef PR_SET_NAME
# define PR_SET_NAME 15
#endif
#ifndef PR_GET_NAME
# define PR_GET_NAME 16
#endif
#ifndef PR_CAPBSET_DROP
# define PR_CAPBSET_DROP 24
#endif
#ifndef PR_GET_SECUREBITS
# define PR_GET_SECUREBITS 27
#endif
#ifndef PR_SET_SECUREBITS
# define PR_SET_SECUREBITS 28
#endif
#ifndef PR_SET_MM
#define PR_SET_MM 35
# define PR_SET_MM_START_CODE 1
# define PR_SET_MM_END_CODE 2
# define PR_SET_MM_START_DATA 3
# define PR_SET_MM_END_DATA 4
# define PR_SET_MM_START_STACK 5
# define PR_SET_MM_START_BRK 6
# define PR_SET_MM_BRK 7
# define PR_SET_MM_ARG_START 8
# define PR_SET_MM_ARG_END 9
# define PR_SET_MM_ENV_START 10
# define PR_SET_MM_ENV_END 11
# define PR_SET_MM_AUXV 12
# define PR_SET_MM_EXE_FILE 13
#endif
#ifndef PR_GET_TID_ADDRESS
# define PR_GET_TID_ADDRESS 40
#endif
#endif /* __CR_PRCTL_H__ */
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "syscall.h" #include "syscall.h"
#include "parasite.h" #include "parasite.h"
#include "fcntl.h" #include "fcntl.h"
#include "prctl.h"
#include "lock.h" #include "lock.h"
#include "vdso.h" #include "vdso.h"
#include "log.h" #include "log.h"
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "compiler.h" #include "compiler.h"
#include "asm/types.h" #include "asm/types.h"
#include "syscall.h" #include "syscall.h"
#include "prctl.h"
#include "log.h" #include "log.h"
#include "util.h" #include "util.h"
#include "image.h" #include "image.h"
......
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