diff options
Diffstat (limited to 'src/regress/lib/libc/sys/macros.h')
| -rw-r--r-- | src/regress/lib/libc/sys/macros.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/regress/lib/libc/sys/macros.h b/src/regress/lib/libc/sys/macros.h new file mode 100644 index 0000000000..932f230c03 --- /dev/null +++ b/src/regress/lib/libc/sys/macros.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* $OpenBSD: macros.h,v 1.1.1.1 2019/11/19 19:57:03 bluhm Exp $ */ | ||
| 2 | /* Public domain - Moritz Buhl */ | ||
| 3 | |||
| 4 | #include <sys/param.h> | ||
| 5 | #include <sys/socket.h> | ||
| 6 | #include <sys/stdint.h> | ||
| 7 | #include <sys/sysctl.h> | ||
| 8 | #include <sys/types.h> | ||
| 9 | |||
| 10 | #include <stdbool.h> | ||
| 11 | #include <string.h> | ||
| 12 | |||
| 13 | #define __RCSID(str) | ||
| 14 | #define __COPYRIGHT(str) | ||
| 15 | |||
| 16 | #define __arraycount(_a) nitems(_a) | ||
| 17 | #define __unreachable() atf_tc_fail("unreachable") | ||
| 18 | #define __UNCONST(a) (a) | ||
| 19 | |||
| 20 | /* t_chroot.c */ | ||
| 21 | #define fchroot(fd) 0 | ||
| 22 | |||
| 23 | /* t_clock_gettime.c */ | ||
| 24 | int sysctlbyname(char *, void *, size_t *, void *, size_t); | ||
| 25 | |||
| 26 | int | ||
| 27 | sysctlbyname(char* s, void *oldp, size_t *oldlenp, void *newp, size_t newlen) | ||
| 28 | { | ||
| 29 | int ktc; | ||
| 30 | if (strcmp(s, "kern.timecounter.hardware") == 0) | ||
| 31 | ktc = KERN_TIMECOUNTER_HARDWARE; | ||
| 32 | else if (strcmp(s, "kern.timecounter.choice") == 0) | ||
| 33 | ktc = KERN_TIMECOUNTER_CHOICE; | ||
| 34 | |||
| 35 | int mib[3]; | ||
| 36 | mib[0] = CTL_KERN; | ||
| 37 | mib[1] = KERN_TIMECOUNTER; | ||
| 38 | mib[2] = ktc; | ||
| 39 | return sysctl(mib, 3, oldp, oldlenp, newp, newlen); | ||
| 40 | } | ||
| 41 | |||
| 42 | /* t_mlock.c */ | ||
| 43 | #define MAP_WIRED __MAP_NOREPLACE | ||
| 44 | |||
| 45 | /* t_pipe2.c */ | ||
| 46 | #define O_NOSIGPIPE 0 | ||
| 47 | |||
| 48 | /* t_poll.c */ | ||
| 49 | #define pollts(a, b, c, e) 0 | ||
| 50 | |||
| 51 | /* t_sendrecv.c */ | ||
| 52 | #define SO_RERROR SO_DEBUG | ||
| 53 | |||
| 54 | /* t_write.c */ | ||
| 55 | #define _PATH_DEVZERO "/dev/zero" | ||
