shell can launch another user processgit add .git add .!
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
#define SYS_FORK 21
|
||||
#define SYS_EXEC 22
|
||||
#define SYS_DUP2 23
|
||||
#define SYS_LSEEK 24
|
||||
#define SYS_LSEEK 24
|
||||
#define SYS_WAIT 25
|
||||
|
||||
int open(const char* path);
|
||||
int write(int fd, const void *buf, size_t count);
|
||||
@@ -32,5 +33,6 @@ int pty(int* slave);
|
||||
int fork();
|
||||
int exec(const char* path);
|
||||
int dup2(int src, int dst);
|
||||
int waitpid(int pid, int* status);
|
||||
|
||||
#endif
|
||||
@@ -61,4 +61,8 @@ int exec(const char* path) {
|
||||
|
||||
int dup2(int src, int dst) {
|
||||
return syscall3(SYS_DUP2, src, dst, 0);
|
||||
}
|
||||
|
||||
int waitpid(int pid, int* status) {
|
||||
return syscall3(SYS_WAIT, pid, (uint32_t)status, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user