blob: df26a50388f198dd8451ab1e3e38314ebb6869b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -377,6 +377,15 @@ static abi_long do_freebsd_sysctl(abi_ul
*q++ = tswap32(*p);
oidfmt(snamep, namelen, NULL, &kind);
/* XXX swap hnewp */
+#if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 32
+ /* XXX there may be more sysctls that differ */
+ if (namelen == 2 &&
+ snamep[0] == CTL_KERN && snamep[1] == KERN_USRSTACK &&
+ holdlen && holdlen == 4 && hnewp == NULL) {
+ (*(uint32_t *)holdp) = 0xfffff000U;
+ ret = 0;
+ } else
+#endif
ret = get_errno(sysctl(snamep, namelen, holdp, &holdlen, hnewp, newlen));
if (!ret)
sysctl_oldcvt(holdp, holdlen, kind);
|