From: John Hodge Date: Thu, 11 Oct 2012 10:02:42 +0000 (+0800) Subject: Usermode - Updated SysSpawn to have a permissions argument X-Git-Tag: rel0.15~683 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a865a452ce6741f0bf56fceb69c36c9105c7216f;p=tpg%2Facess2.git Usermode - Updated SysSpawn to have a permissions argument --- diff --git a/Usermode/Applications/axwin3_src/Interface/main.c b/Usermode/Applications/axwin3_src/Interface/main.c index 5a8fe08e..8695d49b 100644 --- a/Usermode/Applications/axwin3_src/Interface/main.c +++ b/Usermode/Applications/axwin3_src/Interface/main.c @@ -20,6 +20,8 @@ void create_sidebar(void); void create_mainmenu(void); void create_run_dialog(void); void mainmenu_run_dialog(void *unused); +void mainmenu_app_terminal(void *unused); +void mainmenu_app_textedit(void *unused); // === GLOBALS === tHWND gSidebar; @@ -29,6 +31,7 @@ tHWND gRunDialog; tAxWin3_Widget *gRunInput; int giScreenWidth; int giScreenHeight; +char **gEnvion; // === CODE === int systembutton_fire(tAxWin3_Widget *Widget) @@ -38,8 +41,9 @@ int systembutton_fire(tAxWin3_Widget *Widget) return 0; } -int main(int argc, char *argv[]) +int main(int argc, char *argv[], char **envp) { + gEnvion = envp; // Connect to AxWin3 Server AxWin3_Connect(NULL); @@ -107,8 +111,9 @@ void create_sidebar(void) void mainmenu_app_textedit(void *unused) { - _SysDebug("TODO: Launch text editor"); -// spawn("/Acess/Apps/AxWin/3.0/ate"); + const char *args[] = {"ate",NULL}; +// _SysDebug("TODO: Launch text editor"); + _SysSpawn("/Acess/Apps/AxWin/3.0/ate", args, (const char **)gEnvion, 0, NULL); } void mainmenu_app_terminal(void *unused) diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/sys.h b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/sys.h index 2452972d..5505479d 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/acess/sys.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/acess/sys.h @@ -49,7 +49,7 @@ extern int _SysWaitEvent(int EventMask); extern int waittid(int id, int *status); extern int clone(int flags, void *stack); extern int execve(char *path, char **argv, char **envp); -extern int _SysSpawn(const char *Path, const char **argv, const char **envp, int nFDs, int *FDs); +extern int _SysSpawn(const char *Path, const char **argv, const char **envp, int nFDs, int *FDs, struct s_sys_spawninfo *info); extern int gettid(void); extern int getpid(void); extern int _SysSetFaultHandler(int (*Handler)(int)); diff --git a/Usermode/Libraries/ld-acess.so_src/include_exp/sys/types.h b/Usermode/Libraries/ld-acess.so_src/include_exp/sys/types.h index 7c584d20..78cf0351 100644 --- a/Usermode/Libraries/ld-acess.so_src/include_exp/sys/types.h +++ b/Usermode/Libraries/ld-acess.so_src/include_exp/sys/types.h @@ -50,6 +50,13 @@ struct s_sysFInfo { typedef struct s_sysFInfo t_sysFInfo; typedef struct s_sysACL t_sysACL; +struct s_sys_spawninfo +{ + unsigned int flags; + unsigned int uid; + unsigned int gid; +}; + extern void FD_ZERO(fd_set *fdsetp); extern void FD_CLR(int fd, fd_set *fdsetp); extern void FD_SET(int fd, fd_set *fdsetp);