From: Warner Losh <imp@bsdimp.com>
To: qemu-devel@nongnu.org
Cc: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Subject: [PULL 03/25] bsd-user: Delete sbrk and sstk system calls.
Date: Wed, 6 May 2026 20:28:05 -0600 [thread overview]
Message-ID: <20260507022827.44499-4-imp@bsdimp.com> (raw)
In-Reply-To: <20260507022827.44499-1-imp@bsdimp.com>
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>
---
bsd-user/bsd-mem.h | 13 -------------
bsd-user/freebsd/os-syscall.c | 8 --------
bsd-user/freebsd/strace.list | 4 ++++
3 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
index 8c0b0b6919..9d7b60d3c3 100644
--- a/bsd-user/bsd-mem.h
+++ b/bsd-user/bsd-mem.h
@@ -428,17 +428,4 @@ 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 85e5db19a3..ca819fc530 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -918,14 +918,6 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
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
*/
diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list
index 275d2dbe27..d7f61f480e 100644
--- a/bsd-user/freebsd/strace.list
+++ b/bsd-user/freebsd/strace.list
@@ -194,7 +194,9 @@
{ TARGET_FREEBSD_NR_rfork, "rfork", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_rmdir, "rmdir", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_rtprio_thread, "rtprio_thread", "%s(%d, %d, %p)", NULL, NULL },
+#ifdef TARGET_FREEBSD_NR_sbrk
{ TARGET_FREEBSD_NR_sbrk, "sbrk", NULL, NULL, NULL },
+#endif
{ TARGET_FREEBSD_NR_sched_get_priority_max, "sched_get_priority_max", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_sched_get_priority_min, "sched_get_priority_min", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_sched_yield, "sched_yield", NULL, NULL, NULL },
@@ -234,7 +236,9 @@
{ TARGET_FREEBSD_NR_sigsuspend, "sigsuspend", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_socket, "socket", "%s(%d,%d,%d)", NULL, NULL },
{ TARGET_FREEBSD_NR_socketpair, "socketpair", NULL, NULL, NULL },
+#ifdef TARGET_FREEBSD_NR_sstk
{ TARGET_FREEBSD_NR_sstk, "sstk", NULL, NULL, NULL },
+#endif
{ TARGET_FREEBSD_NR_freebsd11_stat, "freebsd11_stat", "%s(\"%s\",%p)", NULL, NULL },
{ TARGET_FREEBSD_NR_freebsd11_statfs, "freebsd11_statfs", "%s(\"%s\",%p)", NULL, NULL },
{ TARGET_FREEBSD_NR_symlink, "symlink", "%s(\"%s\",\"%s\")", NULL, NULL },
--
2.52.0
next prev parent reply other threads:[~2026-05-07 2:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 2:28 [PULL 00/25] Bsd user 2026 05 patches Warner Losh
2026-05-07 2:28 ` [PULL 01/25] bsd-user: Switch to SPDX-License-Expression Warner Losh
2026-05-07 2:28 ` [PULL 02/25] bsd-user: Add syscall header generator for FreeBSD Warner Losh
2026-05-07 2:28 ` Warner Losh [this message]
2026-05-07 2:28 ` [PULL 04/25] bsd-user: Create os-syscall.h Warner Losh
2026-05-07 2:28 ` [PULL 05/25] bsd-user: Switch to generated syscall_nr.h Warner Losh
2026-05-07 2:28 ` [PULL 06/25] bsd-user: Copy linux-user/thunk.c to bsd-user Warner Losh
2026-05-07 2:28 ` [PULL 07/25] bsd-user: ioctl: add common definitions Warner Losh
2026-05-07 2:28 ` [PULL 08/25] bsd-user: Add FreeBSD tty ioctl definitions Warner Losh
2026-05-07 2:28 ` [PULL 09/25] bsd-user: Add FreeBSD file I/O " Warner Losh
2026-05-07 2:28 ` [PULL 10/25] bsd-user: Add FreeBSD socket " Warner Losh
2026-05-07 2:28 ` [PULL 11/25] bsd-user: Add FreeBSD cryptodev " Warner Losh
2026-05-07 2:28 ` [PULL 12/25] bsd-user: Add FreeBSD disk " Warner Losh
2026-05-07 2:28 ` [PULL 13/25] bsd-user: Add FreeBSD IPv6 " Warner Losh
2026-05-07 2:28 ` [PULL 14/25] bsd-user: Add FreeBSD ioctl type definitions Warner Losh
2026-05-07 2:28 ` [PULL 15/25] bsd-user: Add FreeBSD ioctl command table Warner Losh
2026-05-07 2:28 ` [PULL 16/25] bsd-user: Add bsd-ioctl.h header Warner Losh
2026-05-07 2:28 ` [PULL 17/25] bsd-user: Add target_sockaddr and safe_ioctl to syscall_defs.h Warner Losh
2026-05-07 2:28 ` [PULL 18/25] bsd-user: Add bsd-ioctl.c infrastructure and termios conversion Warner Losh
2026-05-07 2:28 ` [PULL 19/25] bsd-user: Add log_unsupported_ioctl function Warner Losh
2026-05-07 2:28 ` [PULL 20/25] bsd-user: Add do_ioctl_unsupported function Warner Losh
2026-05-07 2:28 ` [PULL 21/25] bsd-user: Add target_to_host_sockaddr_in6 function Warner Losh
2026-05-07 2:28 ` [PULL 22/25] bsd-user: Add do_ioctl_in6_ifreq_sockaddr_int function Warner Losh
2026-05-07 2:28 ` [PULL 23/25] bsd-user: Add do_bsd_ioctl main function Warner Losh
2026-05-07 2:28 ` [PULL 24/25] bsd-user: Add init_bsd_ioctl function Warner Losh
2026-05-07 2:28 ` [PULL 25/25] bsd-user: Add call to do_bsd_ioctl and add bsd-ioctl.c to the build Warner Losh
2026-05-11 14:21 ` [PULL 00/25] Bsd user 2026 05 patches Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260507022827.44499-4-imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=kevans@freebsd.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox