Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/Mk/Scripts/rust-compat11-canary.sh
16462 views
1
#!/bin/sh
2
# MAINTAINER: [email protected]
3
set -eu
4
set -o pipefail
5
6
if [ "${OPSYS}" != FreeBSD ] ; then
7
exit 0
8
fi
9
10
cat <<EOF | ${CC} -o "${WRKDIR}/compat11_canary" -xc -
11
#include <sys/syscall.h>
12
#include <errno.h>
13
#include <unistd.h>
14
15
int
16
main(void)
17
{
18
return syscall(SYS_freebsd11_mknod, "", 0, 0) < 0 && errno == ENOSYS;
19
}
20
EOF
21
# Canary might be aborted with SIGSYS
22
ulimit -c 0
23
if ! "${WRKDIR}/compat11_canary"; then
24
echo "=> Sanity check failed: kernel is missing COMPAT_FREEBSD11"
25
echo "=> Aborting build"
26
exit 1
27
fi
28
29