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)])
154 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
155 AC_MSG_CHECKING([for exported sys_open])
156 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
158 [extern asmlinkage long sys_open(void) __attribute__((weak));],
159 [void *address = &sys_open;
160 printk("%p\n", address);],
161 ac_cv_linux_exports_sys_open=yes,
162 ac_cv_linux_exports_sys_open=no)])
163 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
166 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE], [
167 AC_MSG_CHECKING([for i_blksize in struct inode])
168 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blksize], [
170 [#include <linux/fs.h>],
171 [struct inode _inode;
172 printk("%d\n", _inode.i_blksize);],
173 ac_cv_linux_fs_struct_inode_has_i_blksize=yes,
174 ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
175 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
177 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [
178 AC_MSG_CHECKING([for i_blkbits in struct inode])
179 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
181 [#include <linux/fs.h>],
182 [struct inode _inode;
183 printk("%d\n", _inode.i_blkbits);],
184 ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
185 ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
186 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
187 if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
188 AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
192 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
193 AC_MSG_CHECKING([for i_cdev in struct inode])
194 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
196 [#include <linux/fs.h>],
197 [struct inode _inode;
198 printk("%d\n", _inode.i_cdev);],
199 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
200 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
201 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
204 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
205 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
206 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
208 [#include <linux/fs.h>],
209 [struct inode _inode;
210 printk("%d\n", _inode.i_mapping_overload);],
211 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
212 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
213 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
216 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
217 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
218 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
220 [#include <linux/fs.h>],
221 [struct inode _inode;
222 printk("%d\n", _inode.i_mmap_shared);],
223 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
224 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
225 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
228 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
229 AC_MSG_CHECKING([for i_mutex in struct inode])
230 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
232 [#include <linux/fs.h>],
233 [struct inode _inode;
234 printk("%d\n", _inode.i_mutex);],
235 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
236 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
237 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
240 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
241 AC_MSG_CHECKING([for i_security in struct inode])
242 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
244 [#include <linux/fs.h>],
245 [struct inode _inode;
246 printk("%d\n", _inode.i_security);],
247 ac_cv_linux_fs_struct_inode_has_i_security=yes,
248 ac_cv_linux_fs_struct_inode_has_i_security=no)])
249 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
252 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
253 AC_MSG_CHECKING([for recalc_sigpending arg type])
254 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
256 [#include <linux/sched.h>],
257 [recalc_sigpending();],
258 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
259 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
260 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
263 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
264 AC_MSG_CHECKING([for parent in struct task_struct])
265 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
267 [#include <linux/sched.h>],
268 [struct task_struct _tsk;
269 printk("%d\n", _tsk.parent);],
270 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
271 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
272 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
275 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
276 AC_MSG_CHECKING([for tgid in struct task_struct])
277 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
279 [#include <linux/sched.h>],
280 [struct task_struct _tsk;
281 printk("%d\n", _tsk.tgid);],
282 ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
283 ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
284 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
287 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
288 AC_MSG_CHECKING([for real_parent in struct task_struct])
289 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
291 [#include <linux/sched.h>],
292 [struct task_struct _tsk;
293 printk("%d\n", _tsk.real_parent);],
294 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
295 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
296 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
299 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
300 AC_MSG_CHECKING([for sig in struct task_struct])
301 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
303 [#include <linux/sched.h>],
304 [struct task_struct _tsk;
305 printk("%d\n", _tsk.sig);],
306 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
307 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
308 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
311 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
312 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
313 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
315 [#include <linux/sched.h>],
316 [struct task_struct _tsk;
317 printk("%d\n", _tsk.sigmask_lock);],
318 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
319 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
320 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
323 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
324 AC_MSG_CHECKING([for sighand in struct task_struct])
325 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
327 [#include <linux/sched.h>],
328 [struct task_struct _tsk;
329 printk("%d\n", _tsk.sighand);],
330 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
331 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
332 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
335 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
336 AC_MSG_CHECKING([for rlim in struct task_struct])
337 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
339 [#include <linux/sched.h>],
340 [struct task_struct _tsk;
341 printk("%d\n", _tsk.rlim);],
342 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
343 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
344 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
347 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
348 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
349 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
351 [#include <linux/sched.h>],
352 [struct task_struct _tsk;
353 printk("%d\n", _tsk.signal->rlim);],
354 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
355 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
356 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
359 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
360 AC_MSG_CHECKING([for exit_state in struct task_struct])
361 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
363 [#include <linux/sched.h>],
364 [struct task_struct _tsk;
365 printk("%d\n", _tsk.exit_state);],
366 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
367 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
368 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
371 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO], [
372 AC_MSG_CHECKING([for thread_info in struct task_struct])
373 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_thread_info], [
375 [#include <linux/sched.h>],
376 [struct task_struct _tsk;
377 printk("%d\n", _tsk.thread_info);],
378 ac_cv_linux_sched_struct_task_struct_has_thread_info=yes,
379 ac_cv_linux_sched_struct_task_struct_has_thread_info=no)])
380 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_thread_info)])
383 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
384 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
385 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
387 [#include <linux/fs.h>],
388 [struct super_operations _super;
389 printk("%p\n", _super.alloc_inode);],
390 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
391 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
392 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
395 AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
396 AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels])
397 AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [
399 [#include <linux/fs.h>],
400 [posix_lock_file(0,0,0);],
401 ac_cv_linux_kernel_posix_lock_file_wait_arg=yes,
402 ac_cv_linux_kernel_posix_lock_file_wait_arg=no)])
403 AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)])
405 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
406 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
407 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
409 [#include <linux/net.h>],
410 [sock_create(0,0,0,0,0);],
411 ac_cv_linux_kernel_sock_create_v=yes,
412 ac_cv_linux_kernel_sock_create_v=no)])
413 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
416 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
417 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
418 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
419 save_CPPFLAGS="$CPPFLAGS"
420 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
422 [#include <linux/fs.h>],
423 [page_follow_link(0,0);],
424 ac_cv_linux_kernel_page_follow_link=yes,
425 ac_cv_linux_kernel_page_follow_link=no)
426 CPPFLAGS="$save_CPPFLAGS"])
427 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
429 AC_DEFUN([LINUX_KERNEL_HLIST_UNHASHED], [
430 AC_MSG_CHECKING([for hlist_unhashed])
431 AC_CACHE_VAL([ac_cv_linux_kernel_hlist_unhashed], [
432 save_CPPFLAGS="$CPPFLAGS"
433 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
435 [#include <linux/list.h>],
436 [hlist_unhashed(0);],
437 ac_cv_linux_kernel_hlist_unhashed=yes,
438 ac_cv_linux_kernel_hlist_unhashed=no)
439 CPPFLAGS="$save_CPPFLAGS"])
440 AC_MSG_RESULT($ac_cv_linux_kernel_hlist_unhashed)])
443 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
444 AC_MSG_CHECKING([for i_bytes in struct inode])
445 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
447 [#include <linux/fs.h>],
448 [struct inode _inode;
449 printk("%d\n", _inode.i_bytes);],
450 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
451 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
452 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
455 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
456 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
457 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
459 [#include <linux/fs.h>],
461 printk("%x\n", _i.i_alloc_sem);],
462 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
463 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
464 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
467 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
468 AC_MSG_CHECKING([for inode_setattr return type])
469 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
471 [#include <linux/fs.h>],
472 [struct inode _inode;
475 i = inode_setattr(&_inode, &_iattr);],
476 ac_cv_linux_func_inode_setattr_returns_int=yes,
477 ac_cv_linux_func_inode_setattr_returns_int=no)])
478 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
481 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
482 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
483 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
485 [#include <linux/fs.h>
486 #include <linux/mm.h>
487 #include <linux/writeback.h>],
488 [struct address_space_operations _aops;
490 struct writeback_control _writeback_control;
491 (void)_aops.writepage(&_page, &_writeback_control);],
492 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
493 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
494 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
497 AC_DEFUN([LINUX_REFRIGERATOR], [
498 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
499 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
501 [#include <linux/sched.h>
502 #ifdef FREEZER_H_EXISTS
503 #include <linux/freezer.h>
505 [refrigerator(PF_FREEZE);],
506 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
507 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
508 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
511 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
512 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
513 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
515 [#include <linux/fs.h>
516 #include <linux/namei.h>],
517 [struct inode _inode;
518 struct dentry _dentry;
519 struct nameidata _nameidata;
520 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
521 ac_cv_linux_func_i_create_takes_nameidata=yes,
522 ac_cv_linux_func_i_create_takes_nameidata=no)])
523 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
526 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
527 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
528 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
530 [#include <linux/fs.h>
531 #include <linux/namei.h>],
532 [struct inode _inode;
533 struct dentry _dentry;
534 struct nameidata _nameidata;
535 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
536 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
537 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
538 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
541 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
542 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
543 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
545 [#include <linux/fs.h>
546 #include <linux/namei.h>],
547 [struct inode _inode;
548 struct dentry _dentry;
549 struct nameidata _nameidata;
550 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
551 ac_cv_linux_func_i_permission_takes_nameidata=yes,
552 ac_cv_linux_func_i_permission_takes_nameidata=no)])
553 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
556 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
557 AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
558 AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
560 [#include <linux/fs.h>
561 #include <linux/namei.h>],
562 [struct inode _inode;
563 struct dentry _dentry;
564 struct nameidata _nameidata;
566 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
567 ac_cv_linux_func_i_put_link_takes_cookie=yes,
568 ac_cv_linux_func_i_put_link_takes_cookie=no)])
569 AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
572 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
573 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
574 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
576 [#include <linux/fs.h>
577 #include <linux/namei.h>],
578 [struct dentry _dentry;
579 struct nameidata _nameidata;
580 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
581 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
582 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
583 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
585 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
586 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
587 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
589 [#include <linux/fs.h>],
590 [get_sb_nodev(0,0,0,0,0);],
591 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
592 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
593 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
595 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
596 AC_MSG_CHECKING([for dentry in statfs])
597 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
599 [#include <linux/fs.h>
600 #include <linux/statfs.h>],
602 extern int vfs_statfs(struct dentry *, struct kstatfs *);
604 ac_cv_linux_statfs_takes_dentry=yes,
605 ac_cv_linux_statfs_takes_dentry=no)])
606 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
609 AC_DEFUN([LINUX_KEY_TYPE_H_EXISTS], [
610 AC_MSG_CHECKING([for linux/key-type.h existance])
611 AC_CACHE_VAL([ac_cv_linux_key_type_h_exists], [
613 [#include <linux/key-type.h>],
615 ac_cv_linux_key_type_h_exists=yes,
616 ac_cv_linux_key_type_h_exists=no)])
617 AC_MSG_RESULT($ac_cv_linux_key_type_h_exists)
618 if test "x$ac_cv_linux_key_type_h_exists" = "xyes"; then
619 AC_DEFINE([KEY_TYPE_H_EXISTS], 1, [define if linux/key-type.h exists])
622 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
623 AC_MSG_CHECKING([for linux kernel keyring support])
624 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
626 [#include <linux/rwsem.h>
627 #ifdef KEY_TYPE_H_EXISTS
628 #include <linux/key-type.h>
630 #include <linux/key.h>
631 #include <linux/keyctl.h>],
633 request_key(NULL, NULL, NULL);
634 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
635 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
638 #error rebuild your kernel with CONFIG_KEYS
640 ac_cv_linux_keyring_support=yes,
641 ac_cv_linux_keyring_support=no)])
642 AC_MSG_RESULT($ac_cv_linux_keyring_support)
643 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
644 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
647 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
648 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
649 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
650 save_CPPFLAGS="$CPPFLAGS"
651 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
653 [#include <linux/rwsem.h>
654 #include <linux/key.h>
656 [struct task_struct *t=NULL;
657 (void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
658 ac_cv_key_alloc_needs_struct_task=yes,
659 ac_cv_key_alloc_needs_struct_task=no)
660 CPPFLAGS="$save_CPPFLAGS"])
661 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
662 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
663 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
666 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
667 AC_MSG_CHECKING([if key_alloc() takes credentials])
668 AC_CACHE_VAL([ac_cv_key_alloc_needs_cred], [
669 save_CPPFLAGS="$CPPFLAGS"
670 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
672 [#include <linux/rwsem.h>
673 #include <linux/key.h>
675 [struct cred *c = NULL;
676 (void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
677 ac_cv_key_alloc_needs_cred=yes,
678 ac_cv_key_alloc_needs_cred=no)
679 CPPFLAGS="$save_CPPFLAGS"])
680 AC_MSG_RESULT($ac_cv_key_alloc_needs_cred)
681 if test "x$ac_cv_key_alloc_needs_cred" = "xyes"; then
682 AC_DEFINE([KEY_ALLOC_NEEDS_CRED], 1, [define if key_alloc takes credentials])
685 AC_DEFUN([LINUX_DO_SYNC_READ], [
686 AC_MSG_CHECKING([for linux do_sync_read()])
687 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
688 save_CPPFLAGS="$CPPFLAGS"
689 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
691 [#include <linux/fs.h>],
692 [do_sync_read(NULL, NULL, 0, NULL);],
693 ac_cv_linux_do_sync_read=yes,
694 ac_cv_linux_do_sync_read=no)
695 CPPFLAGS="$save_CPPFLAGS"])
696 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
697 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
698 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
701 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
702 AC_MSG_CHECKING([for linux generic_file_aio_read()])
703 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
704 save_CPPFLAGS="$CPPFLAGS"
705 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
707 [#include <linux/fs.h>],
708 [generic_file_aio_read(NULL, NULL, 0, 0);],
709 ac_cv_linux_generic_file_aio_read=yes,
710 ac_cv_linux_generic_file_aio_read=no)
711 CPPFLAGS="$save_CPPFLAGS"])
712 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
713 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
714 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
717 AC_DEFUN([LINUX_HAVE_I_SIZE_READ], [
718 AC_MSG_CHECKING([for linux i_size_read()])
719 AC_CACHE_VAL([ac_cv_linux_i_size_read], [
720 save_CPPFLAGS="$CPPFLAGS"
721 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
723 [#include <linux/fs.h>],
724 [i_size_read(NULL);],
725 ac_cv_linux_i_size_read=yes,
726 ac_cv_linux_i_size_read=no)
727 CPPFLAGS="$save_CPPFLAGS"])
728 AC_MSG_RESULT($ac_cv_linux_i_size_read)
729 if test "x$ac_cv_linux_i_size_read" = "xyes"; then
730 AC_DEFINE([HAVE_LINUX_I_SIZE_READ], 1, [define if your kernel has i_size_read()])
733 AC_DEFUN([LINUX_HAVE_D_ALLOC_ANON], [
734 AC_MSG_CHECKING([for linux d_alloc_anon()])
735 AC_CACHE_VAL([ac_cv_linux_d_alloc_anon], [
736 save_CPPFLAGS="$CPPFLAGS"
737 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
739 [#include <linux/dcache.h>],
740 [d_alloc_anon(NULL);],
741 ac_cv_linux_d_alloc_anon=yes,
742 ac_cv_linux_d_alloc_anon=no)
743 CPPFLAGS="$save_CPPFLAGS"])
744 AC_MSG_RESULT($ac_cv_linux_d_alloc_anon)
745 if test "x$ac_cv_linux_d_alloc_anon" = "xyes"; then
746 AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()])
749 AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
750 AC_MSG_CHECKING([for linux/freezer.h existance])
751 AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
753 [#include <linux/freezer.h>],
755 ac_cv_linux_freezer_h_exists=yes,
756 ac_cv_linux_freezer_h_exists=no)])
757 AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
758 if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
759 AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
762 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
763 AC_MSG_CHECKING([for todo in struct task_struct])
764 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
766 [#include <linux/sched.h>],
767 [struct task_struct _tsk;
768 printk("%d\n", _tsk.todo);],
769 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
770 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
771 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
773 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
774 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
775 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
777 [#include <linux/kernel.h>
778 #include <linux/workqueue.h>],
780 void f(struct work_struct *w) {}
781 struct work_struct *w;
784 ac_cv_linux_init_work_has_data=yes,
785 ac_cv_linux_init_work_has_data=no)])
786 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
789 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
790 AC_MSG_CHECKING([for flock in struct file_operations])
791 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
793 [#include <linux/fs.h>],
794 [struct file_operations _fop;
795 _fop.flock(NULL, 0, NULL);],
796 ac_cv_linux_fs_struct_fop_has_flock=yes,
797 ac_cv_linux_fs_struct_fop_has_flock=no)])
798 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])
800 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
801 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
802 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
804 [#include <linux/sysctl.h>],
806 register_sysctl_table (t);],
807 ac_cv_linux_register_sysctl_table_noflag=yes,
808 ac_cv_linux_register_sysctl_table_noflag=no)])
809 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
811 AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
812 AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
813 AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
815 [#include <linux/fs.h>],
816 [struct inode _inode;
819 (void)_inode.i_fop->flush(&_file, &id);],
820 ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
821 ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
822 AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
824 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
825 AC_MSG_CHECKING([whether kmem_cache_t exists])
826 AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
828 [#include <linux/slab.h>],
830 ac_cv_linux_have_kmem_cache_t=yes,
831 ac_cv_linux_have_kmem_cache_t=no)])
832 AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
834 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
835 AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
836 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
838 [#include <linux/slab.h>],
839 [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
840 ac_cv_linux_kmem_cache_create_takes_dtor=yes,
841 ac_cv_linux_kmem_cache_create_takes_dtor=no)])
842 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
844 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID], [
845 AC_MSG_CHECKING([whether kmem_cache_create constructor function takes a void pointer argument])
846 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_ctor_takes_void], [
847 save_CPPFLAGS="$CPPFLAGS"
848 CPPFLAGS="$CPPFLAGS -Werror"
850 [#include <linux/slab.h>],
851 [void _ctor(void *v) { };
852 kmem_cache_create(NULL, 0, 0, 0, _ctor);],
853 ac_cv_linux_kmem_cache_create_ctor_takes_void=yes,
854 ac_cv_linux_kmem_cache_create_ctor_takes_void=no)
855 CPPFLAGS="$save_CPPFLAGS"
857 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_ctor_takes_void)
858 if test "x$ac_cv_linux_kmem_cache_create_ctor_takes_void" = "xyes"; then
859 AC_DEFINE([KMEM_CACHE_CTOR_TAKES_VOID], 1, [define if kmem_cache_create constructor function takes a single void pointer argument])
862 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SENDFILE], [
863 AC_MSG_CHECKING([for sendfile in struct file_operations])
864 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_sendfile], [
866 [#include <linux/fs.h>],
867 [struct file_operations _fop;
868 _fop.sendfile(NULL, NULL, 0, 0, NULL);],
869 ac_cv_linux_fs_struct_fop_has_sendfile=yes,
870 ac_cv_linux_fs_struct_fop_has_sendfile=no)])
871 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
873 AC_DEFUN([LINUX_HAVE_SVC_ADDR_IN], [
874 AC_MSG_CHECKING([whether svc_addr_in exists])
875 AC_CACHE_VAL([ac_cv_linux_have_svc_addr_in], [
877 [#include <linux/sunrpc/svc.h>],
878 [svc_addr_in(NULL);],
879 ac_cv_linux_have_svc_addr_in=yes,
880 ac_cv_linux_have_svc_addr_in=no)])
881 AC_MSG_RESULT($ac_cv_linux_have_svc_addr_in)])
883 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
884 AC_MSG_CHECKING([for splice_write and splice_read in struct file_operations])
885 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_splice], [
887 [#include <linux/fs.h>],
888 [struct file_operations _fop;
889 _fop.splice_write(NULL, NULL, NULL, 0, 0);
890 _fop.splice_read(NULL, NULL, NULL, 0, 0);],
891 ac_cv_linux_fs_struct_fop_has_splice=yes,
892 ac_cv_linux_fs_struct_fop_has_splice=no)])
893 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)])
895 AC_DEFUN([LINUX_HAVE_CURRENT_KERNEL_TIME], [
896 AC_MSG_CHECKING([for current_kernel_time()])
897 AC_CACHE_VAL([ac_cv_linux_have_current_kernel_time], [
899 [#include <linux/time.h>],
900 [struct timespec s = current_kernel_time();],
901 ac_cv_linux_have_current_kernel_time=yes,
902 ac_cv_linux_have_current_kernel_time=no)])
903 AC_MSG_RESULT($ac_cv_linux_have_current_kernel_time)])
905 AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
906 AC_MSG_CHECKING([for new kmem_cache init function parameters])
907 AC_CACHE_VAL([ac_cv_linux_kmem_cache_init], [
909 [#include <linux/slab.h>],
910 [extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
912 void (*)(struct kmem_cache *, void *));
914 ac_cv_linux_kmem_cache_init=yes,
915 ac_cv_linux_kmem_cache_init=no)])
916 AC_MSG_RESULT($ac_cv_linux_kmem_cache_init)])
918 AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
919 AC_MSG_CHECKING([for sysctl table checking])
920 AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
922 [#include <linux/sysctl.h>],
923 [ extern int sysctl_check_table(int) __attribute__((weak));
924 sysctl_check_table(NULL);],
925 ac_cv_linux_sysctl_table_checking=no,
926 ac_cv_linux_sysctl_table_checking=yes)])
927 AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
929 AC_DEFUN([LINUX_HAVE_IGET], [
930 AC_MSG_CHECKING([for linux iget()])
931 AC_CACHE_VAL([ac_cv_linux_have_iget], [
932 save_CPPFLAGS="$CPPFLAGS"
933 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
935 [#include <linux/fs.h>],
937 ac_cv_linux_have_iget=yes,
938 ac_cv_linux_have_iget=no)
939 CPPFLAGS="$save_CPPFLAGS"])
940 AC_MSG_RESULT($ac_cv_linux_have_iget)])
942 AC_DEFUN([LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH], [
943 AC_MSG_CHECKING([for path in struct nameidata])
944 AC_CACHE_VAL([ac_cv_linux_struct_nameidata_has_path], [
946 [#include <linux/namei.h>],
947 [struct nameidata _nd;
948 printk("%x\n", _nd.path);],
949 ac_cv_linux_struct_nameidata_has_path=yes,
950 ac_cv_linux_struct_nameidata_has_path=no)])
951 AC_MSG_RESULT($ac_cv_linux_struct_nameidata_has_path)])
953 AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
954 AC_MSG_CHECKING([if rcu_read_lock is usable])
955 AC_CACHE_VAL([ac_cv_linux_exports_rcu_read_lock], [
957 [#include <linux/rcupdate.h>],
959 ac_cv_linux_exports_rcu_read_lock=yes,
960 ac_cv_linux_exports_rcu_read_lock=no)])
961 AC_MSG_RESULT($ac_cv_linux_exports_rcu_read_lock)
962 if test "x$ac_cv_linux_exports_rcu_read_lock" = "xyes"; then
963 AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
966 AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [
967 AC_MSG_CHECKING([if find_task_by_pid is usable])
968 AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [
970 [#include <linux/sched.h>],
972 find_task_by_pid(p);],
973 ac_cv_linux_exports_find_task_by_pid=yes,
974 ac_cv_linux_exports_find_task_by_pid=no)])
975 AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
976 if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then
977 AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable])
980 AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
981 AC_MSG_CHECKING([if proc_root_fs is defined and exported])
982 AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [
984 [#include <linux/proc_fs.h>],
985 [struct proc_dir_entry *p = proc_root_fs;],
986 ac_cv_linux_exports_proc_root_fs=yes,
987 ac_cv_linux_exports_proc_root_fs=no)])
988 AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs)
989 if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then
990 AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
993 AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
994 AC_MSG_CHECKING([if d_path() takes a struct path argument])
995 AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
997 [#include <linux/dcache.h>],
999 d_path(p, NULL, 0);],
1000 ac_cv_linux_d_path_takes_struct_path=yes,
1001 ac_cv_linux_d_path_takes_struct_path=no)])
1002 AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
1003 if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
1004 AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
1007 AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
1008 AC_MSG_CHECKING([if kernel uses new export ops])
1009 AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
1011 [#include <linux/exportfs.h>],
1012 [struct export_operations _eops;
1013 _eops.fh_to_parent(NULL, NULL, 0, 0);],
1014 ac_cv_linux_new_export_ops=yes,
1015 ac_cv_linux_new_export_ops=no)])
1016 AC_MSG_RESULT($ac_cv_linux_new_export_ops)
1017 if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
1018 AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
1021 AC_DEFUN([LINUX_SEMAPHORE_H_EXISTS], [
1022 AC_MSG_CHECKING([for linux/semaphore.h existance])
1023 AC_CACHE_VAL([ac_cv_linux_semaphore_h_exists], [
1025 [#include <linux/semaphore.h>],
1027 ac_cv_linux_semaphore_h_exists=yes,
1028 ac_cv_linux_semaphore_h_exists=no)])
1029 AC_MSG_RESULT($ac_cv_linux_semaphore_h_exists)
1030 if test "x$ac_cv_linux_semaphore_h_exists" = "xyes"; then
1031 AC_DEFINE([LINUX_SEMAPHORE_H], 1, [define if linux/semaphore.h exists])
1034 AC_DEFUN([LINUX_HAVE_BDI_INIT], [
1035 AC_MSG_CHECKING([for linux bdi_init()])
1036 AC_CACHE_VAL([ac_cv_linux_bdi_init], [
1038 [#include <linux/backing-dev.h>],
1040 ac_cv_linux_bdi_init=yes,
1041 ac_cv_linux_bdi_init=no)])
1042 AC_MSG_RESULT($ac_cv_linux_bdi_init)
1043 if test "x$ac_cv_linux_bdi_init" = "xyes"; then
1044 AC_DEFINE([HAVE_BDI_INIT], 1, [define if your kernel has a bdi_init()])
1047 AC_DEFUN([LINUX_HAVE_WRITE_BEGIN_AOP], [
1048 AC_MSG_CHECKING([for linux write_begin() address space op])
1049 AC_CACHE_VAL([ac_cv_linux_write_begin], [
1051 [#include <linux/fs.h>],
1052 [struct address_space_operations _aop;
1053 _aop.write_begin = NULL;],
1054 ac_cv_linux_write_begin=yes,
1055 ac_cv_linux_write_begin=no)])
1056 AC_MSG_RESULT($ac_cv_linux_write_begin)
1057 if test "x$ac_cv_linux_write_begin" = "xyes"; then
1058 AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
1061 AC_DEFUN([LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], [
1062 AC_MSG_CHECKING([for linux grab_cache_page_write_begin()])
1063 AC_CACHE_VAL([ac_cv_linux_grab_cache_page_write_begin], [
1065 [#include <linux/pagemap.h>],
1066 [grab_cache_page_write_begin(NULL, 0, 0);],
1067 ac_cv_linux_grab_cache_page_write_begin=yes,
1068 ac_cv_linux_grab_cache_page_write_begin=no)])
1069 AC_MSG_RESULT($ac_cv_linux_grab_cache_page_write_begin)
1070 if test "x$ac_cv_linux_grab_cache_page_write_begin" = "xyes"; then
1071 AC_DEFINE([HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], 1, [define if your kernel has grab_cache_page_write_begin()])
1074 AC_DEFUN([LINUX_HAVE_PAGEVEC_LRU_ADD_FILE], [
1075 AC_MSG_CHECKING([for linux __pagevec_lru_add_file()])
1076 AC_CACHE_VAL([ac_cv_linux_pagevec_add_file], [
1078 [#include <linux/pagevec.h>],
1079 [__pagevec_lru_add_file(NULL);],
1080 ac_cv_linux_pagevec_add_file=yes,
1081 ac_cv_linux_pagevec_add_file=no)])
1082 AC_MSG_RESULT($ac_cv_linux_pagevec_add_file)
1083 if test "x$ac_cv_linux_pagevec_add_file" = "xyes"; then
1084 AC_DEFINE([HAVE_PAGEVEC_LRU_ADD_FILE], 1, [define if your kernel has __pagevec_lru_add_file()])
1087 AC_DEFUN([LINUX_HAVE_SPLICE_DIRECT_TO_ACTOR], [
1088 AC_MSG_CHECKING([for linux splice_direct_to_actor()])
1089 AC_CACHE_VAL([ac_cv_linux_splice_direct_to_actor], [
1091 [#include <linux/splice.h>],
1092 [splice_direct_to_actor(NULL,NULL,NULL);],
1093 ac_cv_linux_splice_direct_to_actor=yes,
1094 ac_cv_linux_splice_direct_to_actor=no)])
1095 AC_MSG_RESULT($ac_cv_linux_splice_direct_to_actor)
1096 if test "x$ac_cv_linux_splice_direct_to_actor" = "xyes"; then
1097 AC_DEFINE([HAVE_SPLICE_DIRECT_TO_ACTOR], 1, [define if your kernel has splice_direct_to_actor()])
1100 AC_DEFUN([LINUX_STRUCT_TASK_HAS_CRED], [
1101 AC_MSG_CHECKING([if struct task has cred])
1102 AC_CACHE_VAL([ac_cv_linux_struct_task_has_cred], [
1104 [#include <linux/sched.h>
1105 #include <linux/cred.h>],
1106 [struct task_struct _t;
1108 _u =_t.cred->uid ;],
1109 ac_cv_linux_struct_task_has_cred=yes,
1110 ac_cv_linux_struct_task_has_cred=no)])
1111 AC_MSG_RESULT($ac_cv_linux_struct_task_has_cred)
1112 if test "x$ac_cv_linux_struct_task_has_cred" = "xyes"; then
1113 AC_DEFINE([STRUCT_TASK_HAS_CRED], 1, [define if struct task has a cred pointer])
1116 AC_DEFUN([LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER], [
1117 AC_MSG_CHECKING([if struct proc_dir_entry_has_owner])
1118 AC_CACHE_VAL([ac_cv_linux_struct_proc_dir_entry_has_owner], [
1120 [#include <linux/proc_fs.h>],
1121 [struct proc_dir_entry _p;
1123 ac_cv_linux_struct_proc_dir_entry_has_owner=yes,
1124 ac_cv_linux_struct_proc_dir_entry_has_owner=no)])
1125 AC_MSG_RESULT($ac_cv_linux_struct_proc_dir_entry_has_owner)
1126 if test "x$ac_cv_linux_struct_proc_dir_entry_has_owner" = "xyes"; then
1127 AC_DEFINE([STRUCT_PROC_DIR_ENTRY_HAS_OWNER], 1, [define if struct proc_dir_entry has an owner member])
1130 AC_DEFUN([LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT], [
1131 AC_MSG_CHECKING([if posix_test_lock returns a struct file_lock])
1132 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_returns_conflict], [
1134 [#include <linux/fs.h>],
1135 [struct file_lock *lock;
1137 lock = posix_test_lock(file, lock);],
1138 ac_cv_linux_posix_test_lock_returns_conflict=yes,
1139 ac_cv_linux_posix_test_lock_returns_conflict=no)])
1140 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_returns_conflict)
1141 if test "x$ac_cv_linux_posix_test_lock_returns_conflict" = "xyes"; then
1142 AC_DEFINE([POSIX_TEST_LOCK_RETURNS_CONFLICT], 1, [define if posix_test_lock returns the conflicting lock])
1145 AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
1146 AC_MSG_CHECKING([if posix_test_lock takes a conflict argument])
1147 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_conflict_arg], [
1149 [#include <linux/fs.h>],
1150 [ struct file_lock *lock;
1152 posix_test_lock(file, lock, lock);],
1153 ac_cv_linux_posix_test_lock_conflict_arg=yes,
1154 ac_cv_lonuc_posix_test_lock_conflict_arg=no)])
1155 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_conflict_arg)
1156 if test "x$ac_cv_linux_posix_test_lock_conflict_arg" = "xyes"; then
1157 AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
1160 AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
1161 AC_MSG_CHECKING([for exported key_type_keyring])
1162 AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
1165 #ifdef KEY_TYPE_H_EXISTS
1166 #include <linux/key-type.h>
1168 #include <linux/key.h>],
1170 printk("%s", key_type_keyring.name);
1172 ac_cv_linux_exports_key_type_keyring=yes,
1173 ac_cv_linux_exports_key_type_keyring=no)])
1174 AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
1175 if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
1176 AC_DEFINE([EXPORTED_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
1179 AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [
1180 AC_MSG_CHECKING([for KEYCTL_SESSION_TO_PARENT])
1181 AC_CACHE_VAL([ac_cv_linux_have_session_to_parent], [
1183 [ #include <linux/keyctl.h>],
1184 [ int i = KEYCTL_SESSION_TO_PARENT;],
1185 ac_cv_linux_have_session_to_parent=yes,
1186 ac_cv_linux_have_session_to_parent=no)])
1187 AC_MSG_RESULT($ac_cv_linux_have_session_to_parent)
1188 if test "x$ac_cv_linux_have_session_to_parent" = "xyes"; then
1189 AC_DEFINE([HAVE_SESSION_TO_PARENT], 1, [define if keyctl has the KEYCTL_SESSION_TO_PARENT function])
1192 AC_DEFUN([LINUX_STRUCT_SUPER_BLOCK_HAS_S_BDI], [
1193 AC_MSG_CHECKING([if struct super_block has s_bdi])
1194 AC_CACHE_VAL([ac_cv_linux_struct_super_block_has_s_bdi], [
1196 [#include <linux/fs.h>],
1197 [struct super_block _sb;
1199 ac_cv_linux_struct_super_block_has_s_bdi=yes,
1200 ac_cv_linux_struct_super_block_has_s_bdi=no)])
1201 AC_MSG_RESULT($ac_cv_linux_struct_super_block_has_s_bdi)
1202 if test "x$ac_cv_linux_struct_super_block_has_s_bdi" = "xyes"; then
1203 AC_DEFINE([STRUCT_SUPER_BLOCK_HAS_S_BDI], 1, [define if struct super_block has an s_bdi member])
1206 AC_DEFUN([LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME], [
1207 AC_MSG_CHECKING([if struct ctl_table has ctl_name])
1208 AC_CACHE_VAL([ac_cv_linux_struct_ctl_table_has_ctl_name], [
1210 [#include <linux/sysctl.h>],
1211 [struct ctl_table _t;
1213 ac_cv_linux_struct_ctl_table_has_ctl_name=yes,
1214 ac_cv_linux_struct_ctl_table_has_ctl_name=no)])
1215 AC_MSG_RESULT($ac_cv_linux_struct_ctl_table_has_ctl_name)
1216 if test "x$ac_cv_linux_struct_ctl_table_has_ctl_name" = "xyes"; then
1217 AC_DEFINE([STRUCT_CTL_TABLE_HAS_CTL_NAME], 1, [define if struct ctl_table has a ctl_name member])
1220 AC_DEFUN([LINUX_STRUCT_BDI_HAS_NAME], [
1221 AC_MSG_CHECKING([if struct backing_dev_info has name])
1222 AC_CACHE_VAL([ac_cv_linux_struct_bdi_has_name], [
1224 [#include <linux/backing-dev.h>],
1225 [struct backing_dev_info _bdi;
1227 ac_cv_linux_struct_bdi_has_name=yes,
1228 ac_cv_linux_struct_bdi_has_name=no)])
1229 AC_MSG_RESULT($ac_cv_linux_struct_bdi_has_name)
1230 if test "x$ac_cv_linux_struct_bdi_has_name" = "xyes"; then
1231 AC_DEFINE([STRUCT_BDI_HAS_NAME], 1, [define if struct backing_dev_info has a name member])