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_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO], [
448 AC_MSG_CHECKING([for thread_info in struct task_struct])
449 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_thread_info], [
451 [#include <linux/sched.h>],
452 [struct task_struct _tsk;
453 printk("%d\n", _tsk.thread_info);],
454 ac_cv_linux_sched_struct_task_struct_has_thread_info=yes,
455 ac_cv_linux_sched_struct_task_struct_has_thread_info=no)])
456 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_thread_info)])
459 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
460 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
461 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
463 [#include <linux/fs.h>],
464 [struct super_operations _super;
465 printk("%p\n", _super.alloc_inode);],
466 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
467 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
468 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
471 AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
472 AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels])
473 AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [
475 [#include <linux/fs.h>],
476 [posix_lock_file(0,0,0);],
477 ac_cv_linux_kernel_posix_lock_file_wait_arg=yes,
478 ac_cv_linux_kernel_posix_lock_file_wait_arg=no)])
479 AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)])
482 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
483 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
484 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
486 [#include <linux/net.h>],
487 [sock_create(0,0,0,0,0);],
488 ac_cv_linux_kernel_sock_create_v=yes,
489 ac_cv_linux_kernel_sock_create_v=no)])
490 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
493 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
494 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
495 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
496 save_CPPFLAGS="$CPPFLAGS"
497 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
499 [#include <linux/fs.h>],
500 [page_follow_link(0,0);],
501 ac_cv_linux_kernel_page_follow_link=yes,
502 ac_cv_linux_kernel_page_follow_link=no)
503 CPPFLAGS="$save_CPPFLAGS"])
504 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
507 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
508 AC_MSG_CHECKING([for gfp_mask in struct address_space])
509 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
511 [#include <linux/fs.h>],
512 [struct address_space _a;
513 printk("%d\n", _a.gfp_mask);],
514 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
515 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
516 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
519 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
520 AC_MSG_CHECKING([for i_bytes in struct inode])
521 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
523 [#include <linux/fs.h>],
524 [struct inode _inode;
525 printk("%d\n", _inode.i_bytes);],
526 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
527 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
528 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
531 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
532 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
533 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
535 [#include <linux/fs.h>],
537 printk("%x\n", _i.i_alloc_sem);],
538 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
539 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
540 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
543 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
544 AC_MSG_CHECKING([for i_truncate_sem in struct inode])
545 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
547 [#include <linux/fs.h>],
549 printk("%x\n", _i.i_truncate_sem);],
550 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
551 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
552 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
555 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
556 AC_MSG_CHECKING([for page_lock in struct address_space])
557 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
559 [#include <linux/fs.h>],
560 [struct address_space _a_s;
561 printk("%x\n", _a_s.page_lock);],
562 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
563 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
564 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
567 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
568 AC_MSG_CHECKING([for inode_setattr return type])
569 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
571 [#include <linux/fs.h>],
572 [struct inode _inode;
575 i = inode_setattr(&_inode, &_iattr);],
576 ac_cv_linux_func_inode_setattr_returns_int=yes,
577 ac_cv_linux_func_inode_setattr_returns_int=no)])
578 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
581 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
582 AC_MSG_CHECKING([for write_inode return type])
583 AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
585 [#include <linux/fs.h>],
586 [struct inode _inode;
587 struct super_operations _sops;
589 i = _sops.write_inode(&_inode, 0);],
590 ac_cv_linux_func_write_inode_returns_int=yes,
591 ac_cv_linux_func_write_inode_returns_int=no)])
592 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
595 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
596 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
597 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
599 [#include <linux/fs.h>
600 #include <linux/mm.h>
601 #include <linux/writeback.h>],
602 [struct address_space_operations _aops;
604 struct writeback_control _writeback_control;
605 (void)_aops.writepage(&_page, &_writeback_control);],
606 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
607 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
608 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
611 AC_DEFUN([LINUX_REFRIGERATOR], [
612 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
613 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
615 [#include <linux/sched.h>
616 #ifdef FREEZER_H_EXISTS
617 #include <linux/freezer.h>
619 [refrigerator(PF_FREEZE);],
620 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
621 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
622 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
625 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
626 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
627 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
629 [#include <linux/fs.h>
630 #include <linux/namei.h>],
631 [struct inode _inode;
632 struct dentry _dentry;
633 struct nameidata _nameidata;
634 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
635 ac_cv_linux_func_i_create_takes_nameidata=yes,
636 ac_cv_linux_func_i_create_takes_nameidata=no)])
637 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
640 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
641 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
642 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
644 [#include <linux/fs.h>
645 #include <linux/namei.h>],
646 [struct inode _inode;
647 struct dentry _dentry;
648 struct nameidata _nameidata;
649 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
650 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
651 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
652 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
655 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
656 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
657 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
659 [#include <linux/fs.h>
660 #include <linux/namei.h>],
661 [struct inode _inode;
662 struct dentry _dentry;
663 struct nameidata _nameidata;
664 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
665 ac_cv_linux_func_i_permission_takes_nameidata=yes,
666 ac_cv_linux_func_i_permission_takes_nameidata=no)])
667 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
670 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
671 AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
672 AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
674 [#include <linux/fs.h>
675 #include <linux/namei.h>],
676 [struct inode _inode;
677 struct dentry _dentry;
678 struct nameidata _nameidata;
680 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
681 ac_cv_linux_func_i_put_link_takes_cookie=yes,
682 ac_cv_linux_func_i_put_link_takes_cookie=no)])
683 AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
686 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
687 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
688 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
690 [#include <linux/fs.h>
691 #include <linux/namei.h>],
692 [struct dentry _dentry;
693 struct nameidata _nameidata;
694 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
695 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
696 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
697 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
699 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
700 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
701 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
703 [#include <linux/fs.h>],
704 [get_sb_nodev(0,0,0,0,0);],
705 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
706 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
707 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
709 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
710 AC_MSG_CHECKING([for dentry in statfs])
711 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
713 [#include <linux/fs.h>
714 #include <linux/statfs.h>],
716 extern int vfs_statfs(struct dentry *, struct kstatfs *);
718 ac_cv_linux_statfs_takes_dentry=yes,
719 ac_cv_linux_statfs_takes_dentry=no)])
720 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
722 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
723 AC_MSG_CHECKING([for linux kernel keyring support])
724 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
726 [#include <linux/rwsem.h>
727 #include <linux/key.h>
728 #include <linux/keyctl.h>],
730 request_key(NULL, NULL, NULL);
731 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
732 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
735 #error rebuild your kernel with CONFIG_KEYS
737 ac_cv_linux_keyring_support=yes,
738 ac_cv_linux_keyring_support=no)])
739 AC_MSG_RESULT($ac_cv_linux_keyring_support)
740 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
741 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
744 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
745 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
746 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
748 [#include <linux/rwsem.h>
749 #include <linux/key.h>
751 [(void) key_alloc(NULL, NULL, 0, 0, NULL, 0, 0);],
752 ac_cv_key_alloc_needs_struct_task=yes,
753 ac_cv_key_alloc_needs_struct_task=no)])
754 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
755 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
756 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
759 AC_DEFUN([LINUX_DO_SYNC_READ], [
760 AC_MSG_CHECKING([for linux do_sync_read()])
761 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
762 save_CPPFLAGS="$CPPFLAGS"
763 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
765 [#include <linux/fs.h>],
766 [do_sync_read(NULL, NULL, 0, NULL);],
767 ac_cv_linux_do_sync_read=yes,
768 ac_cv_linux_do_sync_read=no)
769 CPPFLAGS="$save_CPPFLAGS"])
770 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
771 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
772 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
775 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
776 AC_MSG_CHECKING([for linux generic_file_aio_read()])
777 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
778 save_CPPFLAGS="$CPPFLAGS"
779 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
781 [#include <linux/fs.h>],
782 [generic_file_aio_read(NULL, NULL, 0, 0);],
783 ac_cv_linux_generic_file_aio_read=yes,
784 ac_cv_linux_generic_file_aio_read=no)
785 CPPFLAGS="$save_CPPFLAGS"])
786 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
787 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
788 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
791 AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
792 AC_MSG_CHECKING([for linux/freezer.h existance])
793 AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
795 [#include <linux/freezer.h>],
797 ac_cv_linux_freezer_h_exists=yes,
798 ac_cv_linux_freezer_h_exists=no)])
799 AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
800 if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
801 AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
804 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
805 AC_MSG_CHECKING([for todo in struct task_struct])
806 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
808 [#include <linux/sched.h>],
809 [struct task_struct _tsk;
810 printk("%d\n", _tsk.todo);],
811 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
812 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
813 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
815 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
816 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
817 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
819 [#include <linux/kernel.h>
820 #include <linux/workqueue.h>],
822 void f(struct work_struct *w) {}
823 struct work_struct *w;
826 ac_cv_linux_init_work_has_data=yes,
827 ac_cv_linux_init_work_has_data=no)])
828 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
831 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
832 AC_MSG_CHECKING([for flock in struct file_operations])
833 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
835 [#include <linux/fs.h>],
836 [struct file_operations _fop;
837 _fop.flock(NULL, 0, NULL);],
838 ac_cv_linux_fs_struct_fop_has_flock=yes,
839 ac_cv_linux_fs_struct_fop_has_flock=no)])
840 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])
842 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
843 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
844 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
846 [#include <linux/sysctl.h>],
848 register_sysctl_table (t);],
849 ac_cv_linux_register_sysctl_table_noflag=yes,
850 ac_cv_linux_register_sysctl_table_noflag=no)])
851 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
853 AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
854 AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
855 AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
857 [#include <linux/fs.h>],
858 [struct inode _inode;
861 (void)_inode.i_fop->flush(&_file, &id);],
862 ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
863 ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
864 AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])