add personality() system call.
Change-Id: Ie899def8ea1d705930ed83adae1343c1353e7c57
This commit is contained in:
parent
ecd0e95a02
commit
f44de270bb
@ -251,6 +251,7 @@ int init_module(void *, unsigned long, const char *) 128
|
|||||||
int delete_module(const char*, unsigned int) 129
|
int delete_module(const char*, unsigned int) 129
|
||||||
int klogctl:syslog(int, char *, int) 103
|
int klogctl:syslog(int, char *, int) 103
|
||||||
int sysinfo(struct sysinfo *) 116
|
int sysinfo(struct sysinfo *) 116
|
||||||
|
int personality(unsigned long) 136
|
||||||
|
|
||||||
# futex
|
# futex
|
||||||
int futex(void *, int, int, void *, void *, int) 240
|
int futex(void *, int, int, void *, void *, int) 240
|
||||||
|
@ -169,6 +169,7 @@ syscall_src += arch-arm/syscalls/init_module.S
|
|||||||
syscall_src += arch-arm/syscalls/delete_module.S
|
syscall_src += arch-arm/syscalls/delete_module.S
|
||||||
syscall_src += arch-arm/syscalls/klogctl.S
|
syscall_src += arch-arm/syscalls/klogctl.S
|
||||||
syscall_src += arch-arm/syscalls/sysinfo.S
|
syscall_src += arch-arm/syscalls/sysinfo.S
|
||||||
|
syscall_src += arch-arm/syscalls/personality.S
|
||||||
syscall_src += arch-arm/syscalls/futex.S
|
syscall_src += arch-arm/syscalls/futex.S
|
||||||
syscall_src += arch-arm/syscalls/epoll_create.S
|
syscall_src += arch-arm/syscalls/epoll_create.S
|
||||||
syscall_src += arch-arm/syscalls/epoll_ctl.S
|
syscall_src += arch-arm/syscalls/epoll_ctl.S
|
||||||
|
14
libc/arch-arm/syscalls/personality.S
Normal file
14
libc/arch-arm/syscalls/personality.S
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <machine/asm.h>
|
||||||
|
#include <sys/linux-syscalls.h>
|
||||||
|
|
||||||
|
ENTRY(personality)
|
||||||
|
.save {r4, r7}
|
||||||
|
stmfd sp!, {r4, r7}
|
||||||
|
ldr r7, =__NR_personality
|
||||||
|
swi #0
|
||||||
|
ldmfd sp!, {r4, r7}
|
||||||
|
movs r0, r0
|
||||||
|
bxpl lr
|
||||||
|
b __set_syscall_errno
|
||||||
|
END(personality)
|
@ -158,6 +158,7 @@ syscall_src += arch-sh/syscalls/init_module.S
|
|||||||
syscall_src += arch-sh/syscalls/delete_module.S
|
syscall_src += arch-sh/syscalls/delete_module.S
|
||||||
syscall_src += arch-sh/syscalls/klogctl.S
|
syscall_src += arch-sh/syscalls/klogctl.S
|
||||||
syscall_src += arch-sh/syscalls/sysinfo.S
|
syscall_src += arch-sh/syscalls/sysinfo.S
|
||||||
|
syscall_src += arch-sh/syscalls/personality.S
|
||||||
syscall_src += arch-sh/syscalls/futex.S
|
syscall_src += arch-sh/syscalls/futex.S
|
||||||
syscall_src += arch-sh/syscalls/epoll_create.S
|
syscall_src += arch-sh/syscalls/epoll_create.S
|
||||||
syscall_src += arch-sh/syscalls/epoll_ctl.S
|
syscall_src += arch-sh/syscalls/epoll_ctl.S
|
||||||
|
32
libc/arch-sh/syscalls/personality.S
Normal file
32
libc/arch-sh/syscalls/personality.S
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <sys/linux-syscalls.h>
|
||||||
|
|
||||||
|
.text
|
||||||
|
.type personality, @function
|
||||||
|
.globl personality
|
||||||
|
.align 4
|
||||||
|
|
||||||
|
personality:
|
||||||
|
|
||||||
|
/* invoke trap */
|
||||||
|
mov.l 0f, r3 /* trap num */
|
||||||
|
trapa #(1 + 0x10)
|
||||||
|
|
||||||
|
/* check return value */
|
||||||
|
cmp/pz r0
|
||||||
|
bt __NR_personality_end
|
||||||
|
|
||||||
|
/* keep error number */
|
||||||
|
sts.l pr, @-r15
|
||||||
|
mov.l 1f, r1
|
||||||
|
jsr @r1
|
||||||
|
mov r0, r4
|
||||||
|
lds.l @r15+, pr
|
||||||
|
|
||||||
|
__NR_personality_end:
|
||||||
|
rts
|
||||||
|
nop
|
||||||
|
|
||||||
|
.align 2
|
||||||
|
0: .long __NR_personality
|
||||||
|
1: .long __set_syscall_errno
|
@ -172,6 +172,7 @@ syscall_src += arch-x86/syscalls/init_module.S
|
|||||||
syscall_src += arch-x86/syscalls/delete_module.S
|
syscall_src += arch-x86/syscalls/delete_module.S
|
||||||
syscall_src += arch-x86/syscalls/klogctl.S
|
syscall_src += arch-x86/syscalls/klogctl.S
|
||||||
syscall_src += arch-x86/syscalls/sysinfo.S
|
syscall_src += arch-x86/syscalls/sysinfo.S
|
||||||
|
syscall_src += arch-x86/syscalls/personality.S
|
||||||
syscall_src += arch-x86/syscalls/futex.S
|
syscall_src += arch-x86/syscalls/futex.S
|
||||||
syscall_src += arch-x86/syscalls/epoll_create.S
|
syscall_src += arch-x86/syscalls/epoll_create.S
|
||||||
syscall_src += arch-x86/syscalls/epoll_ctl.S
|
syscall_src += arch-x86/syscalls/epoll_ctl.S
|
||||||
|
23
libc/arch-x86/syscalls/personality.S
Normal file
23
libc/arch-x86/syscalls/personality.S
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <sys/linux-syscalls.h>
|
||||||
|
|
||||||
|
.text
|
||||||
|
.type personality, @function
|
||||||
|
.globl personality
|
||||||
|
.align 4
|
||||||
|
|
||||||
|
personality:
|
||||||
|
pushl %ebx
|
||||||
|
mov 8(%esp), %ebx
|
||||||
|
movl $__NR_personality, %eax
|
||||||
|
int $0x80
|
||||||
|
cmpl $-129, %eax
|
||||||
|
jb 1f
|
||||||
|
negl %eax
|
||||||
|
pushl %eax
|
||||||
|
call __set_errno
|
||||||
|
addl $4, %esp
|
||||||
|
orl $-1, %eax
|
||||||
|
1:
|
||||||
|
popl %ebx
|
||||||
|
ret
|
@ -132,6 +132,7 @@
|
|||||||
#define __NR_delete_module (__NR_SYSCALL_BASE + 129)
|
#define __NR_delete_module (__NR_SYSCALL_BASE + 129)
|
||||||
#define __NR_syslog (__NR_SYSCALL_BASE + 103)
|
#define __NR_syslog (__NR_SYSCALL_BASE + 103)
|
||||||
#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
|
#define __NR_sysinfo (__NR_SYSCALL_BASE + 116)
|
||||||
|
#define __NR_personality (__NR_SYSCALL_BASE + 136)
|
||||||
#define __NR_futex (__NR_SYSCALL_BASE + 240)
|
#define __NR_futex (__NR_SYSCALL_BASE + 240)
|
||||||
#define __NR_poll (__NR_SYSCALL_BASE + 168)
|
#define __NR_poll (__NR_SYSCALL_BASE + 168)
|
||||||
|
|
||||||
|
@ -199,6 +199,7 @@ int init_module (void *, unsigned long, const char *);
|
|||||||
int delete_module (const char*, unsigned int);
|
int delete_module (const char*, unsigned int);
|
||||||
int klogctl (int, char *, int);
|
int klogctl (int, char *, int);
|
||||||
int sysinfo (struct sysinfo *);
|
int sysinfo (struct sysinfo *);
|
||||||
|
int personality (unsigned long);
|
||||||
int futex (void *, int, int, void *, void *, int);
|
int futex (void *, int, int, void *, void *, int);
|
||||||
int epoll_create (int size);
|
int epoll_create (int size);
|
||||||
int epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);
|
int epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);
|
||||||
|
86
libc/include/sys/personality.h
Normal file
86
libc/include/sys/personality.h
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 The Android Open Source Project
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SYS_PERSONALITY_H_
|
||||||
|
#define _SYS_PERSONALITY_H_
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
/* constants taken from linux-3.0.4/include/linux/personality.h */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
UNAME26 = 0x0020000,
|
||||||
|
ADDR_NO_RANDOMIZE = 0x0040000,
|
||||||
|
FDPIC_FUNCPTRS = 0x0080000,
|
||||||
|
MMAP_PAGE_ZERO = 0x0100000,
|
||||||
|
ADDR_COMPAT_LAYOUT = 0x0200000,
|
||||||
|
READ_IMPLIES_EXEC = 0x0400000,
|
||||||
|
ADDR_LIMIT_32BIT = 0x0800000,
|
||||||
|
SHORT_INODE = 0x1000000,
|
||||||
|
WHOLE_SECONDS = 0x2000000,
|
||||||
|
STICKY_TIMEOUTS = 0x4000000,
|
||||||
|
ADDR_LIMIT_3GB = 0x8000000,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
|
||||||
|
ADDR_NO_RANDOMIZE | \
|
||||||
|
ADDR_COMPAT_LAYOUT | \
|
||||||
|
MMAP_PAGE_ZERO)
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PER_LINUX = 0x0000,
|
||||||
|
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
|
||||||
|
PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
|
||||||
|
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||||
|
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||||
|
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
|
||||||
|
WHOLE_SECONDS | SHORT_INODE,
|
||||||
|
PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
|
||||||
|
PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||||
|
PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
|
||||||
|
PER_BSD = 0x0006,
|
||||||
|
PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
|
||||||
|
PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||||
|
PER_LINUX32 = 0x0008,
|
||||||
|
PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
|
||||||
|
PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,
|
||||||
|
PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,
|
||||||
|
PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,
|
||||||
|
PER_RISCOS = 0x000c,
|
||||||
|
PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
|
||||||
|
PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||||
|
PER_OSF4 = 0x000f,
|
||||||
|
PER_HPUX = 0x0010,
|
||||||
|
PER_MASK = 0x00ff,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern int personality (unsigned long persona);
|
||||||
|
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
|
#endif /* _SYS_PERSONALITY_H_ */
|
Loading…
Reference in New Issue
Block a user