From 231089340e303776fa3b356ac39e24bcadd6981b Mon Sep 17 00:00:00 2001 From: lhw2002426 <1466397747@qq.com> Date: Tue, 19 Dec 2023 22:30:47 +0800 Subject: [PATCH] merge ruxos dev --- ulib/ruxlibc/c/pwd.c | 28 ++++++++++++++++++++++++++++ ulib/ruxlibc/c/resource.c | 5 +++++ ulib/ruxmusl/src/syscall/mod.rs | 7 +++++++ 3 files changed, 40 insertions(+) diff --git a/ulib/ruxlibc/c/pwd.c b/ulib/ruxlibc/c/pwd.c index 466974594..09c94af28 100644 --- a/ulib/ruxlibc/c/pwd.c +++ b/ulib/ruxlibc/c/pwd.c @@ -13,6 +13,7 @@ #include #include #include +#include static struct passwd pw__ = { .pw_name = RUX_DEFAULT_USER, @@ -29,6 +30,12 @@ int getpwnam_r(const char *name, struct passwd *pw, char *buf, size_t size, stru unimplemented(); return 0; } +// TODO +int sem_destroy(sem_t *sem) +{ + unimplemented(); + return 0; +} int getpwuid_r(uid_t uid, struct passwd *pw, char *buf, size_t size, struct passwd **res) { @@ -36,6 +43,13 @@ int getpwuid_r(uid_t uid, struct passwd *pw, char *buf, size_t size, struct pass return 0; } +// TODO +int sem_init(sem_t *sem, int pshared, unsigned int value) +{ + unimplemented(); + return 0; +} + struct passwd *getpwnam(const char *name) { struct passwd *pwd; @@ -49,3 +63,17 @@ struct passwd *getpwnam(const char *name) return pwd; } + +// TODO +int sem_post(sem_t *sem) +{ + unimplemented(); + return 0; +} + +// TODO +int sem_wait(sem_t *sem) +{ + unimplemented(); + return 0; +} diff --git a/ulib/ruxlibc/c/resource.c b/ulib/ruxlibc/c/resource.c index e46041a8e..4ed6955fe 100644 --- a/ulib/ruxlibc/c/resource.c +++ b/ulib/ruxlibc/c/resource.c @@ -24,3 +24,8 @@ int setpriority(int which, id_t who, int prio) unimplemented(); return 0; } + +ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count){ + unimplemented(); + return 0; +} diff --git a/ulib/ruxmusl/src/syscall/mod.rs b/ulib/ruxmusl/src/syscall/mod.rs index 4b3748ce2..3222b654c 100644 --- a/ulib/ruxmusl/src/syscall/mod.rs +++ b/ulib/ruxmusl/src/syscall/mod.rs @@ -57,6 +57,7 @@ pub fn syscall(syscall_id: SyscallId, args: [usize; 6]) -> isize { args[2] as c_int, ) as _, #[cfg(feature = "fs")] +<<<<<<< HEAD SyscallId::FCHOWNAT => ruxos_posix_api::sys_fchownat( args[0] as c_int, args[1] as *const core::ffi::c_char, @@ -65,6 +66,8 @@ pub fn syscall(syscall_id: SyscallId, args: [usize; 6]) -> isize { args[4] as c_int, ) as _, #[cfg(feature = "fs")] +======= +>>>>>>> upstream/dev SyscallId::RENAMEAT => ruxos_posix_api::sys_renameat( args[0] as c_int, args[1] as *const core::ffi::c_char, @@ -201,7 +204,11 @@ pub fn syscall(syscall_id: SyscallId, args: [usize; 6]) -> isize { SyscallId::UMASK => ruxos_posix_api::sys_umask(args[0] as ctypes::mode_t) as _, #[cfg(feature = "multitask")] SyscallId::GETPID => ruxos_posix_api::sys_getpid() as _, +<<<<<<< HEAD SyscallId::GETEUID => ruxos_posix_api::sys_geteuid() as _, +======= + +>>>>>>> upstream/dev SyscallId::SYSINFO => { ruxos_posix_api::sys_sysinfo(args[0] as *mut ctypes::sysinfo) as _ }