1 AC_DEFUN([LINUX_EXPORTS_TASKLIST_LOCK], [
2 AC_MSG_CHECKING([for exported tasklist_lock])
3 AC_CACHE_VAL([ac_cv_linux_exports_tasklist_lock], [
6 #include <linux/sched.h>],
8 extern rwlock_t tasklist_lock __attribute__((weak));
9 read_lock(&tasklist_lock);
11 ac_cv_linux_exports_tasklist_lock=yes,
12 ac_cv_linux_exports_tasklist_lock=no)])
13 AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)])
16 AC_DEFUN([LINUX_CONFIG_H_EXISTS], [
17 AC_MSG_CHECKING([for linux/config.h existance])
18 AC_CACHE_VAL([ac_cv_linux_config_h_exists], [
20 [#include <linux/config.h>],
22 ac_cv_linux_config_h_exists=yes,
23 ac_cv_linux_config_h_exists=no)])
24 AC_MSG_RESULT($ac_cv_linux_config_h_exists)
25 if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
26 AC_DEFINE([CONFIG_H_EXISTS], 1, [define if linux/config.h exists])
30 AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
31 AC_MSG_CHECKING([for linux/completion.h existance])
32 AC_CACHE_VAL([ac_cv_linux_completion_h_exists], [
34 [#include <linux/version.h>
35 #include <linux/completion.h>],
36 [struct completion _c;
37 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
40 ac_cv_linux_completion_h_exists=yes,
41 ac_cv_linux_completion_h_exists=no)])
42 AC_MSG_RESULT($ac_cv_linux_completion_h_exists)])
44 AC_DEFUN([LINUX_EXPORTFS_H_EXISTS], [
45 AC_MSG_CHECKING([for linux/exportfs.h existence])
46 AC_CACHE_VAL([ac_cv_linux_exportfs_h_exists], [
48 [#include <linux/exportfs.h>],
50 ac_cv_linux_exportfs_h_exists=yes,
51 ac_cv_linux_exportfs_h_exists=no)])
52 AC_MSG_RESULT($ac_cv_linux_exportfs_h_exists)])
54 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
55 AC_MSG_CHECKING([for defined for_each_process])
56 AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
58 [#include <linux/sched.h>],
59 [#ifndef for_each_process
60 #error for_each_process not defined
62 ac_cv_linux_defines_for_each_process=yes,
63 ac_cv_linux_defines_for_each_process=no)])
64 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
67 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
68 AC_MSG_CHECKING([for defined prev_task])
69 AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
71 [#include <linux/sched.h>],
73 #error prev_task not defined
75 ac_cv_linux_defines_prev_task=yes,
76 ac_cv_linux_defines_prev_task=no)])
77 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
80 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
81 AC_MSG_CHECKING([for exported init_mm])
82 AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
84 [extern struct mm_struct init_mm;],
85 [void *address = &init_mm;
86 printk("%p\n", address);],
87 ac_cv_linux_exports_init_mm=yes,
88 ac_cv_linux_exports_init_mm=no)])
89 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
92 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
93 AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
94 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
96 [#include <linux/modversions.h>],
97 [#ifndef __ver_kallsyms_address_to_symbol
98 #error kallsyms_address_to_symbol not exported
100 ac_cv_linux_exports_kallsyms_address=yes,
101 ac_cv_linux_exports_kallsyms_address=no)])
102 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
105 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
106 AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
107 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
109 [#include <linux/modversions.h>],
110 [#ifndef __ver_kallsyms_symbol_to_address
111 #error kallsyms_symbol_to_address not exported
113 ac_cv_linux_exports_kallsyms_symbol=yes,
114 ac_cv_linux_exports_kallsyms_symbol=no)])
115 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
117 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
118 AC_MSG_CHECKING([for exported sys_call_table])
119 AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
121 [#include <linux/modversions.h>],
122 [#ifndef __ver_sys_call_table
123 #error sys_call_table not exported
125 ac_cv_linux_exports_sys_call_table=yes,
126 ac_cv_linux_exports_sys_call_table=no)])
127 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
130 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
131 AC_MSG_CHECKING([for exported ia32_sys_call_table])
132 AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
134 [#include <linux/modversions.h>],
135 [#ifndef __ver_ia32_sys_call_table
136 #error ia32_sys_call_table not exported
138 ac_cv_linux_exports_ia32_sys_call_table=yes,
139 ac_cv_linux_exports_ia32_sys_call_table=no)])
140 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
143 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
144 AC_MSG_CHECKING([for exported sys_chdir])
145 AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
147 [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
148 [void *address = &sys_chdir;
149 printk("%p\n", address);],
150 ac_cv_linux_exports_sys_chdir=yes,
151 ac_cv_linux_exports_sys_chdir=no)])
152 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
155 AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
156 AC_MSG_CHECKING([for exported sys_close])
157 AC_CACHE_VAL([ac_cv_linux_exports_sys_close], [
159 [extern asmlinkage long sys_close(void) __attribute__((weak));],
160 [void *address = &sys_close;
161 printk("%p\n", address);],
162 ac_cv_linux_exports_sys_close=yes,
163 ac_cv_linux_exports_sys_close=no)])
164 AC_MSG_RESULT($ac_cv_linux_exports_sys_close)])
167 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
168 AC_MSG_CHECKING([for exported sys_open])
169 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
171 [extern asmlinkage long sys_open(void) __attribute__((weak));],
172 [void *address = &sys_open;
173 printk("%p\n", address);],
174 ac_cv_linux_exports_sys_open=yes,
175 ac_cv_linux_exports_sys_open=no)])
176 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
179 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
180 AC_MSG_CHECKING([for exported sys_wait4])
181 AC_CACHE_VAL([ac_cv_linux_exports_sys_wait4], [
183 [extern asmlinkage long sys_wait4(void) __attribute__((weak));],
184 [void *address = &sys_wait4;
185 printk("%p\n", address);],
186 ac_cv_linux_exports_sys_wait4=yes,
187 ac_cv_linux_exports_sys_wait4=no)])
188 AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)])
191 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE], [
192 AC_MSG_CHECKING([for i_blksize in struct inode])
193 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blksize], [
195 [#include <linux/fs.h>],
196 [struct inode _inode;
197 printk("%d\n", _inode.i_blksize);],
198 ac_cv_linux_fs_struct_inode_has_i_blksize=yes,
199 ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
200 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
202 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [
203 AC_MSG_CHECKING([for i_blkbits in struct inode])
204 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
206 [#include <linux/fs.h>],
207 [struct inode _inode;
208 printk("%d\n", _inode.i_blkbits);],
209 ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
210 ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
211 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
212 if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
213 AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
217 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
218 AC_MSG_CHECKING([for i_cdev in struct inode])
219 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
221 [#include <linux/fs.h>],
222 [struct inode _inode;
223 printk("%d\n", _inode.i_cdev);],
224 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
225 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
226 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
229 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
230 AC_MSG_CHECKING([for i_devices in struct inode])
231 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_devices], [
233 [#include <linux/fs.h>],
234 [struct inode _inode;
235 printk("%d\n", _inode.i_devices);],
236 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
237 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
238 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)])
241 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
242 AC_MSG_CHECKING([for i_dirty_data_buffers in struct inode])
243 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers], [
245 [#include <linux/fs.h>],
246 [struct inode _inode;
247 printk("%d\n", _inode.i_dirty_data_buffers);],
248 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
249 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
250 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)])
253 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [
254 AC_MSG_CHECKING([for inotify_lock in struct inode])
255 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_lock], [
257 [#include <linux/fs.h>],
258 [struct inode _inode;
259 printk("%d\n", _inode.inotify_lock);],
260 ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
261 ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
262 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)])
264 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [
265 AC_MSG_CHECKING([for inotify_sem in struct inode])
266 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_sem], [
268 [#include <linux/fs.h>],
269 [struct inode _inode;
270 printk("%x\n", _inode.inotify_sem);],
271 ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
272 ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
273 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)])
276 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
277 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
278 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
280 [#include <linux/fs.h>],
281 [struct inode _inode;
282 printk("%d\n", _inode.i_mapping_overload);],
283 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
284 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
285 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
288 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
289 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
290 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
292 [#include <linux/fs.h>],
293 [struct inode _inode;
294 printk("%d\n", _inode.i_mmap_shared);],
295 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
296 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
297 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
300 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
301 AC_MSG_CHECKING([for i_mutex in struct inode])
302 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
304 [#include <linux/fs.h>],
305 [struct inode _inode;
306 printk("%d\n", _inode.i_mutex);],
307 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
308 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
309 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
312 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
313 AC_MSG_CHECKING([for i_security in struct inode])
314 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
316 [#include <linux/fs.h>],
317 [struct inode _inode;
318 printk("%d\n", _inode.i_security);],
319 ac_cv_linux_fs_struct_inode_has_i_security=yes,
320 ac_cv_linux_fs_struct_inode_has_i_security=no)])
321 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
324 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST], [
325 AC_MSG_CHECKING([for i_sb_list in struct inode])
326 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_sb_list], [
328 [#include <linux/fs.h>],
329 [struct inode _inode;
330 printk("%d\n", _inode.i_sb_list);],
331 ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
332 ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
333 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)])
336 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
337 AC_MSG_CHECKING([for recalc_sigpending arg type])
338 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
340 [#include <linux/sched.h>],
341 [recalc_sigpending();],
342 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
343 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
344 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
347 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
348 AC_MSG_CHECKING([for parent in struct task_struct])
349 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
351 [#include <linux/sched.h>],
352 [struct task_struct _tsk;
353 printk("%d\n", _tsk.parent);],
354 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
355 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
356 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
359 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
360 AC_MSG_CHECKING([for tgid in struct task_struct])
361 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
363 [#include <linux/sched.h>],
364 [struct task_struct _tsk;
365 printk("%d\n", _tsk.tgid);],
366 ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
367 ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
368 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
371 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
372 AC_MSG_CHECKING([for real_parent in struct task_struct])
373 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
375 [#include <linux/sched.h>],
376 [struct task_struct _tsk;
377 printk("%d\n", _tsk.real_parent);],
378 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
379 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
380 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
383 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
384 AC_MSG_CHECKING([for sig in struct task_struct])
385 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
387 [#include <linux/sched.h>],
388 [struct task_struct _tsk;
389 printk("%d\n", _tsk.sig);],
390 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
391 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
392 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
395 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
396 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
397 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
399 [#include <linux/sched.h>],
400 [struct task_struct _tsk;
401 printk("%d\n", _tsk.sigmask_lock);],
402 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
403 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
404 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
407 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
408 AC_MSG_CHECKING([for sighand in struct task_struct])
409 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
411 [#include <linux/sched.h>],
412 [struct task_struct _tsk;
413 printk("%d\n", _tsk.sighand);],
414 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
415 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
416 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
419 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
420 AC_MSG_CHECKING([for rlim in struct task_struct])
421 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
423 [#include <linux/sched.h>],
424 [struct task_struct _tsk;
425 printk("%d\n", _tsk.rlim);],
426 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
427 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
428 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
431 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
432 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
433 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
435 [#include <linux/sched.h>],
436 [struct task_struct _tsk;
437 printk("%d\n", _tsk.signal->rlim);],
438 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
439 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
440 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
443 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
444 AC_MSG_CHECKING([for exit_state in struct task_struct])
445 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
447 [#include <linux/sched.h>],
448 [struct task_struct _tsk;
449 printk("%d\n", _tsk.exit_state);],
450 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
451 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
452 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
455 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO], [
456 AC_MSG_CHECKING([for thread_info in struct task_struct])
457 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_thread_info], [
459 [#include <linux/sched.h>],
460 [struct task_struct _tsk;
461 printk("%d\n", _tsk.thread_info);],
462 ac_cv_linux_sched_struct_task_struct_has_thread_info=yes,
463 ac_cv_linux_sched_struct_task_struct_has_thread_info=no)])
464 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_thread_info)])
467 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
468 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
469 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
471 [#include <linux/fs.h>],
472 [struct super_operations _super;
473 printk("%p\n", _super.alloc_inode);],
474 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
475 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
476 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
479 AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
480 AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels])
481 AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [
483 [#include <linux/fs.h>],
484 [posix_lock_file(0,0,0);],
485 ac_cv_linux_kernel_posix_lock_file_wait_arg=yes,
486 ac_cv_linux_kernel_posix_lock_file_wait_arg=no)])
487 AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)])
489 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
490 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
491 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
493 [#include <linux/net.h>],
494 [sock_create(0,0,0,0,0);],
495 ac_cv_linux_kernel_sock_create_v=yes,
496 ac_cv_linux_kernel_sock_create_v=no)])
497 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
500 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
501 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
502 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
503 save_CPPFLAGS="$CPPFLAGS"
504 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
506 [#include <linux/fs.h>],
507 [page_follow_link(0,0);],
508 ac_cv_linux_kernel_page_follow_link=yes,
509 ac_cv_linux_kernel_page_follow_link=no)
510 CPPFLAGS="$save_CPPFLAGS"])
511 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
513 AC_DEFUN([LINUX_KERNEL_HLIST_UNHASHED], [
514 AC_MSG_CHECKING([for hlist_unhashed])
515 AC_CACHE_VAL([ac_cv_linux_kernel_hlist_unhashed], [
516 save_CPPFLAGS="$CPPFLAGS"
517 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
519 [#include <linux/list.h>],
520 [hlist_unhashed(0);],
521 ac_cv_linux_kernel_hlist_unhashed=yes,
522 ac_cv_linux_kernel_hlist_unhashed=no)
523 CPPFLAGS="$save_CPPFLAGS"])
524 AC_MSG_RESULT($ac_cv_linux_kernel_hlist_unhashed)])
526 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
527 AC_MSG_CHECKING([for gfp_mask in struct address_space])
528 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
530 [#include <linux/fs.h>],
531 [struct address_space _a;
532 printk("%d\n", _a.gfp_mask);],
533 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
534 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
535 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
538 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
539 AC_MSG_CHECKING([for i_bytes in struct inode])
540 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
542 [#include <linux/fs.h>],
543 [struct inode _inode;
544 printk("%d\n", _inode.i_bytes);],
545 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
546 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
547 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
550 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
551 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
552 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
554 [#include <linux/fs.h>],
556 printk("%x\n", _i.i_alloc_sem);],
557 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
558 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
559 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
562 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
563 AC_MSG_CHECKING([for i_truncate_sem in struct inode])
564 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
566 [#include <linux/fs.h>],
568 printk("%x\n", _i.i_truncate_sem);],
569 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
570 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
571 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
574 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
575 AC_MSG_CHECKING([for page_lock in struct address_space])
576 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
578 [#include <linux/fs.h>],
579 [struct address_space _a_s;
580 printk("%x\n", _a_s.page_lock);],
581 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
582 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
583 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
586 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
587 AC_MSG_CHECKING([for inode_setattr return type])
588 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
590 [#include <linux/fs.h>],
591 [struct inode _inode;
594 i = inode_setattr(&_inode, &_iattr);],
595 ac_cv_linux_func_inode_setattr_returns_int=yes,
596 ac_cv_linux_func_inode_setattr_returns_int=no)])
597 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
600 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
601 AC_MSG_CHECKING([for write_inode return type])
602 AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
604 [#include <linux/fs.h>],
605 [struct inode _inode;
606 struct super_operations _sops;
608 i = _sops.write_inode(&_inode, 0);],
609 ac_cv_linux_func_write_inode_returns_int=yes,
610 ac_cv_linux_func_write_inode_returns_int=no)])
611 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
614 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
615 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
616 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
618 [#include <linux/fs.h>
619 #include <linux/mm.h>
620 #include <linux/writeback.h>],
621 [struct address_space_operations _aops;
623 struct writeback_control _writeback_control;
624 (void)_aops.writepage(&_page, &_writeback_control);],
625 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
626 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
627 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
630 AC_DEFUN([LINUX_REFRIGERATOR], [
631 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
632 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
634 [#include <linux/sched.h>
635 #ifdef FREEZER_H_EXISTS
636 #include <linux/freezer.h>
638 [refrigerator(PF_FREEZE);],
639 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
640 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
641 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
644 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
645 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
646 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
648 [#include <linux/fs.h>
649 #include <linux/namei.h>],
650 [struct inode _inode;
651 struct dentry _dentry;
652 struct nameidata _nameidata;
653 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
654 ac_cv_linux_func_i_create_takes_nameidata=yes,
655 ac_cv_linux_func_i_create_takes_nameidata=no)])
656 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
659 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
660 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
661 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
663 [#include <linux/fs.h>
664 #include <linux/namei.h>],
665 [struct inode _inode;
666 struct dentry _dentry;
667 struct nameidata _nameidata;
668 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
669 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
670 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
671 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
674 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
675 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
676 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
678 [#include <linux/fs.h>
679 #include <linux/namei.h>],
680 [struct inode _inode;
681 struct dentry _dentry;
682 struct nameidata _nameidata;
683 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
684 ac_cv_linux_func_i_permission_takes_nameidata=yes,
685 ac_cv_linux_func_i_permission_takes_nameidata=no)])
686 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
689 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
690 AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
691 AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
693 [#include <linux/fs.h>
694 #include <linux/namei.h>],
695 [struct inode _inode;
696 struct dentry _dentry;
697 struct nameidata _nameidata;
699 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
700 ac_cv_linux_func_i_put_link_takes_cookie=yes,
701 ac_cv_linux_func_i_put_link_takes_cookie=no)])
702 AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
705 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
706 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
707 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
709 [#include <linux/fs.h>
710 #include <linux/namei.h>],
711 [struct dentry _dentry;
712 struct nameidata _nameidata;
713 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
714 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
715 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
716 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
718 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
719 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
720 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
722 [#include <linux/fs.h>],
723 [get_sb_nodev(0,0,0,0,0);],
724 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
725 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
726 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
728 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
729 AC_MSG_CHECKING([for dentry in statfs])
730 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
732 [#include <linux/fs.h>
733 #include <linux/statfs.h>],
735 extern int vfs_statfs(struct dentry *, struct kstatfs *);
737 ac_cv_linux_statfs_takes_dentry=yes,
738 ac_cv_linux_statfs_takes_dentry=no)])
739 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
742 AC_DEFUN([LINUX_KEY_TYPE_H_EXISTS], [
743 AC_MSG_CHECKING([for linux/key-type.h existance])
744 AC_CACHE_VAL([ac_cv_linux_key_type_h_exists], [
746 [#include <linux/key-type.h>],
748 ac_cv_linux_key_type_h_exists=yes,
749 ac_cv_linux_key_type_h_exists=no)])
750 AC_MSG_RESULT($ac_cv_linux_key_type_h_exists)
751 if test "x$ac_cv_linux_key_type_h_exists" = "xyes"; then
752 AC_DEFINE([KEY_TYPE_H_EXISTS], 1, [define if linux/key-type.h exists])
755 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
756 AC_MSG_CHECKING([for linux kernel keyring support])
757 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
759 [#include <linux/rwsem.h>
760 #ifdef KEY_TYPE_H_EXISTS
761 #include <linux/key-type.h>
763 #include <linux/key.h>
764 #include <linux/keyctl.h>],
766 request_key(NULL, NULL, NULL);
767 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
768 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
771 #error rebuild your kernel with CONFIG_KEYS
773 ac_cv_linux_keyring_support=yes,
774 ac_cv_linux_keyring_support=no)])
775 AC_MSG_RESULT($ac_cv_linux_keyring_support)
776 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
777 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
780 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
781 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
782 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
783 save_CPPFLAGS="$CPPFLAGS"
784 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
786 [#include <linux/rwsem.h>
787 #include <linux/key.h>
789 [struct task_struct *t=NULL;
790 (void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
791 ac_cv_key_alloc_needs_struct_task=yes,
792 ac_cv_key_alloc_needs_struct_task=no)
793 CPPFLAGS="$save_CPPFLAGS"])
794 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
795 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
796 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
799 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
800 AC_MSG_CHECKING([if key_alloc() takes credentials])
801 AC_CACHE_VAL([ac_cv_key_alloc_needs_cred], [
802 save_CPPFLAGS="$CPPFLAGS"
803 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
805 [#include <linux/rwsem.h>
806 #include <linux/key.h>
808 [struct cred *c = NULL;
809 (void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
810 ac_cv_key_alloc_needs_cred=yes,
811 ac_cv_key_alloc_needs_cred=no)
812 CPPFLAGS="$save_CPPFLAGS"])
813 AC_MSG_RESULT($ac_cv_key_alloc_needs_cred)
814 if test "x$ac_cv_key_alloc_needs_cred" = "xyes"; then
815 AC_DEFINE([KEY_ALLOC_NEEDS_CRED], 1, [define if key_alloc takes credentials])
818 AC_DEFUN([LINUX_DO_SYNC_READ], [
819 AC_MSG_CHECKING([for linux do_sync_read()])
820 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
821 save_CPPFLAGS="$CPPFLAGS"
822 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
824 [#include <linux/fs.h>],
825 [do_sync_read(NULL, NULL, 0, NULL);],
826 ac_cv_linux_do_sync_read=yes,
827 ac_cv_linux_do_sync_read=no)
828 CPPFLAGS="$save_CPPFLAGS"])
829 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
830 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
831 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
834 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
835 AC_MSG_CHECKING([for linux generic_file_aio_read()])
836 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
837 save_CPPFLAGS="$CPPFLAGS"
838 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
840 [#include <linux/fs.h>],
841 [generic_file_aio_read(NULL, NULL, 0, 0);],
842 ac_cv_linux_generic_file_aio_read=yes,
843 ac_cv_linux_generic_file_aio_read=no)
844 CPPFLAGS="$save_CPPFLAGS"])
845 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
846 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
847 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
850 AC_DEFUN([LINUX_HAVE_I_SIZE_READ], [
851 AC_MSG_CHECKING([for linux i_size_read()])
852 AC_CACHE_VAL([ac_cv_linux_i_size_read], [
853 save_CPPFLAGS="$CPPFLAGS"
854 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
856 [#include <linux/fs.h>],
857 [i_size_read(NULL);],
858 ac_cv_linux_i_size_read=yes,
859 ac_cv_linux_i_size_read=no)
860 CPPFLAGS="$save_CPPFLAGS"])
861 AC_MSG_RESULT($ac_cv_linux_i_size_read)
862 if test "x$ac_cv_linux_i_size_read" = "xyes"; then
863 AC_DEFINE([HAVE_LINUX_I_SIZE_READ], 1, [define if your kernel has i_size_read()])
866 AC_DEFUN([LINUX_HAVE_D_ALLOC_ANON], [
867 AC_MSG_CHECKING([for linux d_alloc_anon()])
868 AC_CACHE_VAL([ac_cv_linux_d_alloc_anon], [
869 save_CPPFLAGS="$CPPFLAGS"
870 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
872 [#include <linux/dcache.h>],
873 [d_alloc_anon(NULL);],
874 ac_cv_linux_d_alloc_anon=yes,
875 ac_cv_linux_d_alloc_anon=no)
876 CPPFLAGS="$save_CPPFLAGS"])
877 AC_MSG_RESULT($ac_cv_linux_d_alloc_anon)
878 if test "x$ac_cv_linux_d_alloc_anon" = "xyes"; then
879 AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()])
882 AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
883 AC_MSG_CHECKING([for linux/freezer.h existance])
884 AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
886 [#include <linux/freezer.h>],
888 ac_cv_linux_freezer_h_exists=yes,
889 ac_cv_linux_freezer_h_exists=no)])
890 AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
891 if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
892 AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
895 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
896 AC_MSG_CHECKING([for todo in struct task_struct])
897 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
899 [#include <linux/sched.h>],
900 [struct task_struct _tsk;
901 printk("%d\n", _tsk.todo);],
902 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
903 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
904 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
906 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
907 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
908 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
910 [#include <linux/kernel.h>
911 #include <linux/workqueue.h>],
913 void f(struct work_struct *w) {}
914 struct work_struct *w;
917 ac_cv_linux_init_work_has_data=yes,
918 ac_cv_linux_init_work_has_data=no)])
919 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
922 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
923 AC_MSG_CHECKING([for flock in struct file_operations])
924 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
926 [#include <linux/fs.h>],
927 [struct file_operations _fop;
928 _fop.flock(NULL, 0, NULL);],
929 ac_cv_linux_fs_struct_fop_has_flock=yes,
930 ac_cv_linux_fs_struct_fop_has_flock=no)])
931 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])
933 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
934 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
935 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
937 [#include <linux/sysctl.h>],
939 register_sysctl_table (t);],
940 ac_cv_linux_register_sysctl_table_noflag=yes,
941 ac_cv_linux_register_sysctl_table_noflag=no)])
942 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
944 AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
945 AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
946 AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
948 [#include <linux/fs.h>],
949 [struct inode _inode;
952 (void)_inode.i_fop->flush(&_file, &id);],
953 ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
954 ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
955 AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
957 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
958 AC_MSG_CHECKING([whether kmem_cache_t exists])
959 AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
961 [#include <linux/slab.h>],
963 ac_cv_linux_have_kmem_cache_t=yes,
964 ac_cv_linux_have_kmem_cache_t=no)])
965 AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
967 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
968 AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
969 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
971 [#include <linux/slab.h>],
972 [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
973 ac_cv_linux_kmem_cache_create_takes_dtor=yes,
974 ac_cv_linux_kmem_cache_create_takes_dtor=no)])
975 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
977 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID], [
978 AC_MSG_CHECKING([whether kmem_cache_create constructor function takes a void pointer argument])
979 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_ctor_takes_void], [
980 save_CPPFLAGS="$CPPFLAGS"
981 CPPFLAGS="$CPPFLAGS -Werror"
983 [#include <linux/slab.h>],
984 [void _ctor(void *v) { };
985 kmem_cache_create(NULL, 0, 0, 0, _ctor);],
986 ac_cv_linux_kmem_cache_create_ctor_takes_void=yes,
987 ac_cv_linux_kmem_cache_create_ctor_takes_void=no)
988 CPPFLAGS="$save_CPPFLAGS"
990 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_ctor_takes_void)
991 if test "x$ac_cv_linux_kmem_cache_create_ctor_takes_void" = "xyes"; then
992 AC_DEFINE([KMEM_CACHE_CTOR_TAKES_VOID], 1, [define if kmem_cache_create constructor function takes a single void pointer argument])
995 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SENDFILE], [
996 AC_MSG_CHECKING([for sendfile in struct file_operations])
997 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_sendfile], [
999 [#include <linux/fs.h>],
1000 [struct file_operations _fop;
1001 _fop.sendfile(NULL, NULL, 0, 0, NULL);],
1002 ac_cv_linux_fs_struct_fop_has_sendfile=yes,
1003 ac_cv_linux_fs_struct_fop_has_sendfile=no)])
1004 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
1006 AC_DEFUN([LINUX_HAVE_SVC_ADDR_IN], [
1007 AC_MSG_CHECKING([whether svc_addr_in exists])
1008 AC_CACHE_VAL([ac_cv_linux_have_svc_addr_in], [
1010 [#include <linux/sunrpc/svc.h>],
1011 [svc_addr_in(NULL);],
1012 ac_cv_linux_have_svc_addr_in=yes,
1013 ac_cv_linux_have_svc_addr_in=no)])
1014 AC_MSG_RESULT($ac_cv_linux_have_svc_addr_in)])
1016 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
1017 AC_MSG_CHECKING([for splice_write and splice_read in struct file_operations])
1018 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_splice], [
1020 [#include <linux/fs.h>],
1021 [struct file_operations _fop;
1022 _fop.splice_write(NULL, NULL, NULL, 0, 0);
1023 _fop.splice_read(NULL, NULL, NULL, 0, 0);],
1024 ac_cv_linux_fs_struct_fop_has_splice=yes,
1025 ac_cv_linux_fs_struct_fop_has_splice=no)])
1026 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)])
1028 AC_DEFUN([LINUX_HAVE_CURRENT_KERNEL_TIME], [
1029 AC_MSG_CHECKING([for current_kernel_time()])
1030 AC_CACHE_VAL([ac_cv_linux_have_current_kernel_time], [
1032 [#include <linux/time.h>],
1033 [struct timespec s = current_kernel_time();],
1034 ac_cv_linux_have_current_kernel_time=yes,
1035 ac_cv_linux_have_current_kernel_time=no)])
1036 AC_MSG_RESULT($ac_cv_linux_have_current_kernel_time)])
1038 AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
1039 AC_MSG_CHECKING([for new kmem_cache init function parameters])
1040 AC_CACHE_VAL([ac_cv_linux_kmem_cache_init], [
1042 [#include <linux/slab.h>],
1043 [extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
1045 void (*)(struct kmem_cache *, void *));
1047 ac_cv_linux_kmem_cache_init=yes,
1048 ac_cv_linux_kmem_cache_init=no)])
1049 AC_MSG_RESULT($ac_cv_linux_kmem_cache_init)])
1051 AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
1052 AC_MSG_CHECKING([for sysctl table checking])
1053 AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
1055 [#include <linux/sysctl.h>],
1056 [ extern int sysctl_check_table(int) __attribute__((weak));
1057 sysctl_check_table(NULL);],
1058 ac_cv_linux_sysctl_table_checking=no,
1059 ac_cv_linux_sysctl_table_checking=yes)])
1060 AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
1062 AC_DEFUN([LINUX_HAVE_IGET], [
1063 AC_MSG_CHECKING([for linux iget()])
1064 AC_CACHE_VAL([ac_cv_linux_have_iget], [
1065 save_CPPFLAGS="$CPPFLAGS"
1066 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
1068 [#include <linux/fs.h>],
1069 [iget(NULL, NULL);],
1070 ac_cv_linux_have_iget=yes,
1071 ac_cv_linux_have_iget=no)
1072 CPPFLAGS="$save_CPPFLAGS"])
1073 AC_MSG_RESULT($ac_cv_linux_have_iget)])
1075 AC_DEFUN([LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH], [
1076 AC_MSG_CHECKING([for path in struct nameidata])
1077 AC_CACHE_VAL([ac_cv_linux_struct_nameidata_has_path], [
1079 [#include <linux/namei.h>],
1080 [struct nameidata _nd;
1081 printk("%x\n", _nd.path);],
1082 ac_cv_linux_struct_nameidata_has_path=yes,
1083 ac_cv_linux_struct_nameidata_has_path=no)])
1084 AC_MSG_RESULT($ac_cv_linux_struct_nameidata_has_path)])
1086 AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
1087 AC_MSG_CHECKING([if rcu_read_lock is usable])
1088 AC_CACHE_VAL([ac_cv_linux_exports_rcu_read_lock], [
1090 [#include <linux/rcupdate.h>],
1092 ac_cv_linux_exports_rcu_read_lock=yes,
1093 ac_cv_linux_exports_rcu_read_lock=no)])
1094 AC_MSG_RESULT($ac_cv_linux_exports_rcu_read_lock)
1095 if test "x$ac_cv_linux_exports_rcu_read_lock" = "xyes"; then
1096 AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
1099 AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [
1100 AC_MSG_CHECKING([if find_task_by_pid is usable])
1101 AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [
1103 [#include <linux/sched.h>],
1105 find_task_by_pid(p);],
1106 ac_cv_linux_exports_find_task_by_pid=yes,
1107 ac_cv_linux_exports_find_task_by_pid=no)])
1108 AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
1109 if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then
1110 AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable])
1113 AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
1114 AC_MSG_CHECKING([if proc_root_fs is defined and exported])
1115 AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [
1117 [#include <linux/proc_fs.h>],
1118 [struct proc_dir_entry *p = proc_root_fs;],
1119 ac_cv_linux_exports_proc_root_fs=yes,
1120 ac_cv_linux_exports_proc_root_fs=no)])
1121 AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs)
1122 if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then
1123 AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
1126 AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
1127 AC_MSG_CHECKING([if d_path() takes a struct path argument])
1128 AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
1130 [#include <linux/dcache.h>],
1132 d_path(p, NULL, 0);],
1133 ac_cv_linux_d_path_takes_struct_path=yes,
1134 ac_cv_linux_d_path_takes_struct_path=no)])
1135 AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
1136 if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
1137 AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
1140 AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
1141 AC_MSG_CHECKING([if kernel uses new export ops])
1142 AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
1144 [#include <linux/exportfs.h>],
1145 [struct export_operations _eops;
1146 _eops.fh_to_parent(NULL, NULL, 0, 0);],
1147 ac_cv_linux_new_export_ops=yes,
1148 ac_cv_linux_new_export_ops=no)])
1149 AC_MSG_RESULT($ac_cv_linux_new_export_ops)
1150 if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
1151 AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
1154 AC_DEFUN([LINUX_SEMAPHORE_H_EXISTS], [
1155 AC_MSG_CHECKING([for linux/semaphore.h existance])
1156 AC_CACHE_VAL([ac_cv_linux_semaphore_h_exists], [
1158 [#include <linux/semaphore.h>],
1160 ac_cv_linux_semaphore_h_exists=yes,
1161 ac_cv_linux_semaphore_h_exists=no)])
1162 AC_MSG_RESULT($ac_cv_linux_semaphore_h_exists)
1163 if test "x$ac_cv_linux_semaphore_h_exists" = "xyes"; then
1164 AC_DEFINE([LINUX_SEMAPHORE_H], 1, [define if linux/semaphore.h exists])
1167 AC_DEFUN([LINUX_HAVE_BDI_INIT], [
1168 AC_MSG_CHECKING([for linux bdi_init()])
1169 AC_CACHE_VAL([ac_cv_linux_bdi_init], [
1171 [#include <linux/backing-dev.h>],
1173 ac_cv_linux_bdi_init=yes,
1174 ac_cv_linux_bdi_init=no)])
1175 AC_MSG_RESULT($ac_cv_linux_bdi_init)
1176 if test "x$ac_cv_linux_bdi_init" = "xyes"; then
1177 AC_DEFINE([HAVE_BDI_INIT], 1, [define if your kernel has a bdi_init()])
1180 AC_DEFUN([LINUX_HAVE_WRITE_BEGIN_AOP], [
1181 AC_MSG_CHECKING([for linux write_begin() address space op])
1182 AC_CACHE_VAL([ac_cv_linux_write_begin], [
1184 [#include <linux/fs.h>],
1185 [struct address_space_operations _aop;
1186 _aop.write_begin = NULL;],
1187 ac_cv_linux_write_begin=yes,
1188 ac_cv_linux_write_begin=no)])
1189 AC_MSG_RESULT($ac_cv_linux_write_begin)
1190 if test "x$ac_cv_linux_write_begin" = "xyes"; then
1191 AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
1194 AC_DEFUN([LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], [
1195 AC_MSG_CHECKING([for linux grab_cache_page_write_begin()])
1196 AC_CACHE_VAL([ac_cv_linux_grab_cache_page_write_begin], [
1198 [#include <linux/pagemap.h>],
1199 [grab_cache_page_write_begin(NULL, 0, 0);],
1200 ac_cv_linux_grab_cache_page_write_begin=yes,
1201 ac_cv_linux_grab_cache_page_write_begin=no)])
1202 AC_MSG_RESULT($ac_cv_linux_grab_cache_page_write_begin)
1203 if test "x$ac_cv_linux_grab_cache_page_write_begin" = "xyes"; then
1204 AC_DEFINE([HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], 1, [define if your kernel has grab_cache_page_write_begin()])
1207 AC_DEFUN([LINUX_HAVE_PAGEVEC_LRU_ADD_FILE], [
1208 AC_MSG_CHECKING([for linux __pagevec_lru_add_file()])
1209 AC_CACHE_VAL([ac_cv_linux_pagevec_add_file], [
1211 [#include <linux/pagevec.h>],
1212 [__pagevec_lru_add_file(NULL);],
1213 ac_cv_linux_pagevec_add_file=yes,
1214 ac_cv_linux_pagevec_add_file=no)])
1215 AC_MSG_RESULT($ac_cv_linux_pagevec_add_file)
1216 if test "x$ac_cv_linux_pagevec_add_file" = "xyes"; then
1217 AC_DEFINE([HAVE_PAGEVEC_LRU_ADD_FILE], 1, [define if your kernel has __pagevec_lru_add_file()])
1220 AC_DEFUN([LINUX_STRUCT_TASK_HAS_CRED], [
1221 AC_MSG_CHECKING([if struct task has cred])
1222 AC_CACHE_VAL([ac_cv_linux_struct_task_has_cred], [
1224 [#include <linux/sched.h>
1225 #include <linux/cred.h>],
1226 [struct task_struct _t;
1228 _u =_t.cred->uid ;],
1229 ac_cv_linux_struct_task_has_cred=yes,
1230 ac_cv_linux_struct_task_has_cred=no)])
1231 AC_MSG_RESULT($ac_cv_linux_struct_task_has_cred)
1232 if test "x$ac_cv_linux_struct_task_has_cred" = "xyes"; then
1233 AC_DEFINE([STRUCT_TASK_HAS_CRED], 1, [define if struct task has a cred pointer])
1236 AC_DEFUN([LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER], [
1237 AC_MSG_CHECKING([if struct proc_dir_entry_has_owner])
1238 AC_CACHE_VAL([ac_cv_linux_struct_proc_dir_entry_has_owner], [
1240 [#include <linux/proc_fs.h>],
1241 [struct proc_dir_entry _p;
1243 ac_cv_linux_struct_proc_dir_entry_has_owner=yes,
1244 ac_cv_linux_struct_proc_dir_entry_has_owner=no)])
1245 AC_MSG_RESULT($ac_cv_linux_struct_proc_dir_entry_has_owner)
1246 if test "x$ac_cv_linux_struct_proc_dir_entry_has_owner" = "xyes"; then
1247 AC_DEFINE([STRUCT_PROC_DIR_ENTRY_HAS_OWNER], 1, [define if struct proc_dir_entry has an owner member])
1250 AC_DEFUN([LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT], [
1251 AC_MSG_CHECKING([if posix_test_lock returns a struct file_lock])
1252 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_returns_conflict], [
1254 [#include <linux/fs.h>],
1255 [struct file_lock *lock;
1257 lock = posix_test_lock(file, lock);],
1258 ac_cv_linux_posix_test_lock_returns_conflict=yes,
1259 ac_cv_linux_posix_test_lock_returns_conflict=no)])
1260 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_returns_conflict)
1261 if test "x$ac_cv_linux_posix_test_lock_returns_conflict" = "xyes"; then
1262 AC_DEFINE([POSIX_TEST_LOCK_RETURNS_CONFLICT], 1, [define if posix_test_lock returns the conflicting lock])
1265 AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
1266 AC_MSG_CHECKING([if posix_test_lock takes a conflict argument])
1267 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_conflict_arg], [
1269 [#include <linux/fs.h>],
1270 [ struct file_lock *lock;
1272 posix_test_lock(file, lock, lock);],
1273 ac_cv_linux_posix_test_lock_conflict_arg=yes,
1274 ac_cv_lonuc_posix_test_lock_conflict_arg=no)])
1275 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_conflict_arg)
1276 if test "x$ac_cv_linux_posix_test_lock_conflict_arg" = "xyes"; then
1277 AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
1280 AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
1281 AC_MSG_CHECKING([for exported key_type_keyring])
1282 AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
1285 #ifdef KEY_TYPE_H_EXISTS
1286 #include <linux/key-type.h>
1288 #include <linux/key.h>],
1290 printk("%s", key_type_keyring.name);
1292 ac_cv_linux_exports_key_type_keyring=yes,
1293 ac_cv_linux_exports_key_type_keyring=no)])
1294 AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
1295 if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
1296 AC_DEFINE([EXPORTED_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
1299 AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [
1300 AC_MSG_CHECKING([for KEYCTL_SESSION_TO_PARENT])
1301 AC_CACHE_VAL([ac_cv_linux_have_session_to_parent], [
1303 [ #include <linux/keyctl.h>],
1304 [ int i = KEYCTL_SESSION_TO_PARENT;],
1305 ac_cv_linux_have_session_to_parent=yes,
1306 ac_cv_linux_have_session_to_parent=no)])
1307 AC_MSG_RESULT($ac_cv_linux_have_session_to_parent)
1308 if test "x$ac_cv_linux_have_session_to_parent" = "xyes"; then
1309 AC_DEFINE([HAVE_SESSION_TO_PARENT], 1, [define if keyctl has the KEYCTL_SESSION_TO_PARENT function])
1312 AC_DEFUN([LINUX_STRUCT_SUPER_BLOCK_HAS_S_BDI], [
1313 AC_MSG_CHECKING([if struct super_block has s_bdi])
1314 AC_CACHE_VAL([ac_cv_linux_struct_super_block_has_s_bdi], [
1316 [#include <linux/fs.h>],
1317 [struct super_block _sb;
1319 ac_cv_linux_struct_super_block_has_s_bdi=yes,
1320 ac_cv_linux_struct_super_block_has_s_bdi=no)])
1321 AC_MSG_RESULT($ac_cv_linux_struct_super_block_has_s_bdi)
1322 if test "x$ac_cv_linux_struct_super_block_has_s_bdi" = "xyes"; then
1323 AC_DEFINE([STRUCT_SUPER_BLOCK_HAS_S_BDI], 1, [define if struct super_block has an s_bdi member])
1326 AC_DEFUN([LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME], [
1327 AC_MSG_CHECKING([if struct ctl_table has ctl_name])
1328 AC_CACHE_VAL([ac_cv_linux_struct_ctl_table_has_ctl_name], [
1330 [#include <linux/sysctl.h>],
1331 [struct ctl_table _t;
1333 ac_cv_linux_struct_ctl_table_has_ctl_name=yes,
1334 ac_cv_linux_struct_ctl_table_has_ctl_name=no)])
1335 AC_MSG_RESULT($ac_cv_linux_struct_ctl_table_has_ctl_name)
1336 if test "x$ac_cv_linux_struct_ctl_table_has_ctl_name" = "xyes"; then
1337 AC_DEFINE([STRUCT_CTL_TABLE_HAS_CTL_NAME], 1, [define if struct ctl_table has a ctl_name member])