+++ /dev/null
-# $OpenBSD: Makefile,v 1.3 2021/09/28 08:51:17 kettenis Exp $
-
-# The regression test binary must be run on a wxallowed filesystem
-# to verify correct behaviour (it should crash)
-
-.if ! (make(clean) || make(cleandir) || make(obj))
-
-MOUNT_OBJ !!= mount | grep ^$$(df -P . | tail -1 | awk '{ print $$1 }')
-
-.if "${MOUNT_OBJ:M*wxallowed*}" == ""
-regress:
- echo '${MOUNT_OBJ}'
- echo object directory needs mount option wxallowed
- echo SKIPPED
-.endif
-
-.endif
-
-PROG= wx_syscall
-LDFLAGS= -Wl,-z,wxneeded
-
-run-regress-wx_syscall: wx_syscall
- ! ./wx_syscall
-
-.include <bsd.regress.mk>
+++ /dev/null
-#include <sys/types.h>
-#include <sys/mman.h>
-
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int
-main()
-{
- vaddr_t o = (vaddr_t)flock;
- int psz = getpagesize();
-
- printf("%llx\n", (long long)flock);
- if (mprotect((void *)(o & ~(psz - 1)), psz,
- PROT_EXEC|PROT_WRITE|PROT_READ) == -1) {
- if (errno == ENOTSUP) {
- printf("mprotect -> ENOTSUP? Please run from "
- "wxallowed filesystem\n");
- } else {
- warn("mprotect");
- }
- exit(0);
- }
- flock(0, 0);
-
- printf("performing syscall succeeded. Should have been killed.\n");
-}