Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177775540
D60358.1795258723.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60358.1795258723.diff
View Options
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_dir.c b/contrib/netbsd-tests/lib/libc/gen/t_dir.c
--- a/contrib/netbsd-tests/lib/libc/gen/t_dir.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_dir.c
@@ -38,7 +38,14 @@
#include <string.h>
#include <unistd.h>
-
+/*
+ * sbrk is obsolete, and libc only provides it on a subset of
+ * architectures.
+ */
+#if defined(__amd64__) || defined(__arm__) || defined(__i386__) || \
+ defined(__powerpc__)
+#define HAVE_SBRK
+#endif
ATF_TC(seekdir_basic);
ATF_TC_HEAD(seekdir_basic, tc)
@@ -134,8 +141,7 @@
free(wasname);
}
-/* There is no sbrk on AArch64 and RISC-V */
-#if !defined(__aarch64__) && !defined(__riscv)
+#ifdef HAVE_SBRK
ATF_TC(telldir_leak);
ATF_TC_HEAD(telldir_leak, tc)
{
@@ -185,7 +191,7 @@
{
ATF_TP_ADD_TC(tp, seekdir_basic);
-#if !defined(__aarch64__) && !defined(__riscv)
+#ifdef HAVE_SBRK
ATF_TP_ADD_TC(tp, telldir_leak);
#endif
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mlock.c b/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
--- a/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
@@ -46,6 +46,15 @@
#include <stdlib.h>
#include <unistd.h>
+/*
+ * sbrk is obsolete, and libc only provides it on a subset of
+ * architectures.
+ */
+#if defined(__amd64__) || defined(__arm__) || defined(__i386__) || \
+ defined(__powerpc__)
+#define HAVE_SBRK
+#endif
+
#ifdef __FreeBSD__
#include <limits.h>
#define _KMEMUSER
@@ -103,7 +112,7 @@
unsigned long vmin = 0;
size_t len = sizeof(vmin);
#endif
-#if !defined(__aarch64__) && !defined(__riscv)
+#ifdef HAVE_SBRK
void *invalid_ptr;
#endif
void *buf;
@@ -159,8 +168,7 @@
#endif
(void)free(buf);
-/* There is no sbrk on AArch64 and RISC-V */
-#if !defined(__aarch64__) && !defined(__riscv)
+#ifdef HAVE_SBRK
/*
* Try to create a pointer to an unmapped page - first after current
* brk will likely do.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 10:58 AM (6 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41887729
Default Alt Text
D60358.1795258723.diff (1 KB)
Attached To
Mode
D60358: tests/libc: use an allowlist for sbrk in NetBSD-derived tests
Attached
Detach File
Event Timeline