[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 23/23] bsd-user: Add stubs for vadvise(), sbrk() and sstk()
From: |
Karim Taha |
Subject: |
[PATCH v6 23/23] bsd-user: Add stubs for vadvise(), sbrk() and sstk() |
Date: |
Mon, 25 Sep 2023 21:27:09 +0300 |
From: Warner Losh <imp@bsdimp.com>
The above system calls are not supported by qemu.
Signed-off-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/bsd-mem.h | 18 ++++++++++++++++++
bsd-user/freebsd/os-syscall.c | 12 ++++++++++++
2 files changed, 30 insertions(+)
diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
index c512a4e375..c3e72e3b86 100644
--- a/bsd-user/bsd-mem.h
+++ b/bsd-user/bsd-mem.h
@@ -431,4 +431,22 @@ static inline abi_long do_bsd_shmdt(abi_ulong shmaddr)
return ret;
}
+static inline abi_long do_bsd_vadvise(void)
+{
+ /* See sys_ovadvise() in vm_unix.c */
+ return -TARGET_EINVAL;
+}
+
+static inline abi_long do_bsd_sbrk(void)
+{
+ /* see sys_sbrk() in vm_mmap.c */
+ return -TARGET_EOPNOTSUPP;
+}
+
+static inline abi_long do_bsd_sstk(void)
+{
+ /* see sys_sstk() in vm_mmap.c */
+ return -TARGET_EOPNOTSUPP;
+}
+
#endif /* BSD_USER_BSD_MEM_H */
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index 6b32d4df68..ce2a6bc29e 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -675,6 +675,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num,
abi_long arg1,
ret = do_bsd_shmdt(arg1);
break;
+ case TARGET_FREEBSD_NR_freebsd11_vadvise:
+ ret = do_bsd_vadvise();
+ break;
+
+ case TARGET_FREEBSD_NR_sbrk:
+ ret = do_bsd_sbrk();
+ break;
+
+ case TARGET_FREEBSD_NR_sstk:
+ ret = do_bsd_sstk();
+ break;
+
/*
* Misc
*/
--
2.42.0
- [PATCH v6 14/23] bsd-user: Implement msync(2), (continued)
- [PATCH v6 14/23] bsd-user: Implement msync(2), Karim Taha, 2023/09/25
- [PATCH v6 13/23] bsd-user: Implement mprotect(2), Karim Taha, 2023/09/25
- [PATCH v6 15/23] bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2), minherit(2), Karim Taha, 2023/09/25
- [PATCH v6 16/23] bsd-user: Implment madvise(2) to match the linux-user implementation., Karim Taha, 2023/09/25
- [PATCH v6 18/23] bsd-user: Implement do_obreak function, Karim Taha, 2023/09/25
- [PATCH v6 21/23] bsd-user: Implement shmctl(2), Karim Taha, 2023/09/25
- [PATCH v6 19/23] bsd-user: Implement shm_open(2), Karim Taha, 2023/09/25
- [PATCH v6 22/23] bsd-user: Implement shmat(2) and shmdt(2), Karim Taha, 2023/09/25
- [PATCH v6 17/23] bsd-user: Implement mincore(2), Karim Taha, 2023/09/25
- [PATCH v6 20/23] bsd-user: Implement shm_unlink(2) and shmget(2), Karim Taha, 2023/09/25
- [PATCH v6 23/23] bsd-user: Add stubs for vadvise(), sbrk() and sstk(),
Karim Taha <=
- Re: [PATCH v6 00/23] bsd-user: Implement mmap related system calls for FreeBSD., Warner Losh, 2023/09/27