Skip to content

util: Fix linux build failure when SYS_kcmp isn't publicly accessible

Chuck Atkins requested to merge chuckatkins/mesa:fix-linux-without-kcmp into main

This comes up specifically on older RHEL6 systems, which are still relatively common in HPC.

See https://github.com/spack/spack/issues/31866 :

     253    ../src/util/os_file.c: In function 'os_same_file_description':
  >> 254    ../src/util/os_file.c:211:19: error: 'SYS_kcmp' undeclared (first use in this function)
     255      211 |    return syscall(SYS_kcmp, pid, pid, KCMP_FILE, fd1, fd2);
     256          |                   ^~~~~~~~
     257    ../src/util/os_file.c:211:19: note: each undeclared identifier is reported only once for each function it appears in
  >> 258    ../src/util/os_file.c:212:1: error: control reaches end of non-void function [-Werror=return-type]
     259      212 | }
     260          | ^
     261    cc1: some warnings being treated as errors
Edited by Chuck Atkins

Merge request reports