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)])
489 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
490 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
491 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
493 [#include <linux/fs.h>
494 #include <linux/namei.h>],
495 [struct inode _inode;
496 struct dentry _dentry;
497 struct nameidata _nameidata;
498 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
499 ac_cv_linux_func_i_create_takes_nameidata=yes,
500 ac_cv_linux_func_i_create_takes_nameidata=no)])
501 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
504 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
505 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
506 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
508 [#include <linux/fs.h>
509 #include <linux/namei.h>],
510 [struct inode _inode;
511 struct dentry _dentry;
512 struct nameidata _nameidata;
513 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
514 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
515 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
516 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
519 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
520 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
521 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
523 [#include <linux/fs.h>
524 #include <linux/namei.h>],
525 [struct inode _inode;
526 struct dentry _dentry;
527 struct nameidata _nameidata;
528 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
529 ac_cv_linux_func_i_permission_takes_nameidata=yes,
530 ac_cv_linux_func_i_permission_takes_nameidata=no)])
531 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
534 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
535 AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
536 AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
538 [#include <linux/fs.h>
539 #include <linux/namei.h>],
540 [struct inode _inode;
541 struct dentry _dentry;
542 struct nameidata _nameidata;
544 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
545 ac_cv_linux_func_i_put_link_takes_cookie=yes,
546 ac_cv_linux_func_i_put_link_takes_cookie=no)])
547 AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
550 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
551 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
552 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
554 [#include <linux/fs.h>
555 #include <linux/namei.h>],
556 [struct dentry _dentry;
557 struct nameidata _nameidata;
558 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
559 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
560 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
561 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
563 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
564 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
565 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
567 [#include <linux/fs.h>],
568 [get_sb_nodev(0,0,0,0,0);],
569 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
570 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
571 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
573 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
574 AC_MSG_CHECKING([for dentry in statfs])
575 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
577 [#include <linux/fs.h>
578 #include <linux/statfs.h>],
580 extern int vfs_statfs(struct dentry *, struct kstatfs *);
582 ac_cv_linux_statfs_takes_dentry=yes,
583 ac_cv_linux_statfs_takes_dentry=no)])
584 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
587 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
588 AC_MSG_CHECKING([for linux kernel keyring support])
589 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
591 [#include <linux/rwsem.h>
592 #ifdef HAVE_LINUX_KEY_TYPE_H
593 #include <linux/key-type.h>
595 #include <linux/key.h>
596 #include <linux/keyctl.h>],
598 request_key(NULL, NULL, NULL);
599 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
600 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
603 #error rebuild your kernel with CONFIG_KEYS
605 ac_cv_linux_keyring_support=yes,
606 ac_cv_linux_keyring_support=no)])
607 AC_MSG_RESULT($ac_cv_linux_keyring_support)
608 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
609 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
612 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
613 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
614 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
615 save_CPPFLAGS="$CPPFLAGS"
616 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
618 [#include <linux/rwsem.h>
619 #include <linux/key.h>
621 [struct task_struct *t=NULL;
622 (void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
623 ac_cv_key_alloc_needs_struct_task=yes,
624 ac_cv_key_alloc_needs_struct_task=no)
625 CPPFLAGS="$save_CPPFLAGS"])
626 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
627 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
628 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
631 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
632 AC_MSG_CHECKING([if key_alloc() takes credentials])
633 AC_CACHE_VAL([ac_cv_key_alloc_needs_cred], [
634 save_CPPFLAGS="$CPPFLAGS"
635 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
637 [#include <linux/rwsem.h>
638 #include <linux/key.h>
640 [struct cred *c = NULL;
641 (void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
642 ac_cv_key_alloc_needs_cred=yes,
643 ac_cv_key_alloc_needs_cred=no)
644 CPPFLAGS="$save_CPPFLAGS"])
645 AC_MSG_RESULT($ac_cv_key_alloc_needs_cred)
646 if test "x$ac_cv_key_alloc_needs_cred" = "xyes"; then
647 AC_DEFINE([KEY_ALLOC_NEEDS_CRED], 1, [define if key_alloc takes credentials])
650 AC_DEFUN([LINUX_DO_SYNC_READ], [
651 AC_MSG_CHECKING([for linux do_sync_read()])
652 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
653 save_CPPFLAGS="$CPPFLAGS"
654 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
656 [#include <linux/fs.h>],
657 [do_sync_read(NULL, NULL, 0, NULL);],
658 ac_cv_linux_do_sync_read=yes,
659 ac_cv_linux_do_sync_read=no)
660 CPPFLAGS="$save_CPPFLAGS"])
661 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
662 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
663 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
666 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
667 AC_MSG_CHECKING([for linux generic_file_aio_read()])
668 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
669 save_CPPFLAGS="$CPPFLAGS"
670 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
672 [#include <linux/fs.h>],
673 [generic_file_aio_read(NULL, NULL, 0, 0);],
674 ac_cv_linux_generic_file_aio_read=yes,
675 ac_cv_linux_generic_file_aio_read=no)
676 CPPFLAGS="$save_CPPFLAGS"])
677 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
678 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
679 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
682 AC_DEFUN([LINUX_HAVE_I_SIZE_READ], [
683 AC_MSG_CHECKING([for linux i_size_read()])
684 AC_CACHE_VAL([ac_cv_linux_i_size_read], [
685 save_CPPFLAGS="$CPPFLAGS"
686 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
688 [#include <linux/fs.h>],
689 [i_size_read(NULL);],
690 ac_cv_linux_i_size_read=yes,
691 ac_cv_linux_i_size_read=no)
692 CPPFLAGS="$save_CPPFLAGS"])
693 AC_MSG_RESULT($ac_cv_linux_i_size_read)
694 if test "x$ac_cv_linux_i_size_read" = "xyes"; then
695 AC_DEFINE([HAVE_LINUX_I_SIZE_READ], 1, [define if your kernel has i_size_read()])
698 AC_DEFUN([LINUX_HAVE_D_ALLOC_ANON], [
699 AC_MSG_CHECKING([for linux d_alloc_anon()])
700 AC_CACHE_VAL([ac_cv_linux_d_alloc_anon], [
701 save_CPPFLAGS="$CPPFLAGS"
702 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
704 [#include <linux/dcache.h>],
705 [d_alloc_anon(NULL);],
706 ac_cv_linux_d_alloc_anon=yes,
707 ac_cv_linux_d_alloc_anon=no)
708 CPPFLAGS="$save_CPPFLAGS"])
709 AC_MSG_RESULT($ac_cv_linux_d_alloc_anon)
710 if test "x$ac_cv_linux_d_alloc_anon" = "xyes"; then
711 AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()])
714 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
715 AC_MSG_CHECKING([for todo in struct task_struct])
716 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
718 [#include <linux/sched.h>],
719 [struct task_struct _tsk;
720 printk("%d\n", _tsk.todo);],
721 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
722 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
723 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
725 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
726 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
727 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
729 [#include <linux/kernel.h>
730 #include <linux/workqueue.h>],
732 void f(struct work_struct *w) {}
733 struct work_struct *w;
736 ac_cv_linux_init_work_has_data=yes,
737 ac_cv_linux_init_work_has_data=no)])
738 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
741 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
742 AC_MSG_CHECKING([for flock in struct file_operations])
743 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
745 [#include <linux/fs.h>],
746 [struct file_operations _fop;
747 _fop.flock(NULL, 0, NULL);],
748 ac_cv_linux_fs_struct_fop_has_flock=yes,
749 ac_cv_linux_fs_struct_fop_has_flock=no)])
750 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])
752 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
753 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
754 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
756 [#include <linux/sysctl.h>],
758 register_sysctl_table (t);],
759 ac_cv_linux_register_sysctl_table_noflag=yes,
760 ac_cv_linux_register_sysctl_table_noflag=no)])
761 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
763 AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
764 AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
765 AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
767 [#include <linux/fs.h>],
768 [struct inode _inode;
771 (void)_inode.i_fop->flush(&_file, &id);],
772 ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
773 ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
774 AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
776 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
777 AC_MSG_CHECKING([whether kmem_cache_t exists])
778 AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
780 [#include <linux/slab.h>],
782 ac_cv_linux_have_kmem_cache_t=yes,
783 ac_cv_linux_have_kmem_cache_t=no)])
784 AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
786 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
787 AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
788 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
790 [#include <linux/slab.h>],
791 [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
792 ac_cv_linux_kmem_cache_create_takes_dtor=yes,
793 ac_cv_linux_kmem_cache_create_takes_dtor=no)])
794 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
796 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID], [
797 AC_MSG_CHECKING([whether kmem_cache_create constructor function takes a void pointer argument])
798 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_ctor_takes_void], [
799 save_CPPFLAGS="$CPPFLAGS"
800 CPPFLAGS="$CPPFLAGS -Werror"
802 [#include <linux/slab.h>],
803 [void _ctor(void *v) { };
804 kmem_cache_create(NULL, 0, 0, 0, _ctor);],
805 ac_cv_linux_kmem_cache_create_ctor_takes_void=yes,
806 ac_cv_linux_kmem_cache_create_ctor_takes_void=no)
807 CPPFLAGS="$save_CPPFLAGS"
809 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_ctor_takes_void)
810 if test "x$ac_cv_linux_kmem_cache_create_ctor_takes_void" = "xyes"; then
811 AC_DEFINE([KMEM_CACHE_CTOR_TAKES_VOID], 1, [define if kmem_cache_create constructor function takes a single void pointer argument])
814 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SENDFILE], [
815 AC_MSG_CHECKING([for sendfile in struct file_operations])
816 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_sendfile], [
818 [#include <linux/fs.h>],
819 [struct file_operations _fop;
820 _fop.sendfile(NULL, NULL, 0, 0, NULL);],
821 ac_cv_linux_fs_struct_fop_has_sendfile=yes,
822 ac_cv_linux_fs_struct_fop_has_sendfile=no)])
823 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
825 AC_DEFUN([LINUX_HAVE_SVC_ADDR_IN], [
826 AC_MSG_CHECKING([whether svc_addr_in exists])
827 AC_CACHE_VAL([ac_cv_linux_have_svc_addr_in], [
829 [#include <linux/sunrpc/svc.h>],
830 [svc_addr_in(NULL);],
831 ac_cv_linux_have_svc_addr_in=yes,
832 ac_cv_linux_have_svc_addr_in=no)])
833 AC_MSG_RESULT($ac_cv_linux_have_svc_addr_in)])
835 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
836 AC_MSG_CHECKING([for splice_write and splice_read in struct file_operations])
837 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_splice], [
839 [#include <linux/fs.h>],
840 [struct file_operations _fop;
841 _fop.splice_write(NULL, NULL, NULL, 0, 0);
842 _fop.splice_read(NULL, NULL, NULL, 0, 0);],
843 ac_cv_linux_fs_struct_fop_has_splice=yes,
844 ac_cv_linux_fs_struct_fop_has_splice=no)])
845 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)])
847 AC_DEFUN([LINUX_HAVE_CURRENT_KERNEL_TIME], [
848 AC_MSG_CHECKING([for current_kernel_time()])
849 AC_CACHE_VAL([ac_cv_linux_have_current_kernel_time], [
851 [#include <linux/time.h>],
852 [struct timespec s = current_kernel_time();],
853 ac_cv_linux_have_current_kernel_time=yes,
854 ac_cv_linux_have_current_kernel_time=no)])
855 AC_MSG_RESULT($ac_cv_linux_have_current_kernel_time)])
857 AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
858 AC_MSG_CHECKING([for new kmem_cache init function parameters])
859 AC_CACHE_VAL([ac_cv_linux_kmem_cache_init], [
861 [#include <linux/slab.h>],
862 [extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
864 void (*)(struct kmem_cache *, void *));
866 ac_cv_linux_kmem_cache_init=yes,
867 ac_cv_linux_kmem_cache_init=no)])
868 AC_MSG_RESULT($ac_cv_linux_kmem_cache_init)])
870 AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
871 AC_MSG_CHECKING([for sysctl table checking])
872 AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
874 [#include <linux/sysctl.h>],
875 [ extern int sysctl_check_table(int) __attribute__((weak));
876 sysctl_check_table(NULL);],
877 ac_cv_linux_sysctl_table_checking=no,
878 ac_cv_linux_sysctl_table_checking=yes)])
879 AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
881 AC_DEFUN([LINUX_HAVE_IGET], [
882 AC_MSG_CHECKING([for linux iget()])
883 AC_CACHE_VAL([ac_cv_linux_have_iget], [
884 save_CPPFLAGS="$CPPFLAGS"
885 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
887 [#include <linux/fs.h>],
889 ac_cv_linux_have_iget=yes,
890 ac_cv_linux_have_iget=no)
891 CPPFLAGS="$save_CPPFLAGS"])
892 AC_MSG_RESULT($ac_cv_linux_have_iget)])
894 AC_DEFUN([LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH], [
895 AC_MSG_CHECKING([for path in struct nameidata])
896 AC_CACHE_VAL([ac_cv_linux_struct_nameidata_has_path], [
898 [#include <linux/namei.h>],
899 [struct nameidata _nd;
900 printk("%x\n", _nd.path);],
901 ac_cv_linux_struct_nameidata_has_path=yes,
902 ac_cv_linux_struct_nameidata_has_path=no)])
903 AC_MSG_RESULT($ac_cv_linux_struct_nameidata_has_path)])
905 AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
906 AC_MSG_CHECKING([if rcu_read_lock is usable])
907 AC_CACHE_VAL([ac_cv_linux_exports_rcu_read_lock], [
909 [#include <linux/rcupdate.h>],
911 ac_cv_linux_exports_rcu_read_lock=yes,
912 ac_cv_linux_exports_rcu_read_lock=no)])
913 AC_MSG_RESULT($ac_cv_linux_exports_rcu_read_lock)
914 if test "x$ac_cv_linux_exports_rcu_read_lock" = "xyes"; then
915 AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
918 AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [
919 AC_MSG_CHECKING([if find_task_by_pid is usable])
920 AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [
922 [#include <linux/sched.h>],
924 find_task_by_pid(p);],
925 ac_cv_linux_exports_find_task_by_pid=yes,
926 ac_cv_linux_exports_find_task_by_pid=no)])
927 AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
928 if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then
929 AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable])
932 AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
933 AC_MSG_CHECKING([if proc_root_fs is defined and exported])
934 AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [
936 [#include <linux/proc_fs.h>],
937 [struct proc_dir_entry *p = proc_root_fs;],
938 ac_cv_linux_exports_proc_root_fs=yes,
939 ac_cv_linux_exports_proc_root_fs=no)])
940 AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs)
941 if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then
942 AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
945 AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
946 AC_MSG_CHECKING([if d_path() takes a struct path argument])
947 AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
949 [#include <linux/dcache.h>],
951 d_path(p, NULL, 0);],
952 ac_cv_linux_d_path_takes_struct_path=yes,
953 ac_cv_linux_d_path_takes_struct_path=no)])
954 AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
955 if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
956 AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
959 AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
960 AC_MSG_CHECKING([if kernel uses new export ops])
961 AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
963 [#include <linux/exportfs.h>],
964 [struct export_operations _eops;
965 _eops.fh_to_parent(NULL, NULL, 0, 0);],
966 ac_cv_linux_new_export_ops=yes,
967 ac_cv_linux_new_export_ops=no)])
968 AC_MSG_RESULT($ac_cv_linux_new_export_ops)
969 if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
970 AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
973 AC_DEFUN([LINUX_HAVE_BDI_INIT], [
974 AC_MSG_CHECKING([for linux bdi_init()])
975 AC_CACHE_VAL([ac_cv_linux_bdi_init], [
977 [#include <linux/backing-dev.h>],
979 ac_cv_linux_bdi_init=yes,
980 ac_cv_linux_bdi_init=no)])
981 AC_MSG_RESULT($ac_cv_linux_bdi_init)
982 if test "x$ac_cv_linux_bdi_init" = "xyes"; then
983 AC_DEFINE([HAVE_BDI_INIT], 1, [define if your kernel has a bdi_init()])
986 AC_DEFUN([LINUX_HAVE_WRITE_BEGIN_AOP], [
987 AC_MSG_CHECKING([for linux write_begin() address space op])
988 AC_CACHE_VAL([ac_cv_linux_write_begin], [
990 [#include <linux/fs.h>],
991 [struct address_space_operations _aop;
992 _aop.write_begin = NULL;],
993 ac_cv_linux_write_begin=yes,
994 ac_cv_linux_write_begin=no)])
995 AC_MSG_RESULT($ac_cv_linux_write_begin)
996 if test "x$ac_cv_linux_write_begin" = "xyes"; then
997 AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
1000 AC_DEFUN([LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], [
1001 AC_MSG_CHECKING([for linux grab_cache_page_write_begin()])
1002 AC_CACHE_VAL([ac_cv_linux_grab_cache_page_write_begin], [
1004 [#include <linux/pagemap.h>],
1005 [grab_cache_page_write_begin(NULL, 0, 0);],
1006 ac_cv_linux_grab_cache_page_write_begin=yes,
1007 ac_cv_linux_grab_cache_page_write_begin=no)])
1008 AC_MSG_RESULT($ac_cv_linux_grab_cache_page_write_begin)
1009 if test "x$ac_cv_linux_grab_cache_page_write_begin" = "xyes"; then
1010 AC_DEFINE([HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN], 1, [define if your kernel has grab_cache_page_write_begin()])
1013 AC_DEFUN([LINUX_HAVE_PAGEVEC_LRU_ADD_FILE], [
1014 AC_MSG_CHECKING([for linux __pagevec_lru_add_file()])
1015 AC_CACHE_VAL([ac_cv_linux_pagevec_add_file], [
1017 [#include <linux/pagevec.h>],
1018 [__pagevec_lru_add_file(NULL);],
1019 ac_cv_linux_pagevec_add_file=yes,
1020 ac_cv_linux_pagevec_add_file=no)])
1021 AC_MSG_RESULT($ac_cv_linux_pagevec_add_file)
1022 if test "x$ac_cv_linux_pagevec_add_file" = "xyes"; then
1023 AC_DEFINE([HAVE_PAGEVEC_LRU_ADD_FILE], 1, [define if your kernel has __pagevec_lru_add_file()])
1026 AC_DEFUN([LINUX_HAVE_SPLICE_DIRECT_TO_ACTOR], [
1027 AC_MSG_CHECKING([for linux splice_direct_to_actor()])
1028 AC_CACHE_VAL([ac_cv_linux_splice_direct_to_actor], [
1030 [#include <linux/splice.h>],
1031 [splice_direct_to_actor(NULL,NULL,NULL);],
1032 ac_cv_linux_splice_direct_to_actor=yes,
1033 ac_cv_linux_splice_direct_to_actor=no)])
1034 AC_MSG_RESULT($ac_cv_linux_splice_direct_to_actor)
1035 if test "x$ac_cv_linux_splice_direct_to_actor" = "xyes"; then
1036 AC_DEFINE([HAVE_SPLICE_DIRECT_TO_ACTOR], 1, [define if your kernel has splice_direct_to_actor()])
1039 AC_DEFUN([LINUX_STRUCT_TASK_HAS_CRED], [
1040 AC_MSG_CHECKING([if struct task has cred])
1041 AC_CACHE_VAL([ac_cv_linux_struct_task_has_cred], [
1043 [#include <linux/sched.h>
1044 #include <linux/cred.h>],
1045 [struct task_struct _t;
1047 _u =_t.cred->uid ;],
1048 ac_cv_linux_struct_task_has_cred=yes,
1049 ac_cv_linux_struct_task_has_cred=no)])
1050 AC_MSG_RESULT($ac_cv_linux_struct_task_has_cred)
1051 if test "x$ac_cv_linux_struct_task_has_cred" = "xyes"; then
1052 AC_DEFINE([STRUCT_TASK_HAS_CRED], 1, [define if struct task has a cred pointer])
1055 AC_DEFUN([LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER], [
1056 AC_MSG_CHECKING([if struct proc_dir_entry_has_owner])
1057 AC_CACHE_VAL([ac_cv_linux_struct_proc_dir_entry_has_owner], [
1059 [#include <linux/proc_fs.h>],
1060 [struct proc_dir_entry _p;
1062 ac_cv_linux_struct_proc_dir_entry_has_owner=yes,
1063 ac_cv_linux_struct_proc_dir_entry_has_owner=no)])
1064 AC_MSG_RESULT($ac_cv_linux_struct_proc_dir_entry_has_owner)
1065 if test "x$ac_cv_linux_struct_proc_dir_entry_has_owner" = "xyes"; then
1066 AC_DEFINE([STRUCT_PROC_DIR_ENTRY_HAS_OWNER], 1, [define if struct proc_dir_entry has an owner member])
1069 AC_DEFUN([LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT], [
1070 AC_MSG_CHECKING([if posix_test_lock returns a struct file_lock])
1071 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_returns_conflict], [
1073 [#include <linux/fs.h>],
1074 [struct file_lock *lock;
1076 lock = posix_test_lock(file, lock);],
1077 ac_cv_linux_posix_test_lock_returns_conflict=yes,
1078 ac_cv_linux_posix_test_lock_returns_conflict=no)])
1079 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_returns_conflict)
1080 if test "x$ac_cv_linux_posix_test_lock_returns_conflict" = "xyes"; then
1081 AC_DEFINE([POSIX_TEST_LOCK_RETURNS_CONFLICT], 1, [define if posix_test_lock returns the conflicting lock])
1084 AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
1085 AC_MSG_CHECKING([if posix_test_lock takes a conflict argument])
1086 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_conflict_arg], [
1088 [#include <linux/fs.h>],
1089 [ struct file_lock *lock;
1091 posix_test_lock(file, lock, lock);],
1092 ac_cv_linux_posix_test_lock_conflict_arg=yes,
1093 ac_cv_lonuc_posix_test_lock_conflict_arg=no)])
1094 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_conflict_arg)
1095 if test "x$ac_cv_linux_posix_test_lock_conflict_arg" = "xyes"; then
1096 AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
1099 AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
1100 AC_MSG_CHECKING([for exported key_type_keyring])
1101 AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
1104 #ifdef HAVE_LINUX_KEY_TYPE_H
1105 #include <linux/key-type.h>
1107 #include <linux/key.h>],
1109 printk("%s", key_type_keyring.name);
1111 ac_cv_linux_exports_key_type_keyring=yes,
1112 ac_cv_linux_exports_key_type_keyring=no)])
1113 AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
1114 if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
1115 AC_DEFINE([EXPORTED_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
1118 AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [
1119 AC_MSG_CHECKING([for KEYCTL_SESSION_TO_PARENT])
1120 AC_CACHE_VAL([ac_cv_linux_have_session_to_parent], [
1122 [ #include <linux/keyctl.h>],
1123 [ int i = KEYCTL_SESSION_TO_PARENT;],
1124 ac_cv_linux_have_session_to_parent=yes,
1125 ac_cv_linux_have_session_to_parent=no)])
1126 AC_MSG_RESULT($ac_cv_linux_have_session_to_parent)
1127 if test "x$ac_cv_linux_have_session_to_parent" = "xyes"; then
1128 AC_DEFINE([HAVE_SESSION_TO_PARENT], 1, [define if keyctl has the KEYCTL_SESSION_TO_PARENT function])
1131 AC_DEFUN([LINUX_STRUCT_SUPER_BLOCK_HAS_S_BDI], [
1132 AC_MSG_CHECKING([if struct super_block has s_bdi])
1133 AC_CACHE_VAL([ac_cv_linux_struct_super_block_has_s_bdi], [
1135 [#include <linux/fs.h>],
1136 [struct super_block _sb;
1138 ac_cv_linux_struct_super_block_has_s_bdi=yes,
1139 ac_cv_linux_struct_super_block_has_s_bdi=no)])
1140 AC_MSG_RESULT($ac_cv_linux_struct_super_block_has_s_bdi)
1141 if test "x$ac_cv_linux_struct_super_block_has_s_bdi" = "xyes"; then
1142 AC_DEFINE([STRUCT_SUPER_BLOCK_HAS_S_BDI], 1, [define if struct super_block has an s_bdi member])
1145 AC_DEFUN([LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME], [
1146 AC_MSG_CHECKING([if struct ctl_table has ctl_name])
1147 AC_CACHE_VAL([ac_cv_linux_struct_ctl_table_has_ctl_name], [
1149 [#include <linux/sysctl.h>],
1150 [struct ctl_table _t;
1152 ac_cv_linux_struct_ctl_table_has_ctl_name=yes,
1153 ac_cv_linux_struct_ctl_table_has_ctl_name=no)])
1154 AC_MSG_RESULT($ac_cv_linux_struct_ctl_table_has_ctl_name)
1155 if test "x$ac_cv_linux_struct_ctl_table_has_ctl_name" = "xyes"; then
1156 AC_DEFINE([STRUCT_CTL_TABLE_HAS_CTL_NAME], 1, [define if struct ctl_table has a ctl_name member])
1159 AC_DEFUN([LINUX_STRUCT_BDI_HAS_NAME], [
1160 AC_MSG_CHECKING([if struct backing_dev_info has name])
1161 AC_CACHE_VAL([ac_cv_linux_struct_bdi_has_name], [
1163 [#include <linux/backing-dev.h>],
1164 [struct backing_dev_info _bdi;
1166 ac_cv_linux_struct_bdi_has_name=yes,
1167 ac_cv_linux_struct_bdi_has_name=no)])
1168 AC_MSG_RESULT($ac_cv_linux_struct_bdi_has_name)
1169 if test "x$ac_cv_linux_struct_bdi_has_name" = "xyes"; then
1170 AC_DEFINE([STRUCT_BDI_HAS_NAME], 1, [define if struct backing_dev_info has a name member])
1173 AC_DEFUN([LINUX_HAVE_ZERO_USER_SEGMENTS], [
1174 AC_MSG_CHECKING([for zero_user_segments])
1175 AC_CACHE_VAL([ac_cv_linux_have_zero_user_segments], [
1177 [#include <linux/highmem.h>],
1178 [zero_user_segments(NULL, 0, 0, 0, 0);],
1179 ac_cv_linux_have_zero_user_segments=yes,
1180 ac_cv_linux_have_zero_user_segments=no)])
1181 AC_MSG_RESULT($ac_cv_linux_have_zero_user_segments)
1182 if test "x$ac_cv_linux_have_zero_user_segments" = "xyes"; then
1183 AC_DEFINE([HAVE_ZERO_USER_SEGMENTS], 1, [define if your kernel has the zero_user_segments function])
1186 AC_DEFUN([LINUX_HAVE_PAGE_OFFSET], [
1187 AC_MSG_CHECKING([for page_offset])
1188 AC_CACHE_VAL([ac_cv_linux_have_page_offset], [
1190 [#include <linux/pagemap.h>],
1191 [page_offset(NULL);],
1192 ac_cv_linux_have_page_offset=yes,
1193 ac_cv_linux_have_page_offset=no)])
1194 AC_MSG_RESULT($ac_cv_linux_have_page_offset)
1195 if test "x$ac_cv_linux_have_page_offset" = "xyes"; then
1196 AC_DEFINE([HAVE_PAGE_OFFSET], 1, [define if your kernel has the page_offset function])
1199 AC_DEFUN([LINUX_HAVE_VFS_LLSEEK], [
1200 AC_MSG_CHECKING([for vfs_llseek])
1201 AC_CACHE_VAL([ac_cv_linux_have_vfs_llseek], [
1203 [#include <linux/fs.h>],
1204 [vfs_llseek(NULL, 0, 0);],
1205 ac_cv_linux_have_vfs_llseek=yes,
1206 ac_cv_linux_have_vfs_llseek=no)])
1207 AC_MSG_RESULT($ac_cv_linux_have_vfs_llseek)
1208 if test "x$ac_cv_linux_have_vfs_llseek" = "xyes"; then
1209 AC_DEFINE([HAVE_VFS_LLSEEK], 1, [define if your kernel has the vfs_llseek function])
1212 AC_DEFUN([LINUX_HAVE_KERNEL_SETSOCKOPT], [
1213 AC_MSG_CHECKING([for kernel_setsockopt])
1214 AC_CACHE_VAL([ac_cv_linux_have_kernel_setsockopt], [
1216 [#include <linux/net.h>],
1217 [kernel_setsockopt(NULL, 0, 0, NULL, 0);],
1218 ac_cv_linux_have_kernel_setsockopt=yes,
1219 ac_cv_linux_have_kernel_setsockopt=no)])
1220 AC_MSG_RESULT($ac_cv_linux_have_kernel_setsockopt)
1221 if test "x$ac_cv_linux_have_kernel_setsockopt" = "xyes"; then
1222 AC_DEFINE([HAVE_KERNEL_SETSOCKOPT], 1, [define if your kernel has the kernel_setsockopt function])