shell can launch another user processgit add .git add .!

This commit is contained in:
2026-07-12 20:13:13 -05:00
parent e2ab130324
commit 5c7febbbf0
15 changed files with 403 additions and 220 deletions

View File

@@ -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

View File

@@ -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);
}