2 # Copyright © 2023 Guillem Jover <guillem@debian.org>
4 # DPKG_CHECK_HEADER_SYS_PROCFS
5 # ----------------------------
6 # Check for the <sys/procfs.h> header.
7 AC_DEFUN([DPKG_CHECK_HEADER_SYS_PROCFS], [
8 # On at least Solaris <= 11.3 we cannot use the new structured procfs API
9 # while also using LFS, so we need to check whether including <sys/procfs.h>
10 # is usable, and otherwise undefine _FILE_OFFSET_BITS, but only for the
11 # code using this (that is s-s-d).
12 dpkg_structured_procfs_supports_lfs=1
13 AC_CHECK_HEADERS([sys/procfs.h], [], [
14 # We need to reset the cached value, otherwise we will not be able to
16 AS_UNSET([ac_cv_header_sys_procfs_h])
17 # If a bare include failed, check whether we need to disable LFS to be
18 # able to use structured procfs.
19 AC_CHECK_HEADERS([sys/procfs.h], [
20 dpkg_structured_procfs_supports_lfs=0
22 #undef _FILE_OFFSET_BITS
23 #define _STRUCTURED_PROC 1
26 #define _STRUCTURED_PROC 1
29 AC_DEFINE_UNQUOTED([DPKG_STRUCTURED_PROCFS_SUPPORTS_LFS],
30 [$dpkg_structured_procfs_supports_lfs],
31 [Whether structured procfs supports LFS])
32 ])# DPKG_CHECK_HEADER_SYS_PROCFS