4 if Options
.options
.disable_fault_handling
:
5 conf
.DEFINE('HAVE_DISABLE_FAULT_HANDLING',1)
7 # backtrace could be in libexecinfo or in libc
8 conf
.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc
=True, headers
='execinfo.h')
10 conf
.CHECK_FUNCS('sigprocmask sigblock sigaction')
12 conf
.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define
='HAVE_FRSIZE', headers
='sys/statvfs.h')
14 # all the different ways of doing statfs
18 'struct statvfs fsd; exit(statvfs(0, &fsd))',
21 ( 'STAT_STATFS3_OSF1',
22 '3-argument statfs function (DEC OSF/1)',
23 'struct statfs fsd; fsd.f_fsize = 0; exit(statfs(".", &fsd, sizeof(struct statfs)))'
24 'sys/param.h sys/mount.h' ),
26 ( 'STAT_STATFS2_BSIZE',
27 'two-argument statfs with statfs.bsize',
28 'struct statfs fsd; fsd.f_bsize = 0; exit(statfs(".", &fsd))',
29 'sys/param.h sys/mount.h sys/vfs.h' ),
32 'four-argument statfs (AIX-3.2.5, SVR3)',
33 'struct statfs fsd; exit(statfs(".", &fsd, sizeof fsd, 0))',
36 ( 'STAT_STATFS2_FSIZE',
37 'two-argument statfs with statfs.fsize',
38 'struct statfs fsd; fsd.f_fsize = 0; exit(statfs(".", &fsd))'
39 'sys/param.h sys/mount.h' ),
41 ( 'STAT_STATFS2_FS_DATA',
42 'two-argument statfs with struct fs_data (Ultrix)',
43 'struct fs_data fsd; exit(statfs(".", &fsd) != 1)',
44 'sys/param.h sys/mount.h sys/fs_types.h' )
48 for (define
, msg
, code
, headers
) in statfs_types
:
49 if conf
.CHECK_CODE(code
,
52 msg
='Checking for %s' % msg
,
58 print("FATAL: Failed to find a statfs method")
61 if conf
.CONFIG_SET('STAT_STATFS2_BSIZE'):
62 conf
.CHECK_CODE("""#ifdef HAVE_SYS_PARAM_H
63 #include <sys/param.h>
65 #ifdef HAVE_SYS_MOUNT_H
66 #include <sys/mount.h>
68 struct statfs fsd; fsd.f_iosize = 0;""",
69 define
='BSD_STYLE_STATVFS',
70 msg
='Checking for *bsd style statfs with statfs.f_iosize',
74 conf
.CHECK_CODE('struct statvfs buf; buf.f_fsid = 0',
75 define
='HAVE_FSID_INT',
76 msg
='Checking if f_fsid is an integer',
79 headers
='sys/statvfs.h')
81 # fsusage.c assumes that statvfs has an f_frsize entry. Some weird
82 # systems use f_bsize.
83 conf
.CHECK_CODE('struct statvfs buf; buf.f_frsize = 0',
85 msg
='Checking that statvfs.f_frsize works',
86 headers
='sys/statvfs.h',
90 # Some systems use f_flag in struct statvfs while others use f_flags
91 conf
.CHECK_CODE('struct statvfs buf; buf.f_flag = 0',
92 define
='HAVE_STATVFS_F_FLAG',
93 msg
='Checking whether statvfs.f_flag exists',
94 headers
='sys/statvfs.h',
98 conf
.CHECK_CODE('struct statvfs buf; buf.f_flags = 0',
99 define
='HAVE_STATVFS_F_FLAGS',
100 msg
='Checking whether statvfs.f_flags exists',
101 headers
='sys/statvfs.h',