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_COMPLETION_H_EXISTS], [
17 AC_CACHE_CHECK([for linux/completion.h], [ac_cv_linux_completion_h_exists],
19 [#include <linux/version.h>
20 #include <linux/completion.h>],
21 [struct completion _c;
22 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
25 ac_cv_linux_completion_h_exists=yes,
26 ac_cv_linux_completion_h_exists=no)])
27 AS_IF([test "x$ac_linux_completion_h_exists" = xyes],
28 [AC_DEFINE(HAVE_LINUX_COMPLETION_H, 1,
29 [Define if your kernel has a usable linux/completion.h])])
32 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
33 AC_MSG_CHECKING([for defined for_each_process])
34 AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
36 [#include <linux/sched.h>],
37 [#ifndef for_each_process
38 #error for_each_process not defined
40 ac_cv_linux_defines_for_each_process=yes,
41 ac_cv_linux_defines_for_each_process=no)])
42 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
45 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
46 AC_MSG_CHECKING([for defined prev_task])
47 AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
49 [#include <linux/sched.h>],
51 #error prev_task not defined
53 ac_cv_linux_defines_prev_task=yes,
54 ac_cv_linux_defines_prev_task=no)])
55 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
58 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
59 AC_MSG_CHECKING([for exported init_mm])
60 AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
62 [extern struct mm_struct init_mm;],
63 [void *address = &init_mm;
64 printk("%p\n", address);],
65 ac_cv_linux_exports_init_mm=yes,
66 ac_cv_linux_exports_init_mm=no)])
67 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
70 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
71 AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
72 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
74 [#include <linux/modversions.h>],
75 [#ifndef __ver_kallsyms_address_to_symbol
76 #error kallsyms_address_to_symbol not exported
78 ac_cv_linux_exports_kallsyms_address=yes,
79 ac_cv_linux_exports_kallsyms_address=no)])
80 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
83 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
84 AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
85 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
87 [#include <linux/modversions.h>],
88 [#ifndef __ver_kallsyms_symbol_to_address
89 #error kallsyms_symbol_to_address not exported
91 ac_cv_linux_exports_kallsyms_symbol=yes,
92 ac_cv_linux_exports_kallsyms_symbol=no)])
93 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
95 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
96 AC_MSG_CHECKING([for exported sys_call_table])
97 AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
99 [#include <linux/modversions.h>],
100 [#ifndef __ver_sys_call_table
101 #error sys_call_table not exported
103 ac_cv_linux_exports_sys_call_table=yes,
104 ac_cv_linux_exports_sys_call_table=no)])
105 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
108 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
109 AC_MSG_CHECKING([for exported ia32_sys_call_table])
110 AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
112 [#include <linux/modversions.h>],
113 [#ifndef __ver_ia32_sys_call_table
114 #error ia32_sys_call_table not exported
116 ac_cv_linux_exports_ia32_sys_call_table=yes,
117 ac_cv_linux_exports_ia32_sys_call_table=no)])
118 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
121 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
122 AC_MSG_CHECKING([for exported sys_chdir])
123 AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
125 [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
126 [void *address = &sys_chdir;
127 printk("%p\n", address);],
128 ac_cv_linux_exports_sys_chdir=yes,
129 ac_cv_linux_exports_sys_chdir=no)])
130 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
132 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
133 AC_MSG_CHECKING([for exported sys_open])
134 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
136 [extern asmlinkage long sys_open(void) __attribute__((weak));],
137 [void *address = &sys_open;
138 printk("%p\n", address);],
139 ac_cv_linux_exports_sys_open=yes,
140 ac_cv_linux_exports_sys_open=no)])
141 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
144 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE], [
145 AC_MSG_CHECKING([for i_blksize in struct inode])
146 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blksize], [
148 [#include <linux/fs.h>],
149 [struct inode _inode;
150 printk("%d\n", _inode.i_blksize);],
151 ac_cv_linux_fs_struct_inode_has_i_blksize=yes,
152 ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
153 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
155 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [
156 AC_MSG_CHECKING([for i_blkbits in struct inode])
157 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
159 [#include <linux/fs.h>],
160 [struct inode _inode;
161 printk("%d\n", _inode.i_blkbits);],
162 ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
163 ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
164 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
165 if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
166 AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
170 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
171 AC_MSG_CHECKING([for i_cdev in struct inode])
172 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
174 [#include <linux/fs.h>],
175 [struct inode _inode;
176 printk("%d\n", _inode.i_cdev);],
177 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
178 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
179 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
182 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
183 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
184 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
186 [#include <linux/fs.h>],
187 [struct inode _inode;
188 printk("%d\n", _inode.i_mapping_overload);],
189 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
190 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
191 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
194 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
195 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
196 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
198 [#include <linux/fs.h>],
199 [struct inode _inode;
200 printk("%d\n", _inode.i_mmap_shared);],
201 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
202 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
203 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
206 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
207 AC_MSG_CHECKING([for i_mutex in struct inode])
208 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
210 [#include <linux/fs.h>],
211 [struct inode _inode;
212 printk("%d\n", _inode.i_mutex);],
213 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
214 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
215 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
218 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
219 AC_MSG_CHECKING([for i_security in struct inode])
220 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
222 [#include <linux/fs.h>],
223 [struct inode _inode;
224 printk("%d\n", _inode.i_security);],
225 ac_cv_linux_fs_struct_inode_has_i_security=yes,
226 ac_cv_linux_fs_struct_inode_has_i_security=no)])
227 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
230 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
231 AC_MSG_CHECKING([for recalc_sigpending arg type])
232 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
234 [#include <linux/sched.h>],
235 [recalc_sigpending();],
236 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
237 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
238 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
241 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
242 AC_MSG_CHECKING([for parent in struct task_struct])
243 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
245 [#include <linux/sched.h>],
246 [struct task_struct _tsk;
247 printk("%d\n", _tsk.parent);],
248 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
249 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
250 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
253 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
254 AC_MSG_CHECKING([for tgid in struct task_struct])
255 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
257 [#include <linux/sched.h>],
258 [struct task_struct _tsk;
259 printk("%d\n", _tsk.tgid);],
260 ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
261 ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
262 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
265 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
266 AC_MSG_CHECKING([for real_parent in struct task_struct])
267 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
269 [#include <linux/sched.h>],
270 [struct task_struct _tsk;
271 printk("%d\n", _tsk.real_parent);],
272 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
273 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
274 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
277 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
278 AC_MSG_CHECKING([for sig in struct task_struct])
279 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
281 [#include <linux/sched.h>],
282 [struct task_struct _tsk;
283 printk("%d\n", _tsk.sig);],
284 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
285 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
286 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
289 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
290 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
291 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
293 [#include <linux/sched.h>],
294 [struct task_struct _tsk;
295 printk("%d\n", _tsk.sigmask_lock);],
296 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
297 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
298 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
301 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
302 AC_MSG_CHECKING([for sighand in struct task_struct])
303 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
305 [#include <linux/sched.h>],
306 [struct task_struct _tsk;
307 printk("%d\n", _tsk.sighand);],
308 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
309 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
310 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
313 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
314 AC_MSG_CHECKING([for rlim in struct task_struct])
315 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
317 [#include <linux/sched.h>],
318 [struct task_struct _tsk;
319 printk("%d\n", _tsk.rlim);],
320 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
321 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
322 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
325 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
326 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
327 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
329 [#include <linux/sched.h>],
330 [struct task_struct _tsk;
331 printk("%d\n", _tsk.signal->rlim);],
332 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
333 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
334 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
337 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
338 AC_MSG_CHECKING([for exit_state in struct task_struct])
339 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
341 [#include <linux/sched.h>],
342 [struct task_struct _tsk;
343 printk("%d\n", _tsk.exit_state);],
344 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
345 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
346 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
349 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO], [
350 AC_MSG_CHECKING([for thread_info in struct task_struct])
351 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_thread_info], [
353 [#include <linux/sched.h>],
354 [struct task_struct _tsk;
355 printk("%d\n", _tsk.thread_info);],
356 ac_cv_linux_sched_struct_task_struct_has_thread_info=yes,
357 ac_cv_linux_sched_struct_task_struct_has_thread_info=no)])
358 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_thread_info)])
361 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
362 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
363 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
365 [#include <linux/fs.h>],
366 [struct super_operations _super;
367 printk("%p\n", _super.alloc_inode);],
368 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
369 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
370 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
373 AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
374 AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels])
375 AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [
377 [#include <linux/fs.h>],
378 [posix_lock_file(0,0,0);],
379 ac_cv_linux_kernel_posix_lock_file_wait_arg=yes,
380 ac_cv_linux_kernel_posix_lock_file_wait_arg=no)])
381 AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)])
383 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
384 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
385 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
387 [#include <linux/net.h>],
388 [sock_create(0,0,0,0,0);],
389 ac_cv_linux_kernel_sock_create_v=yes,
390 ac_cv_linux_kernel_sock_create_v=no)])
391 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
394 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
395 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
396 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
397 save_CPPFLAGS="$CPPFLAGS"
398 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
400 [#include <linux/fs.h>],
401 [page_follow_link(0,0);],
402 ac_cv_linux_kernel_page_follow_link=yes,
403 ac_cv_linux_kernel_page_follow_link=no)
404 CPPFLAGS="$save_CPPFLAGS"])
405 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
407 AC_DEFUN([LINUX_KERNEL_HLIST_UNHASHED], [
408 AC_MSG_CHECKING([for hlist_unhashed])
409 AC_CACHE_VAL([ac_cv_linux_kernel_hlist_unhashed], [
410 save_CPPFLAGS="$CPPFLAGS"
411 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
413 [#include <linux/list.h>],
414 [hlist_unhashed(0);],
415 ac_cv_linux_kernel_hlist_unhashed=yes,
416 ac_cv_linux_kernel_hlist_unhashed=no)
417 CPPFLAGS="$save_CPPFLAGS"])
418 AC_MSG_RESULT($ac_cv_linux_kernel_hlist_unhashed)])
421 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
422 AC_MSG_CHECKING([for i_bytes in struct inode])
423 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
425 [#include <linux/fs.h>],
426 [struct inode _inode;
427 printk("%d\n", _inode.i_bytes);],
428 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
429 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
430 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
433 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
434 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
435 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
437 [#include <linux/fs.h>],
439 printk("%x\n", _i.i_alloc_sem);],
440 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
441 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
442 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
445 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
446 AC_MSG_CHECKING([for inode_setattr return type])
447 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
449 [#include <linux/fs.h>],
450 [struct inode _inode;
453 i = inode_setattr(&_inode, &_iattr);],
454 ac_cv_linux_func_inode_setattr_returns_int=yes,
455 ac_cv_linux_func_inode_setattr_returns_int=no)])
456 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
459 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
460 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
461 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
463 [#include <linux/fs.h>
464 #include <linux/mm.h>
465 #include <linux/writeback.h>],
466 [struct address_space_operations _aops;
468 struct writeback_control _writeback_control;
469 (void)_aops.writepage(&_page, &_writeback_control);],
470 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
471 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
472 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
475 AC_DEFUN([LINUX_REFRIGERATOR], [
476 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
477 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
479 [#include <linux/sched.h>
480 #ifdef HAVE_LINUX_FREEZER_H
481 #include <linux/freezer.h>
483 [refrigerator(PF_FREEZE);],
484 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
485 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
486 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)
487 if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes"; then
488 AC_DEFINE([LINUX_REFRIGERATOR_TAKES_PF_FREEZE], 1, [define if your refrigerator takes PF_FREEZE])
491 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
492 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
493 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
495 [#include <linux/fs.h>
496 #include <linux/namei.h>],
497 [struct inode _inode;
498 struct dentry _dentry;
499 struct nameidata _nameidata;
500 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
501 ac_cv_linux_func_i_create_takes_nameidata=yes,
502 ac_cv_linux_func_i_create_takes_nameidata=no)])
503 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
506 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
507 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
508 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
510 [#include <linux/fs.h>
511 #include <linux/namei.h>],
512 [struct inode _inode;
513 struct dentry _dentry;
514 struct nameidata _nameidata;
515 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
516 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
517 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
518 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
521 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
522 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
523 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
525 [#include <linux/fs.h>
526 #include <linux/namei.h>],
527 [struct inode _inode;
528 struct dentry _dentry;
529 struct nameidata _nameidata;
530 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
531 ac_cv_linux_func_i_permission_takes_nameidata=yes,
532 ac_cv_linux_func_i_permission_takes_nameidata=no)])
533 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
536 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
537 AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
538 AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
540 [#include <linux/fs.h>
541 #include <linux/namei.h>],
542 [struct inode _inode;
543 struct dentry _dentry;
544 struct nameidata _nameidata;
546 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
547 ac_cv_linux_func_i_put_link_takes_cookie=yes,
548 ac_cv_linux_func_i_put_link_takes_cookie=no)])
549 AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
552 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
553 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
554 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
556 [#include <linux/fs.h>
557 #include <linux/namei.h>],
558 [struct dentry _dentry;
559 struct nameidata _nameidata;
560 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
561 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
562 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
563 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
565 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
566 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
567 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
569 [#include <linux/fs.h>],
570 [get_sb_nodev(0,0,0,0,0);],
571 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
572 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
573 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
575 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
576 AC_MSG_CHECKING([for dentry in statfs])
577 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
579 [#include <linux/fs.h>
580 #include <linux/statfs.h>],
582 extern int vfs_statfs(struct dentry *, struct kstatfs *);
584 ac_cv_linux_statfs_takes_dentry=yes,
585 ac_cv_linux_statfs_takes_dentry=no)])
586 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
589 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
590 AC_MSG_CHECKING([for linux kernel keyring support])
591 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
593 [#include <linux/rwsem.h>
594 #ifdef HAVE_LINUX_KEY_TYPE_H
595 #include <linux/key-type.h>
597 #include <linux/key.h>
598 #include <linux/keyctl.h>],
600 request_key(NULL, NULL, NULL);
601 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
602 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
605 #error rebuild your kernel with CONFIG_KEYS
607 ac_cv_linux_keyring_support=yes,
608 ac_cv_linux_keyring_support=no)])
609 AC_MSG_RESULT($ac_cv_linux_keyring_support)
610 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
611 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
614 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
615 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
616 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
617 save_CPPFLAGS="$CPPFLAGS"
618 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
620 [#include <linux/rwsem.h>
621 #include <linux/key.h>
623 [struct task_struct *t=NULL;
624 (void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
625 ac_cv_key_alloc_needs_struct_task=yes,
626 ac_cv_key_alloc_needs_struct_task=no)
627 CPPFLAGS="$save_CPPFLAGS"])
628 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
629 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
630 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
633 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
634 AC_MSG_CHECKING([if key_alloc() takes credentials])
635 AC_CACHE_VAL([ac_cv_key_alloc_needs_cred], [
636 save_CPPFLAGS="$CPPFLAGS"
637 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
639 [#include <linux/rwsem.h>
640 #include <linux/key.h>
642 [struct cred *c = NULL;
643 (void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
644 ac_cv_key_alloc_needs_cred=yes,
645 ac_cv_key_alloc_needs_cred=no)
646 CPPFLAGS="$save_CPPFLAGS"])
647 AC_MSG_RESULT($ac_cv_key_alloc_needs_cred)
648 if test "x$ac_cv_key_alloc_needs_cred" = "xyes"; then
649 AC_DEFINE([KEY_ALLOC_NEEDS_CRED], 1, [define if key_alloc takes credentials])
652 AC_DEFUN([LINUX_DO_SYNC_READ], [
653 AC_MSG_CHECKING([for linux do_sync_read()])
654 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
655 save_CPPFLAGS="$CPPFLAGS"
656 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
658 [#include <linux/fs.h>],
659 [do_sync_read(NULL, NULL, 0, NULL);],
660 ac_cv_linux_do_sync_read=yes,
661 ac_cv_linux_do_sync_read=no)
662 CPPFLAGS="$save_CPPFLAGS"])
663 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
664 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
665 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
668 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
669 AC_MSG_CHECKING([for linux generic_file_aio_read()])
670 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
671 save_CPPFLAGS="$CPPFLAGS"
672 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
674 [#include <linux/fs.h>],
675 [generic_file_aio_read(NULL, NULL, 0, 0);],
676 ac_cv_linux_generic_file_aio_read=yes,
677 ac_cv_linux_generic_file_aio_read=no)
678 CPPFLAGS="$save_CPPFLAGS"])
679 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
680 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
681 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
684 AC_DEFUN([LINUX_HAVE_I_SIZE_READ], [
685 AC_MSG_CHECKING([for linux i_size_read()])
686 AC_CACHE_VAL([ac_cv_linux_i_size_read], [
687 save_CPPFLAGS="$CPPFLAGS"
688 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
690 [#include <linux/fs.h>],
691 [i_size_read(NULL);],
692 ac_cv_linux_i_size_read=yes,
693 ac_cv_linux_i_size_read=no)
694 CPPFLAGS="$save_CPPFLAGS"])
695 AC_MSG_RESULT($ac_cv_linux_i_size_read)
696 if test "x$ac_cv_linux_i_size_read" = "xyes"; then
697 AC_DEFINE([HAVE_LINUX_I_SIZE_READ], 1, [define if your kernel has i_size_read()])
700 AC_DEFUN([LINUX_HAVE_D_ALLOC_ANON], [
701 AC_MSG_CHECKING([for linux d_alloc_anon()])
702 AC_CACHE_VAL([ac_cv_linux_d_alloc_anon], [
703 save_CPPFLAGS="$CPPFLAGS"
704 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
706 [#include <linux/dcache.h>],
707 [d_alloc_anon(NULL);],
708 ac_cv_linux_d_alloc_anon=yes,
709 ac_cv_linux_d_alloc_anon=no)
710 CPPFLAGS="$save_CPPFLAGS"])
711 AC_MSG_RESULT($ac_cv_linux_d_alloc_anon)
712 if test "x$ac_cv_linux_d_alloc_anon" = "xyes"; then
713 AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()])
716 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
717 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
718 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
720 [#include <linux/kernel.h>
721 #include <linux/workqueue.h>],
723 void f(struct work_struct *w) {}
724 struct work_struct *w;
727 ac_cv_linux_init_work_has_data=yes,
728 ac_cv_linux_init_work_has_data=no)])
729 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
732 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
733 AC_MSG_CHECKING([for flock in struct file_operations])
734 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
736 [#include <linux/fs.h>],
737 [struct file_operations _fop;
738 _fop.flock(NULL, 0, NULL);],
739 ac_cv_linux_fs_struct_fop_has_flock=yes,
740 ac_cv_linux_fs_struct_fop_has_flock=no)])
741 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])
743 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
744 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
745 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
747 [#include <linux/sysctl.h>],
749 register_sysctl_table (t);],
750 ac_cv_linux_register_sysctl_table_noflag=yes,
751 ac_cv_linux_register_sysctl_table_noflag=no)])
752 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
754 AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
755 AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
756 AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
758 [#include <linux/fs.h>],
759 [struct inode _inode;
762 (void)_inode.i_fop->flush(&_file, &id);],
763 ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
764 ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
765 AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
767 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
768 AC_MSG_CHECKING([whether kmem_cache_t exists])
769 AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
771 [#include <linux/slab.h>],
773 ac_cv_linux_have_kmem_cache_t=yes,
774 ac_cv_linux_have_kmem_cache_t=no)])
775 AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
777 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
778 AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
779 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
781 [#include <linux/slab.h>],
782 [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
783 ac_cv_linux_kmem_cache_create_takes_dtor=yes,
784 ac_cv_linux_kmem_cache_create_takes_dtor=no)])
785 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
787 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID], [
788 AC_MSG_CHECKING([whether kmem_cache_create constructor function takes a void pointer argument])
789 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_ctor_takes_void], [
790 save_CPPFLAGS="$CPPFLAGS"
791 CPPFLAGS="$CPPFLAGS -Werror"
793 [#include <linux/slab.h>],
794 [void _ctor(void *v) { };
795 kmem_cache_create(NULL, 0, 0, 0, _ctor);],
796 ac_cv_linux_kmem_cache_create_ctor_takes_void=yes,
797 ac_cv_linux_kmem_cache_create_ctor_takes_void=no)
798 CPPFLAGS="$save_CPPFLAGS"
800 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_ctor_takes_void)
801 if test "x$ac_cv_linux_kmem_cache_create_ctor_takes_void" = "xyes"; then
802 AC_DEFINE([KMEM_CACHE_CTOR_TAKES_VOID], 1, [define if kmem_cache_create constructor function takes a single void pointer argument])
805 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SENDFILE], [
806 AC_MSG_CHECKING([for sendfile in struct file_operations])
807 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_sendfile], [
809 [#include <linux/fs.h>],
810 [struct file_operations _fop;
811 _fop.sendfile(NULL, NULL, 0, 0, NULL);],
812 ac_cv_linux_fs_struct_fop_has_sendfile=yes,
813 ac_cv_linux_fs_struct_fop_has_sendfile=no)])
814 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
816 AC_DEFUN([LINUX_HAVE_SVC_ADDR_IN], [
817 AC_MSG_CHECKING([whether svc_addr_in exists])
818 AC_CACHE_VAL([ac_cv_linux_have_svc_addr_in], [
820 [#include <linux/sunrpc/svc.h>],
821 [svc_addr_in(NULL);],
822 ac_cv_linux_have_svc_addr_in=yes,
823 ac_cv_linux_have_svc_addr_in=no)])
824 AC_MSG_RESULT($ac_cv_linux_have_svc_addr_in)])
826 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
827 AC_MSG_CHECKING([for splice_write and splice_read in struct file_operations])
828 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_splice], [
830 [#include <linux/fs.h>],
831 [struct file_operations _fop;
832 _fop.splice_write(NULL, NULL, NULL, 0, 0);
833 _fop.splice_read(NULL, NULL, NULL, 0, 0);],
834 ac_cv_linux_fs_struct_fop_has_splice=yes,
835 ac_cv_linux_fs_struct_fop_has_splice=no)])
836 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)])
838 AC_DEFUN([LINUX_HAVE_CURRENT_KERNEL_TIME], [
839 AC_MSG_CHECKING([for current_kernel_time()])
840 AC_CACHE_VAL([ac_cv_linux_have_current_kernel_time], [
842 [#include <linux/time.h>],
843 [struct timespec s = current_kernel_time();],
844 ac_cv_linux_have_current_kernel_time=yes,
845 ac_cv_linux_have_current_kernel_time=no)])
846 AC_MSG_RESULT($ac_cv_linux_have_current_kernel_time)])
848 AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
849 AC_MSG_CHECKING([for new kmem_cache init function parameters])
850 AC_CACHE_VAL([ac_cv_linux_kmem_cache_init], [
852 [#include <linux/slab.h>],
853 [extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
855 void (*)(struct kmem_cache *, void *));
857 ac_cv_linux_kmem_cache_init=yes,
858 ac_cv_linux_kmem_cache_init=no)])
859 AC_MSG_RESULT($ac_cv_linux_kmem_cache_init)])
861 AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
862 AC_MSG_CHECKING([for sysctl table checking])
863 AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
865 [#include <linux/sysctl.h>],
866 [ extern int sysctl_check_table(int) __attribute__((weak));
867 sysctl_check_table(NULL);],
868 ac_cv_linux_sysctl_table_checking=no,
869 ac_cv_linux_sysctl_table_checking=yes)])
870 AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
872 AC_DEFUN([LINUX_HAVE_IGET], [
873 AC_MSG_CHECKING([for linux iget()])
874 AC_CACHE_VAL([ac_cv_linux_have_iget], [
875 save_CPPFLAGS="$CPPFLAGS"
876 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
878 [#include <linux/fs.h>],
880 ac_cv_linux_have_iget=yes,
881 ac_cv_linux_have_iget=no)
882 CPPFLAGS="$save_CPPFLAGS"])
883 AC_MSG_RESULT($ac_cv_linux_have_iget)])
885 AC_DEFUN([LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH], [
886 AC_MSG_CHECKING([for path in struct nameidata])
887 AC_CACHE_VAL([ac_cv_linux_struct_nameidata_has_path], [
889 [#include <linux/namei.h>],
890 [struct nameidata _nd;
891 printk("%x\n", _nd.path);],
892 ac_cv_linux_struct_nameidata_has_path=yes,
893 ac_cv_linux_struct_nameidata_has_path=no)])
894 AC_MSG_RESULT($ac_cv_linux_struct_nameidata_has_path)])
896 AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
897 AC_MSG_CHECKING([if rcu_read_lock is usable])
898 AC_CACHE_VAL([ac_cv_linux_exports_rcu_read_lock], [
900 [#include <linux/rcupdate.h>],
902 ac_cv_linux_exports_rcu_read_lock=yes,
903 ac_cv_linux_exports_rcu_read_lock=no)])
904 AC_MSG_RESULT($ac_cv_linux_exports_rcu_read_lock)
905 if test "x$ac_cv_linux_exports_rcu_read_lock" = "xyes"; then
906 AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
909 AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [
910 AC_MSG_CHECKING([if find_task_by_pid is usable])
911 AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [
913 [#include <linux/sched.h>],
915 find_task_by_pid(p);],
916 ac_cv_linux_exports_find_task_by_pid=yes,
917 ac_cv_linux_exports_find_task_by_pid=no)])
918 AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
919 if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then
920 AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable])
923 AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
924 AC_MSG_CHECKING([if proc_root_fs is defined and exported])
925 AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [
927 [#include <linux/proc_fs.h>],
928 [struct proc_dir_entry *p = proc_root_fs;],
929 ac_cv_linux_exports_proc_root_fs=yes,
930 ac_cv_linux_exports_proc_root_fs=no)])
931 AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs)
932 if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then
933 AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
936 AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
937 AC_MSG_CHECKING([if d_path() takes a struct path argument])
938 AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
940 [#include <linux/dcache.h>],
942 d_path(p, NULL, 0);],
943 ac_cv_linux_d_path_takes_struct_path=yes,
944 ac_cv_linux_d_path_takes_struct_path=no)])
945 AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
946 if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
947 AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
950 AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
951 AC_MSG_CHECKING([if kernel uses new export ops])
952 AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
954 [#include <linux/exportfs.h>],
955 [struct export_operations _eops;
956 _eops.fh_to_parent(NULL, NULL, 0, 0);],
957 ac_cv_linux_new_export_ops=yes,
958 ac_cv_linux_new_export_ops=no)])
959 AC_MSG_RESULT($ac_cv_linux_new_export_ops)
960 if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
961 AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
964 AC_DEFUN([LINUX_HAVE_BDI_INIT], [
965 AC_MSG_CHECKING([for linux bdi_init()])
966 AC_CACHE_VAL([ac_cv_linux_bdi_init], [
968 [#include <linux/backing-dev.h>],
970 ac_cv_linux_bdi_init=yes,
971 ac_cv_linux_bdi_init=no)])
972 AC_MSG_RESULT($ac_cv_linux_bdi_init)
973 if test "x$ac_cv_linux_bdi_init" = "xyes"; then
974 AC_DEFINE([HAVE_BDI_INIT], 1, [define if your kernel has a bdi_init()])
977 AC_DEFUN([LINUX_HAVE_WRITE_BEGIN_AOP], [
978 AC_MSG_CHECKING([for linux write_begin() address space op])
979 AC_CACHE_VAL([ac_cv_linux_write_begin], [
981 [#include <linux/fs.h>],
982 [struct address_space_operations _aop;
983 _aop.write_begin = NULL;],
984 ac_cv_linux_write_begin=yes,
985 ac_cv_linux_write_begin=no)])
986 AC_MSG_RESULT($ac_cv_linux_write_begin)
987 if test "x$ac_cv_linux_write_begin" = "xyes"; then
988 AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
991 AC_DEFUN([LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], [
992 AC_MSG_CHECKING([for linux grab_cache_page_write_begin()])
993 AC_CACHE_VAL([ac_cv_linux_grab_cache_page_write_begin], [
995 [#include <linux/pagemap.h>],
996 [grab_cache_page_write_begin(NULL, 0, 0);],
997 ac_cv_linux_grab_cache_page_write_begin=yes,
998 ac_cv_linux_grab_cache_page_write_begin=no)])
999 AC_MSG_RESULT($ac_cv_linux_grab_cache_page_write_begin)
1000 if test "x$ac_cv_linux_grab_cache_page_write_begin" = "xyes"; then
1001 AC_DEFINE([HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], 1, [define if your kernel has grab_cache_page_write_begin()])
1004 AC_DEFUN([LINUX_HAVE_PAGEVEC_LRU_ADD_FILE], [
1005 AC_MSG_CHECKING([for linux __pagevec_lru_add_file()])
1006 AC_CACHE_VAL([ac_cv_linux_pagevec_add_file], [
1008 [#include <linux/pagevec.h>],
1009 [__pagevec_lru_add_file(NULL);],
1010 ac_cv_linux_pagevec_add_file=yes,
1011 ac_cv_linux_pagevec_add_file=no)])
1012 AC_MSG_RESULT($ac_cv_linux_pagevec_add_file)
1013 if test "x$ac_cv_linux_pagevec_add_file" = "xyes"; then
1014 AC_DEFINE([HAVE_PAGEVEC_LRU_ADD_FILE], 1, [define if your kernel has __pagevec_lru_add_file()])
1017 AC_DEFUN([LINUX_HAVE_SPLICE_DIRECT_TO_ACTOR], [
1018 AC_MSG_CHECKING([for linux splice_direct_to_actor()])
1019 AC_CACHE_VAL([ac_cv_linux_splice_direct_to_actor], [
1021 [#include <linux/splice.h>],
1022 [splice_direct_to_actor(NULL,NULL,NULL);],
1023 ac_cv_linux_splice_direct_to_actor=yes,
1024 ac_cv_linux_splice_direct_to_actor=no)])
1025 AC_MSG_RESULT($ac_cv_linux_splice_direct_to_actor)
1026 if test "x$ac_cv_linux_splice_direct_to_actor" = "xyes"; then
1027 AC_DEFINE([HAVE_SPLICE_DIRECT_TO_ACTOR], 1, [define if your kernel has splice_direct_to_actor()])
1030 AC_DEFUN([LINUX_STRUCT_TASK_HAS_CRED], [
1031 AC_MSG_CHECKING([if struct task has cred])
1032 AC_CACHE_VAL([ac_cv_linux_struct_task_has_cred], [
1034 [#include <linux/sched.h>
1035 #include <linux/cred.h>],
1036 [struct task_struct _t;
1038 _u =_t.cred->uid ;],
1039 ac_cv_linux_struct_task_has_cred=yes,
1040 ac_cv_linux_struct_task_has_cred=no)])
1041 AC_MSG_RESULT($ac_cv_linux_struct_task_has_cred)
1042 if test "x$ac_cv_linux_struct_task_has_cred" = "xyes"; then
1043 AC_DEFINE([STRUCT_TASK_HAS_CRED], 1, [define if struct task has a cred pointer])
1046 AC_DEFUN([LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER], [
1047 AC_MSG_CHECKING([if struct proc_dir_entry_has_owner])
1048 AC_CACHE_VAL([ac_cv_linux_struct_proc_dir_entry_has_owner], [
1050 [#include <linux/proc_fs.h>],
1051 [struct proc_dir_entry _p;
1053 ac_cv_linux_struct_proc_dir_entry_has_owner=yes,
1054 ac_cv_linux_struct_proc_dir_entry_has_owner=no)])
1055 AC_MSG_RESULT($ac_cv_linux_struct_proc_dir_entry_has_owner)
1056 if test "x$ac_cv_linux_struct_proc_dir_entry_has_owner" = "xyes"; then
1057 AC_DEFINE([STRUCT_PROC_DIR_ENTRY_HAS_OWNER], 1, [define if struct proc_dir_entry has an owner member])
1060 AC_DEFUN([LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT], [
1061 AC_MSG_CHECKING([if posix_test_lock returns a struct file_lock])
1062 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_returns_conflict], [
1064 [#include <linux/fs.h>],
1065 [struct file_lock *lock;
1067 lock = posix_test_lock(file, lock);],
1068 ac_cv_linux_posix_test_lock_returns_conflict=yes,
1069 ac_cv_linux_posix_test_lock_returns_conflict=no)])
1070 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_returns_conflict)
1071 if test "x$ac_cv_linux_posix_test_lock_returns_conflict" = "xyes"; then
1072 AC_DEFINE([POSIX_TEST_LOCK_RETURNS_CONFLICT], 1, [define if posix_test_lock returns the conflicting lock])
1075 AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
1076 AC_MSG_CHECKING([if posix_test_lock takes a conflict argument])
1077 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_conflict_arg], [
1079 [#include <linux/fs.h>],
1080 [ struct file_lock *lock;
1082 posix_test_lock(file, lock, lock);],
1083 ac_cv_linux_posix_test_lock_conflict_arg=yes,
1084 ac_cv_lonuc_posix_test_lock_conflict_arg=no)])
1085 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_conflict_arg)
1086 if test "x$ac_cv_linux_posix_test_lock_conflict_arg" = "xyes"; then
1087 AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
1090 AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
1091 AC_MSG_CHECKING([for exported key_type_keyring])
1092 AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
1095 #ifdef HAVE_LINUX_KEY_TYPE_H
1096 #include <linux/key-type.h>
1098 #include <linux/key.h>],
1100 printk("%s", key_type_keyring.name);
1102 ac_cv_linux_exports_key_type_keyring=yes,
1103 ac_cv_linux_exports_key_type_keyring=no)])
1104 AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
1105 if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
1106 AC_DEFINE([EXPORTED_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
1109 AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [
1110 AC_MSG_CHECKING([for KEYCTL_SESSION_TO_PARENT])
1111 AC_CACHE_VAL([ac_cv_linux_have_session_to_parent], [
1113 [ #include <linux/keyctl.h>],
1114 [ int i = KEYCTL_SESSION_TO_PARENT;],
1115 ac_cv_linux_have_session_to_parent=yes,
1116 ac_cv_linux_have_session_to_parent=no)])
1117 AC_MSG_RESULT($ac_cv_linux_have_session_to_parent)
1118 if test "x$ac_cv_linux_have_session_to_parent" = "xyes"; then
1119 AC_DEFINE([HAVE_SESSION_TO_PARENT], 1, [define if keyctl has the KEYCTL_SESSION_TO_PARENT function])
1122 AC_DEFUN([LINUX_STRUCT_SUPER_BLOCK_HAS_S_BDI], [
1123 AC_MSG_CHECKING([if struct super_block has s_bdi])
1124 AC_CACHE_VAL([ac_cv_linux_struct_super_block_has_s_bdi], [
1126 [#include <linux/fs.h>],
1127 [struct super_block _sb;
1129 ac_cv_linux_struct_super_block_has_s_bdi=yes,
1130 ac_cv_linux_struct_super_block_has_s_bdi=no)])
1131 AC_MSG_RESULT($ac_cv_linux_struct_super_block_has_s_bdi)
1132 if test "x$ac_cv_linux_struct_super_block_has_s_bdi" = "xyes"; then
1133 AC_DEFINE([STRUCT_SUPER_BLOCK_HAS_S_BDI], 1, [define if struct super_block has an s_bdi member])
1136 AC_DEFUN([LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME], [
1137 AC_MSG_CHECKING([if struct ctl_table has ctl_name])
1138 AC_CACHE_VAL([ac_cv_linux_struct_ctl_table_has_ctl_name], [
1140 [#include <linux/sysctl.h>],
1141 [struct ctl_table _t;
1143 ac_cv_linux_struct_ctl_table_has_ctl_name=yes,
1144 ac_cv_linux_struct_ctl_table_has_ctl_name=no)])
1145 AC_MSG_RESULT($ac_cv_linux_struct_ctl_table_has_ctl_name)
1146 if test "x$ac_cv_linux_struct_ctl_table_has_ctl_name" = "xyes"; then
1147 AC_DEFINE([STRUCT_CTL_TABLE_HAS_CTL_NAME], 1, [define if struct ctl_table has a ctl_name member])
1150 AC_DEFUN([LINUX_STRUCT_BDI_HAS_NAME], [
1151 AC_MSG_CHECKING([if struct backing_dev_info has name])
1152 AC_CACHE_VAL([ac_cv_linux_struct_bdi_has_name], [
1154 [#include <linux/backing-dev.h>],
1155 [struct backing_dev_info _bdi;
1157 ac_cv_linux_struct_bdi_has_name=yes,
1158 ac_cv_linux_struct_bdi_has_name=no)])
1159 AC_MSG_RESULT($ac_cv_linux_struct_bdi_has_name)
1160 if test "x$ac_cv_linux_struct_bdi_has_name" = "xyes"; then
1161 AC_DEFINE([STRUCT_BDI_HAS_NAME], 1, [define if struct backing_dev_info has a name member])
1164 AC_DEFUN([LINUX_HAVE_ZERO_USER_SEGMENTS], [
1165 AC_MSG_CHECKING([for zero_user_segments])
1166 AC_CACHE_VAL([ac_cv_linux_have_zero_user_segments], [
1168 [#include <linux/highmem.h>],
1169 [zero_user_segments(NULL, 0, 0, 0, 0);],
1170 ac_cv_linux_have_zero_user_segments=yes,
1171 ac_cv_linux_have_zero_user_segments=no)])
1172 AC_MSG_RESULT($ac_cv_linux_have_zero_user_segments)
1173 if test "x$ac_cv_linux_have_zero_user_segments" = "xyes"; then
1174 AC_DEFINE([HAVE_ZERO_USER_SEGMENTS], 1, [define if your kernel has the zero_user_segments function])
1177 AC_DEFUN([LINUX_HAVE_PAGE_OFFSET], [
1178 AC_MSG_CHECKING([for page_offset])
1179 AC_CACHE_VAL([ac_cv_linux_have_page_offset], [
1181 [#include <linux/pagemap.h>],
1182 [page_offset(NULL);],
1183 ac_cv_linux_have_page_offset=yes,
1184 ac_cv_linux_have_page_offset=no)])
1185 AC_MSG_RESULT($ac_cv_linux_have_page_offset)
1186 if test "x$ac_cv_linux_have_page_offset" = "xyes"; then
1187 AC_DEFINE([HAVE_PAGE_OFFSET], 1, [define if your kernel has the page_offset function])
1190 AC_DEFUN([LINUX_HAVE_VFS_LLSEEK], [
1191 AC_MSG_CHECKING([for vfs_llseek])
1192 AC_CACHE_VAL([ac_cv_linux_have_vfs_llseek], [
1194 [#include <linux/fs.h>],
1195 [vfs_llseek(NULL, 0, 0);],
1196 ac_cv_linux_have_vfs_llseek=yes,
1197 ac_cv_linux_have_vfs_llseek=no)])
1198 AC_MSG_RESULT($ac_cv_linux_have_vfs_llseek)
1199 if test "x$ac_cv_linux_have_vfs_llseek" = "xyes"; then
1200 AC_DEFINE([HAVE_VFS_LLSEEK], 1, [define if your kernel has the vfs_llseek function])
1203 AC_DEFUN([LINUX_HAVE_KERNEL_SETSOCKOPT], [
1204 AC_MSG_CHECKING([for kernel_setsockopt])
1205 AC_CACHE_VAL([ac_cv_linux_have_kernel_setsockopt], [
1207 [#include <linux/net.h>],
1208 [kernel_setsockopt(NULL, 0, 0, NULL, 0);],
1209 ac_cv_linux_have_kernel_setsockopt=yes,
1210 ac_cv_linux_have_kernel_setsockopt=no)])
1211 AC_MSG_RESULT($ac_cv_linux_have_kernel_setsockopt)
1212 if test "x$ac_cv_linux_have_kernel_setsockopt" = "xyes"; then
1213 AC_DEFINE([HAVE_KERNEL_SETSOCKOPT], 1, [define if your kernel has the kernel_setsockopt function])
1215 AC_DEFUN([LINUX_HAVE_TRY_TO_FREEZE], [
1216 AC_MSG_CHECKING([for try_to_freeze])
1217 AC_CACHE_VAL([ac_cv_linux_have_try_to_freeze], [
1219 [#include <linux/sched.h>
1220 #ifdef FREEZER_H_EXISTS
1221 #include <linux/freezer.h>
1223 [#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
1224 try_to_freeze(PF_FREEZE);
1229 ac_cv_linux_have_try_to_freeze=yes,
1230 ac_cv_linux_have_try_to_freeze=no)])
1231 AC_MSG_RESULT($ac_cv_linux_have_try_to_freeze)
1232 if test "x$ac_cv_linux_have_try_to_freeze" = "xyes"; then
1233 AC_DEFINE([HAVE_TRY_TO_FREEZE], 1, [define if your kernel has the try_to_freeze function])