bsd-user: Delete sbrk and sstk system calls.
sbrk and sstk were an experimental system call introduced in 4.2BSD, but with an blank implementation. They remained in subsequent 4BSD releases doing nothing (with 4.3-Reno and later returning not supported). FreeBSD 1.x imported this. They were removed in 2023. Remove them from here because no real, non-contrived program on FreeBSD ever had them. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Warner Losh <imp@bsdimp.com>
Warner Losh committed
Apr 13, 2026 at 08:36 UTC
0683057447ec64e1142cc198f5716b6de899089b
3 files changed
+4
-21
bsd-user/bsd-mem.h
-13
@@ -428,17 +428,4 @@ static inline abi_long do_bsd_vadvise(void)
428
/* See sys_ovadvise() in vm_unix.c */
429
return -TARGET_EINVAL;
430
}
431
-
432
-static inline abi_long do_bsd_sbrk(void)
433
-{
434
- /* see sys_sbrk() in vm_mmap.c */
435
- return -TARGET_EOPNOTSUPP;
436
-}
437
-
438
-static inline abi_long do_bsd_sstk(void)
439
-{
440
- /* see sys_sstk() in vm_mmap.c */
441
- return -TARGET_EOPNOTSUPP;
442
-}
443
-
431
#endif /* BSD_USER_BSD_MEM_H */
bsd-user/freebsd/os-syscall.c
-8
@@ -918,14 +918,6 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
918
ret = do_bsd_vadvise();
919
break;
920
921
- case TARGET_FREEBSD_NR_sbrk:
922
- ret = do_bsd_sbrk();
923
- break;
924
-
925
- case TARGET_FREEBSD_NR_sstk:
926
- ret = do_bsd_sstk();
927
- break;
928
-
921
/*
922
* Misc
923
*/
bsd-user/freebsd/strace.list
+4
@@ -194,7 +194,9 @@
194
{ TARGET_FREEBSD_NR_rfork, "rfork", NULL, NULL, NULL },
195
{ TARGET_FREEBSD_NR_rmdir, "rmdir", NULL, NULL, NULL },
196
{ TARGET_FREEBSD_NR_rtprio_thread, "rtprio_thread", "%s(%d, %d, %p)", NULL, NULL },
197
+#ifdef TARGET_FREEBSD_NR_sbrk
198
{ TARGET_FREEBSD_NR_sbrk, "sbrk", NULL, NULL, NULL },
199
+#endif
200
{ TARGET_FREEBSD_NR_sched_get_priority_max, "sched_get_priority_max", NULL, NULL, NULL },
201
{ TARGET_FREEBSD_NR_sched_get_priority_min, "sched_get_priority_min", NULL, NULL, NULL },
202
{ TARGET_FREEBSD_NR_sched_yield, "sched_yield", NULL, NULL, NULL },
@@ -234,7 +236,9 @@
236
{ TARGET_FREEBSD_NR_sigsuspend, "sigsuspend", NULL, NULL, NULL },
237
{ TARGET_FREEBSD_NR_socket, "socket", "%s(%d,%d,%d)", NULL, NULL },
238
{ TARGET_FREEBSD_NR_socketpair, "socketpair", NULL, NULL, NULL },
239
+#ifdef TARGET_FREEBSD_NR_sstk
240
{ TARGET_FREEBSD_NR_sstk, "sstk", NULL, NULL, NULL },
241
+#endif
242
{ TARGET_FREEBSD_NR_freebsd11_stat, "freebsd11_stat", "%s(\"%s\",%p)", NULL, NULL },
243
{ TARGET_FREEBSD_NR_freebsd11_statfs, "freebsd11_statfs", "%s(\"%s\",%p)", NULL, NULL },
244
{ TARGET_FREEBSD_NR_symlink, "symlink", "%s(\"%s\",\"%s\")", NULL, NULL },