Try to set the stack limit.
auxv->u.a_val = VG_(get_usrstack)();
break;
case AT_USRSTACKLIM:
- auxv->a_type = AT_IGNORE;
+ auxv->u.a_val = VG_(get_usrstacklim)();
break;
#endif
#endif
-
+#if defined(VGO_freebsd)
Word VG_(get_usrstack)(void)
{
return VG_PGROUNDDN(the_iicii.clstack_end) + VKI_PAGE_SIZE;
}
+Word VG_(get_usrstacklim)(void)
+{
+ return the_iifii.clstack_max_size;
+}
+#endif
+
/*--------------------------------------------------------------------*/
/*
* Special handling cases
*
- * 1. kern.userstack
+ * 1. kern.usrstack
* This sysctl returns the address of the bottom of the user stack
* (that is the highest user stack address, since the stack grows
* downwards). Without any special handling this would return the
*/
if (SARG2 >= 2 && ML_(safe_to_deref)(name, 2*sizeof(int))) {
if (name[0] == 1 && name[1] == 33) {
- // kern.userstack
+ // kern.usrstack
sysctl_kern_usrstack((SizeT*)ARG3, (SizeT*)ARG4);
SET_STATUS_Success(0);
}
UInt *prot);
#endif
+#if defined(VGO_freebsd)
/* For kern.usrstack syscall on FreeBSD */
extern Word VG_(get_usrstack)(void);
-
+extern Word VG_(get_usrstacklim)(void);
+#endif
#endif // __PUB_CORE_ASPACEMGR_H
{"AT_HWCAP", 25},
{"AT_HWCAP2", 26},
// FreeBSD 12 and 11
-// {"AT_COUNT", 27},
+// {"AT_COUNT", 27},
#if (FREEBSD_VERS >= FREEBSD_13_0)
{"AT_BSDFLAGS", 27},
{"AT_ARGC", 28},
{"AT_ENVC", 30},
{"AT_ENVV", 31},
{"AT_PS_STRINGS", 32},
-// {"AT_COUNT", 33},
+// {"AT_COUNT", 33},
#endif
#if (FREEBSD_VERS >= FREEBSD_13_1)
{"AT_FXRNG", 33},
{"AT_KPRELOAD", 34},
-
-// {"AT_COUNT", 35},
+// {"AT_COUNT", 35},
+#endif
+#if (FREEBSD_VERS >= FREEBSD_14)
+ {"AT_USRSTACKBASE", 35},
+ {"AT_USRSTACKLIM", 36),
+// {"AT_COUNT", 37},
#endif
};