aboutsummaryrefslogtreecommitdiff
path: root/tests/nixos/io_uring/package.nix
blob: 8f980183af289d8c9d180b2df867acfe237945f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ runCommandCC }:
runCommandCC "io_uring-is-blocked" { } ''
  cat > test.c <<EOF
  #include <errno.h>
  #include <sys/syscall.h>
  #include <unistd.h>

  int main() {
      int res = syscall(SYS_io_uring_setup, 0, NULL);
      return res == -1 && errno == ENOSYS ? 0 : 1;
  }
  EOF
  "$CC" -o test test.c
  if ! ./test; then
    echo "Oh no! io_uring is available!"
    exit 1
  fi
  touch "$out"
''