sysdeps/lemon: pipe, fork, get(e)gid
This commit is contained in:
parent
684a29fff2
commit
2f76d0b455
|
@ -348,5 +348,9 @@ namespace mlibc{
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sys_pipe(int *fds, int flags){
|
||||
return -syscall(SYS_PIPE, fds, flags);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -73,6 +73,10 @@ namespace mlibc{
|
|||
return pid;
|
||||
}
|
||||
|
||||
pid_t sys_getppid(){
|
||||
return syscall(SYS_GETPPID);
|
||||
}
|
||||
|
||||
int sys_clock_get(int clock, time_t *secs, long *nanos) {
|
||||
uint64_t _secs, _millis;
|
||||
syscall(SYS_UPTIME, (uintptr_t)&_secs, (uintptr_t)&_millis);
|
||||
|
@ -113,13 +117,11 @@ namespace mlibc{
|
|||
}
|
||||
|
||||
gid_t sys_getgid(){
|
||||
mlibc::infoLogger() << "mlibc: sys_getgid is a stub" << frg::endlog;
|
||||
return 0;
|
||||
return syscall(SYS_GETGID);
|
||||
}
|
||||
|
||||
gid_t sys_getegid(){
|
||||
mlibc::infoLogger() << "mlibc: sys_getegid is a stub" << frg::endlog;
|
||||
return 0;
|
||||
return syscall(SYS_GETEGID);
|
||||
}
|
||||
|
||||
int sys_setgid(gid_t gid){
|
||||
|
@ -164,5 +166,20 @@ namespace mlibc{
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sys_fork(pid_t *child){
|
||||
long pid = syscall(SYS_FORK, 0);
|
||||
if(pid < 0){
|
||||
errno = pid;
|
||||
return -1;
|
||||
}
|
||||
|
||||
*child = pid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sys_execve(const char *path, char *const argv[], char *const envp[]){
|
||||
return -syscall(SYS_EXECVE, path, argv, envp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#define SYS_CREATE 8
|
||||
#define SYS_LINK 9
|
||||
#define SYS_UNLINK 10
|
||||
#define SYS_EXECVE 11
|
||||
#define SYS_CHDIR 12
|
||||
#define SYS_TIME 13
|
||||
#define SYS_MAP_FB 14
|
||||
|
@ -92,6 +93,11 @@
|
|||
#define SYS_INTERRUPT_THREAD 90
|
||||
#define SYS_LOAD_KERNEL_MODULE 91
|
||||
#define SYS_UNLOAD_KERNEL_MODULE 92
|
||||
#define SYS_FORK 93
|
||||
#define SYS_GETGID 94
|
||||
#define SYS_GETEGID 95
|
||||
#define SYS_GETPPID 96
|
||||
#define SYS_PIPE 97
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
|
|
Loading…
Reference in a new issue