From 1be15cb14a9e03147190a9565461b7bf4ebdba35 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 2 Jul 2013 23:54:59 +0800 Subject: [PATCH] AcessNative - Updated syscall names --- AcessNative/ld-acess_src/exports.c | 15 ++++++++++++--- AcessNative/syscalls_list.h | 4 +++- Usermode/Libraries/Makefile.cfg | 6 +++--- .../include_exp/acess/_native_syscallmod.h | 8 +++++--- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/AcessNative/ld-acess_src/exports.c b/AcessNative/ld-acess_src/exports.c index 756febaf..d71476d5 100644 --- a/AcessNative/ld-acess_src/exports.c +++ b/AcessNative/ld-acess_src/exports.c @@ -71,6 +71,14 @@ int acess__SysReopen(int FD, const char *Path, int Flags) { return _Syscall(SYS_REOPEN, ">i >s >i", FD, Path, Flags); } +int acess__SysCopyFD(int srcfd, int dstfd) { + return _Syscall(SYS_COPYFD, ">i >i", srcfd, dstfd); +} + +int acess__SysFDFlags(int fd, int mask, int newflags) { + return _Syscall(SYS_FDFLAGS, ">i >i >i", fd, mask, newflags); +} + size_t acess__SysRead(int FD, void *Dest, size_t Bytes) { if(FD & NATIVE_FILE_MASK) return native_read(FD & (NATIVE_FILE_MASK-1), Dest, Bytes); @@ -356,8 +364,8 @@ int acess__SysWaitTID(int TID, int *ExitStatus) int acess_setuid(int ID) { return _Syscall(SYS_SETUID, ">i", ID); } int acess_setgid(int ID) { return _Syscall(SYS_SETGID, ">i", ID); } int acess_gettid(void) { return _Syscall(SYS_GETTID, ""); } -int acess_getpid(void) { return _Syscall(SYS_GETPID, ""); } -int acess_getuid(void) { return _Syscall(SYS_GETUID, ""); } +int acess__SysGetPID(void) { return _Syscall(SYS_GETPID, ""); } +int acess__SysGetUID(void) { return _Syscall(SYS_GETUID, ""); } int acess_getgid(void) { return _Syscall(SYS_GETGID, ""); } int acess__SysSendMessage(int DestTID, int Length, void *Data) @@ -439,9 +447,10 @@ const tSym caBuiltinSymbols[] = { DEFSYM(_SysWaitTID), DEFSYM(gettid), + DEFSYM(_SysGetPID), DEFSYM(setuid), DEFSYM(setgid), - DEFSYM(getuid), + DEFSYM(_SysGetUID), DEFSYM(getgid), DEFSYM(_SysSendMessage), diff --git a/AcessNative/syscalls_list.h b/AcessNative/syscalls_list.h index 9ab9098c..209380bb 100644 --- a/AcessNative/syscalls_list.h +++ b/AcessNative/syscalls_list.h @@ -4,6 +4,9 @@ _(SYS_EXIT), _(SYS_OPEN), _(SYS_CLOSE), +_(SYS_REOPEN), +_(SYS_COPYFD), +_(SYS_FDFLAGS), _(SYS_READ), _(SYS_WRITE), _(SYS_SEEK), @@ -14,7 +17,6 @@ _(SYS_READDIR), _(SYS_OPENCHILD), _(SYS_GETACL), _(SYS_MOUNT), -_(SYS_REOPEN), _(SYS_CHDIR), _(SYS_WAITTID), diff --git a/Usermode/Libraries/Makefile.cfg b/Usermode/Libraries/Makefile.cfg index 330f55b6..4bb2c997 100644 --- a/Usermode/Libraries/Makefile.cfg +++ b/Usermode/Libraries/Makefile.cfg @@ -16,9 +16,9 @@ ifeq ($(ARCHDIR),native) CFLAGS += -fPIC endif else -CPPFLAGS := -ffreestanding -CFLAGS := -fno-stack-protector -fPIC -LDFLAGS := -I/Acess/Libs/ld-acess.so -lld-acess `$(CC) -print-libgcc-file-name` + CPPFLAGS := -ffreestanding + CFLAGS := -fno-stack-protector -fPIC + LDFLAGS := -I/Acess/Libs/ld-acess.so -lld-acess `$(CC) -print-libgcc-file-name` endif LDFLAGS += -g -nostdlib -shared -eSoMain -x --no-undefined -L$(OUTPUTDIR)Libs/ diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h index c368a290..a12d9645 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/_native_syscallmod.h @@ -5,9 +5,9 @@ #define _SysWaitEvent acess__SysWaitEvent #define _SysWaitTID acess__SysWaitTID #define gettid acess_gettid -#define getpid acess_getpid -#define getuid acess_getuid -#define getgid acess_getgid +#define _SysGetPID acess__SysGetPID +#define _SysGetUID acess__SysGetUID +#define _SysGetGID acess__SysGetGID #define setuid acess_setuid #define setgid acess_setgid #define _SysSetName acess__SysSetName @@ -28,6 +28,8 @@ #define _SysOpen acess__SysOpen #define _SysOpenChild acess__SysOpenChild #define _SysReopen acess__SysReopen +#define _SysCopyFD acess__SysCopyFD +#define _SysFDFlags acess__SysFDFlags #define _SysClose acess__SysClose #define _SysRead acess__SysRead #define _SysWrite acess__SysWrite -- 2.20.1