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)])
45 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
46 AC_MSG_CHECKING([for defined for_each_process])
47 AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
49 [#include <linux/sched.h>],
50 [#ifndef for_each_process
51 #error for_each_process not defined
53 ac_cv_linux_defines_for_each_process=yes,
54 ac_cv_linux_defines_for_each_process=no)])
55 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
58 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
59 AC_MSG_CHECKING([for defined prev_task])
60 AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
62 [#include <linux/sched.h>],
64 #error prev_task not defined
66 ac_cv_linux_defines_prev_task=yes,
67 ac_cv_linux_defines_prev_task=no)])
68 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
71 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
72 AC_MSG_CHECKING([for exported init_mm])
73 AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
75 [#include <linux/modversions.h>],
76 [#ifndef __ver_init_mm
77 #error init_mm not exported
79 ac_cv_linux_exports_init_mm=yes,
80 ac_cv_linux_exports_init_mm=no)])
81 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
84 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
85 AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
86 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
88 [#include <linux/modversions.h>],
89 [#ifndef __ver_kallsyms_address_to_symbol
90 #error kallsyms_address_to_symbol not exported
92 ac_cv_linux_exports_kallsyms_address=yes,
93 ac_cv_linux_exports_kallsyms_address=no)])
94 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
97 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
98 AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
99 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
101 [#include <linux/modversions.h>],
102 [#ifndef __ver_kallsyms_symbol_to_address
103 #error kallsyms_symbol_to_address not exported
105 ac_cv_linux_exports_kallsyms_symbol=yes,
106 ac_cv_linux_exports_kallsyms_symbol=no)])
107 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
109 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
110 AC_MSG_CHECKING([for exported sys_call_table])
111 AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
113 [#include <linux/modversions.h>],
114 [#ifndef __ver_sys_call_table
115 #error sys_call_table not exported
117 ac_cv_linux_exports_sys_call_table=yes,
118 ac_cv_linux_exports_sys_call_table=no)])
119 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
122 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
123 AC_MSG_CHECKING([for exported ia32_sys_call_table])
124 AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
126 [#include <linux/modversions.h>],
127 [#ifndef __ver_ia32_sys_call_table
128 #error ia32_sys_call_table not exported
130 ac_cv_linux_exports_ia32_sys_call_table=yes,
131 ac_cv_linux_exports_ia32_sys_call_table=no)])
132 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
135 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
136 AC_MSG_CHECKING([for exported sys_chdir])
137 AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
139 [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
140 [void *address = &sys_chdir;
141 printk("%p\n", address);],
142 ac_cv_linux_exports_sys_chdir=yes,
143 ac_cv_linux_exports_sys_chdir=no)])
144 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
147 AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
148 AC_MSG_CHECKING([for exported sys_close])
149 AC_CACHE_VAL([ac_cv_linux_exports_sys_close], [
151 [extern asmlinkage long sys_close(void) __attribute__((weak));],
152 [void *address = &sys_close;
153 printk("%p\n", address);],
154 ac_cv_linux_exports_sys_close=yes,
155 ac_cv_linux_exports_sys_close=no)])
156 AC_MSG_RESULT($ac_cv_linux_exports_sys_close)])
159 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
160 AC_MSG_CHECKING([for exported sys_open])
161 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
163 [extern asmlinkage long sys_open(void) __attribute__((weak));],
164 [void *address = &sys_open;
165 printk("%p\n", address);],
166 ac_cv_linux_exports_sys_open=yes,
167 ac_cv_linux_exports_sys_open=no)])
168 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
171 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
172 AC_MSG_CHECKING([for exported sys_wait4])
173 AC_CACHE_VAL([ac_cv_linux_exports_sys_wait4], [
175 [extern asmlinkage long sys_wait4(void) __attribute__((weak));],
176 [void *address = &sys_wait4;
177 printk("%p\n", address);],
178 ac_cv_linux_exports_sys_wait4=yes,
179 ac_cv_linux_exports_sys_wait4=no)])
180 AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)])
183 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE], [
184 AC_MSG_CHECKING([for i_blksize in struct inode])
185 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blksize], [
187 [#include <linux/fs.h>],
188 [struct inode _inode;
189 printk("%d\n", _inode.i_blksize);],
190 ac_cv_linux_fs_struct_inode_has_i_blksize=yes,
191 ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
192 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
194 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [
195 AC_MSG_CHECKING([for i_blkbits in struct inode])
196 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
198 [#include <linux/fs.h>],
199 [struct inode _inode;
200 printk("%d\n", _inode.i_blkbits);],
201 ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
202 ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
203 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
204 if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
205 AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
209 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
210 AC_MSG_CHECKING([for i_cdev in struct inode])
211 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
213 [#include <linux/fs.h>],
214 [struct inode _inode;
215 printk("%d\n", _inode.i_cdev);],
216 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
217 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
218 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
221 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
222 AC_MSG_CHECKING([for i_devices in struct inode])
223 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_devices], [
225 [#include <linux/fs.h>],
226 [struct inode _inode;
227 printk("%d\n", _inode.i_devices);],
228 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
229 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
230 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)])
233 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
234 AC_MSG_CHECKING([for i_dirty_data_buffers in struct inode])
235 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers], [
237 [#include <linux/fs.h>],
238 [struct inode _inode;
239 printk("%d\n", _inode.i_dirty_data_buffers);],
240 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
241 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
242 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)])
245 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [
246 AC_MSG_CHECKING([for inotify_lock in struct inode])
247 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_lock], [
249 [#include <linux/fs.h>],
250 [struct inode _inode;
251 printk("%d\n", _inode.inotify_lock);],
252 ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
253 ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
254 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)])
256 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [
257 AC_MSG_CHECKING([for inotify_sem in struct inode])
258 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_sem], [
260 [#include <linux/fs.h>],
261 [struct inode _inode;
262 printk("%x\n", _inode.inotify_sem);],
263 ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
264 ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
265 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)])
268 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
269 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
270 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
272 [#include <linux/fs.h>],
273 [struct inode _inode;
274 printk("%d\n", _inode.i_mapping_overload);],
275 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
276 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
277 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
280 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
281 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
282 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
284 [#include <linux/fs.h>],
285 [struct inode _inode;
286 printk("%d\n", _inode.i_mmap_shared);],
287 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
288 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
289 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
292 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
293 AC_MSG_CHECKING([for i_mutex in struct inode])
294 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
296 [#include <linux/fs.h>],
297 [struct inode _inode;
298 printk("%d\n", _inode.i_mutex);],
299 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
300 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
301 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
304 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
305 AC_MSG_CHECKING([for i_security in struct inode])
306 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
308 [#include <linux/fs.h>],
309 [struct inode _inode;
310 printk("%d\n", _inode.i_security);],
311 ac_cv_linux_fs_struct_inode_has_i_security=yes,
312 ac_cv_linux_fs_struct_inode_has_i_security=no)])
313 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
316 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST], [
317 AC_MSG_CHECKING([for i_sb_list in struct inode])
318 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_sb_list], [
320 [#include <linux/fs.h>],
321 [struct inode _inode;
322 printk("%d\n", _inode.i_sb_list);],
323 ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
324 ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
325 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)])
328 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
329 AC_MSG_CHECKING([for recalc_sigpending arg type])
330 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
332 [#include <linux/sched.h>],
333 [recalc_sigpending();],
334 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
335 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
336 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
339 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
340 AC_MSG_CHECKING([for parent in struct task_struct])
341 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
343 [#include <linux/sched.h>],
344 [struct task_struct _tsk;
345 printk("%d\n", _tsk.parent);],
346 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
347 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
348 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
351 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
352 AC_MSG_CHECKING([for tgid in struct task_struct])
353 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
355 [#include <linux/sched.h>],
356 [struct task_struct _tsk;
357 printk("%d\n", _tsk.tgid);],
358 ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
359 ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
360 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
363 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
364 AC_MSG_CHECKING([for real_parent in struct task_struct])
365 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
367 [#include <linux/sched.h>],
368 [struct task_struct _tsk;
369 printk("%d\n", _tsk.real_parent);],
370 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
371 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
372 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
375 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
376 AC_MSG_CHECKING([for sig in struct task_struct])
377 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
379 [#include <linux/sched.h>],
380 [struct task_struct _tsk;
381 printk("%d\n", _tsk.sig);],
382 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
383 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
384 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
387 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
388 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
389 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
391 [#include <linux/sched.h>],
392 [struct task_struct _tsk;
393 printk("%d\n", _tsk.sigmask_lock);],
394 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
395 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
396 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
399 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
400 AC_MSG_CHECKING([for sighand in struct task_struct])
401 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
403 [#include <linux/sched.h>],
404 [struct task_struct _tsk;
405 printk("%d\n", _tsk.sighand);],
406 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
407 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
408 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
411 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
412 AC_MSG_CHECKING([for rlim in struct task_struct])
413 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
415 [#include <linux/sched.h>],
416 [struct task_struct _tsk;
417 printk("%d\n", _tsk.rlim);],
418 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
419 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
420 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
423 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
424 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
425 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
427 [#include <linux/sched.h>],
428 [struct task_struct _tsk;
429 printk("%d\n", _tsk.signal->rlim);],
430 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
431 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
432 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
435 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
436 AC_MSG_CHECKING([for exit_state in struct task_struct])
437 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
439 [#include <linux/sched.h>],
440 [struct task_struct _tsk;
441 printk("%d\n", _tsk.exit_state);],
442 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
443 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
444 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
447 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
448 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
449 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
451 [#include <linux/fs.h>],
452 [struct super_operations _super;
453 printk("%p\n", _super.alloc_inode);],
454 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
455 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
456 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
459 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
460 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
461 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
463 [#include <linux/net.h>],
464 [sock_create(0,0,0,0,0);],
465 ac_cv_linux_kernel_sock_create_v=yes,
466 ac_cv_linux_kernel_sock_create_v=no)])
467 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
470 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
471 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
472 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
473 save_CPPFLAGS="$CPPFLAGS"
474 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
476 [#include <linux/fs.h>],
477 [page_follow_link(0,0);],
478 ac_cv_linux_kernel_page_follow_link=yes,
479 ac_cv_linux_kernel_page_follow_link=no)
480 CPPFLAGS="$save_CPPFLAGS"])
481 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
484 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
485 AC_MSG_CHECKING([for gfp_mask in struct address_space])
486 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
488 [#include <linux/fs.h>],
489 [struct address_space _a;
490 printk("%d\n", _a.gfp_mask);],
491 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
492 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
493 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
496 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
497 AC_MSG_CHECKING([for i_bytes in struct inode])
498 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
500 [#include <linux/fs.h>],
501 [struct inode _inode;
502 printk("%d\n", _inode.i_bytes);],
503 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
504 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
505 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
508 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
509 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
510 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
512 [#include <linux/fs.h>],
514 printk("%x\n", _i.i_alloc_sem);],
515 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
516 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
517 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
520 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
521 AC_MSG_CHECKING([for i_truncate_sem in struct inode])
522 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
524 [#include <linux/fs.h>],
526 printk("%x\n", _i.i_truncate_sem);],
527 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
528 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
529 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
532 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
533 AC_MSG_CHECKING([for page_lock in struct address_space])
534 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
536 [#include <linux/fs.h>],
537 [struct address_space _a_s;
538 printk("%x\n", _a_s.page_lock);],
539 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
540 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
541 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
544 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
545 AC_MSG_CHECKING([for inode_setattr return type])
546 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
548 [#include <linux/fs.h>],
549 [struct inode _inode;
552 i = inode_setattr(&_inode, &_iattr);],
553 ac_cv_linux_func_inode_setattr_returns_int=yes,
554 ac_cv_linux_func_inode_setattr_returns_int=no)])
555 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
558 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
559 AC_MSG_CHECKING([for write_inode return type])
560 AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
562 [#include <linux/fs.h>],
563 [struct inode _inode;
564 struct super_operations _sops;
566 i = _sops.write_inode(&_inode, 0);],
567 ac_cv_linux_func_write_inode_returns_int=yes,
568 ac_cv_linux_func_write_inode_returns_int=no)])
569 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
572 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
573 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
574 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
576 [#include <linux/fs.h>
577 #include <linux/mm.h>
578 #include <linux/writeback.h>],
579 [struct address_space_operations _aops;
581 struct writeback_control _writeback_control;
582 (void)_aops.writepage(&_page, &_writeback_control);],
583 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
584 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
585 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
588 AC_DEFUN([LINUX_REFRIGERATOR], [
589 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
590 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
592 [#include <linux/sched.h>
593 #ifdef FREEZER_H_EXISTS
594 #include <linux/freezer.h>
596 [refrigerator(PF_FREEZE);],
597 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
598 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
599 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
602 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
603 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
604 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
606 [#include <linux/fs.h>
607 #include <linux/namei.h>],
608 [struct inode _inode;
609 struct dentry _dentry;
610 struct nameidata _nameidata;
611 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
612 ac_cv_linux_func_i_create_takes_nameidata=yes,
613 ac_cv_linux_func_i_create_takes_nameidata=no)])
614 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
617 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
618 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
619 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
621 [#include <linux/fs.h>
622 #include <linux/namei.h>],
623 [struct inode _inode;
624 struct dentry _dentry;
625 struct nameidata _nameidata;
626 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
627 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
628 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
629 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
632 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
633 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
634 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
636 [#include <linux/fs.h>
637 #include <linux/namei.h>],
638 [struct inode _inode;
639 struct dentry _dentry;
640 struct nameidata _nameidata;
641 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
642 ac_cv_linux_func_i_permission_takes_nameidata=yes,
643 ac_cv_linux_func_i_permission_takes_nameidata=no)])
644 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
647 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
648 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
649 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
651 [#include <linux/fs.h>
652 #include <linux/namei.h>],
653 [struct dentry _dentry;
654 struct nameidata _nameidata;
655 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
656 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
657 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
658 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
660 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
661 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
662 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
664 [#include <linux/fs.h>],
665 [get_sb_nodev(0,0,0,0,0);],
666 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
667 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
668 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
670 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
671 AC_MSG_CHECKING([for dentry in statfs])
672 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
674 [#include <linux/fs.h>
675 #include <linux/statfs.h>],
677 extern int vfs_statfs(struct dentry *, struct kstatfs *);
679 ac_cv_linux_statfs_takes_dentry=yes,
680 ac_cv_linux_statfs_takes_dentry=no)])
681 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
683 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
684 AC_MSG_CHECKING([for linux kernel keyring support])
685 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
687 [#include <linux/rwsem.h>
688 #include <linux/key.h>
689 #include <linux/keyctl.h>],
691 request_key(NULL, NULL, NULL);
692 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
693 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
696 #error rebuild your kernel with CONFIG_KEYS
698 ac_cv_linux_keyring_support=yes,
699 ac_cv_linux_keyring_support=no)])
700 AC_MSG_RESULT($ac_cv_linux_keyring_support)
701 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
702 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
705 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
706 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
707 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
709 [#include <linux/rwsem.h>
710 #include <linux/key.h>
712 [(void) key_alloc(NULL, NULL, 0, 0, NULL, 0, 0);],
713 ac_cv_key_alloc_needs_struct_task=yes,
714 ac_cv_key_alloc_needs_struct_task=no)])
715 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
716 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
717 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
720 AC_DEFUN([LINUX_DO_SYNC_READ], [
721 AC_MSG_CHECKING([for linux do_sync_read()])
722 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
723 save_CPPFLAGS="$CPPFLAGS"
724 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
726 [#include <linux/fs.h>],
727 [do_sync_read(NULL, NULL, 0, NULL);],
728 ac_cv_linux_do_sync_read=yes,
729 ac_cv_linux_do_sync_read=no)
730 CPPFLAGS="$save_CPPFLAGS"])
731 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
732 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
733 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
736 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
737 AC_MSG_CHECKING([for linux generic_file_aio_read()])
738 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
739 save_CPPFLAGS="$CPPFLAGS"
740 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
742 [#include <linux/fs.h>],
743 [generic_file_aio_read(NULL, NULL, 0, 0);],
744 ac_cv_linux_generic_file_aio_read=yes,
745 ac_cv_linux_generic_file_aio_read=no)
746 CPPFLAGS="$save_CPPFLAGS"])
747 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
748 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
749 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
752 AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
753 AC_MSG_CHECKING([for linux/freezer.h existance])
754 AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
756 [#include <linux/freezer.h>],
758 ac_cv_linux_freezer_h_exists=yes,
759 ac_cv_linux_freezer_h_exists=no)])
760 AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
761 if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
762 AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
765 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
766 AC_MSG_CHECKING([for todo in struct task_struct])
767 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
769 [#include <linux/sched.h>],
770 [struct task_struct _tsk;
771 printk("%d\n", _tsk.todo);],
772 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
773 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
774 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
776 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
777 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
778 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
780 [#include <linux/kernel.h>
781 #include <linux/workqueue.h>],
783 void f(struct work_struct *w) {}
784 struct work_struct *w;
787 ac_cv_linux_init_work_has_data=yes,
788 ac_cv_linux_init_work_has_data=no)])
789 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
792 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
793 AC_MSG_CHECKING([for flock in struct file_operations])
794 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
796 [#include <linux/fs.h>],
797 [struct file_operations _fop;
798 _fop.flock(NULL, 0, NULL);],
799 ac_cv_linux_fs_struct_fop_has_flock=yes,
800 ac_cv_linux_fs_struct_fop_has_flock=no)])
801 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])
803 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
804 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
805 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
807 [#include <linux/sysctl.h>],
809 register_sysctl_table (t);],
810 ac_cv_linux_register_sysctl_table_noflag=yes,
811 ac_cv_linux_register_sysctl_table_noflag=no)])
812 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])