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));
10 ac_cv_linux_exports_tasklist_lock=yes,
11 ac_cv_linux_exports_tasklist_lock=no)])
12 AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)])
15 AC_DEFUN([LINUX_CONFIG_H_EXISTS], [
16 AC_MSG_CHECKING([for linux/config.h existance])
17 AC_CACHE_VAL([ac_cv_linux_config_h_exists], [
19 [#include <linux/config.h>],
21 ac_cv_linux_config_h_exists=yes,
22 ac_cv_linux_config_h_exists=no)])
23 AC_MSG_RESULT($ac_cv_linux_config_h_exists)
24 if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
25 AC_DEFINE([CONFIG_H_EXISTS], 1, [define if linux/config.h exists])
29 AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
30 AC_MSG_CHECKING([for linux/completion.h existance])
31 AC_CACHE_VAL([ac_cv_linux_completion_h_exists], [
33 [#include <linux/version.h>
34 #include <linux/completion.h>],
35 [struct completion _c;
36 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
39 ac_cv_linux_completion_h_exists=yes,
40 ac_cv_linux_completion_h_exists=no)])
41 AC_MSG_RESULT($ac_cv_linux_completion_h_exists)])
44 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
45 AC_MSG_CHECKING([for defined for_each_process])
46 AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
48 [#include <linux/sched.h>],
49 [#ifndef for_each_process
50 #error for_each_process not defined
52 ac_cv_linux_defines_for_each_process=yes,
53 ac_cv_linux_defines_for_each_process=no)])
54 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
57 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
58 AC_MSG_CHECKING([for defined prev_task])
59 AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
61 [#include <linux/sched.h>],
63 #error prev_task not defined
65 ac_cv_linux_defines_prev_task=yes,
66 ac_cv_linux_defines_prev_task=no)])
67 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
70 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
71 AC_MSG_CHECKING([for exported init_mm])
72 AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
74 [#include <linux/modversions.h>],
75 [#ifndef __ver_init_mm
76 #error init_mm not exported
78 ac_cv_linux_exports_init_mm=yes,
79 ac_cv_linux_exports_init_mm=no)])
80 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
83 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
84 AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
85 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
87 [#include <linux/modversions.h>],
88 [#ifndef __ver_kallsyms_address_to_symbol
89 #error kallsyms_address_to_symbol not exported
91 ac_cv_linux_exports_kallsyms_address=yes,
92 ac_cv_linux_exports_kallsyms_address=no)])
93 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
96 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
97 AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
98 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
100 [#include <linux/modversions.h>],
101 [#ifndef __ver_kallsyms_symbol_to_address
102 #error kallsyms_symbol_to_address not exported
104 ac_cv_linux_exports_kallsyms_symbol=yes,
105 ac_cv_linux_exports_kallsyms_symbol=no)])
106 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
108 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
109 AC_MSG_CHECKING([for exported sys_call_table])
110 AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
112 [#include <linux/modversions.h>],
113 [#ifndef __ver_sys_call_table
114 #error sys_call_table not exported
116 ac_cv_linux_exports_sys_call_table=yes,
117 ac_cv_linux_exports_sys_call_table=no)])
118 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
121 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
122 AC_MSG_CHECKING([for exported ia32_sys_call_table])
123 AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
125 [#include <linux/modversions.h>],
126 [#ifndef __ver_ia32_sys_call_table
127 #error ia32_sys_call_table not exported
129 ac_cv_linux_exports_ia32_sys_call_table=yes,
130 ac_cv_linux_exports_ia32_sys_call_table=no)])
131 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
134 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
135 AC_MSG_CHECKING([for exported sys_chdir])
136 AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
138 [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
139 [void *address = &sys_chdir;
140 printk("%p\n", address);],
141 ac_cv_linux_exports_sys_chdir=yes,
142 ac_cv_linux_exports_sys_chdir=no)])
143 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
146 AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
147 AC_MSG_CHECKING([for exported sys_close])
148 AC_CACHE_VAL([ac_cv_linux_exports_sys_close], [
150 [extern asmlinkage long sys_close(void) __attribute__((weak));],
151 [void *address = &sys_close;
152 printk("%p\n", address);],
153 ac_cv_linux_exports_sys_close=yes,
154 ac_cv_linux_exports_sys_close=no)])
155 AC_MSG_RESULT($ac_cv_linux_exports_sys_close)])
158 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
159 AC_MSG_CHECKING([for exported sys_open])
160 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
162 [extern asmlinkage long sys_open(void) __attribute__((weak));],
163 [void *address = &sys_open;
164 printk("%p\n", address);],
165 ac_cv_linux_exports_sys_open=yes,
166 ac_cv_linux_exports_sys_open=no)])
167 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
170 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
171 AC_MSG_CHECKING([for exported sys_wait4])
172 AC_CACHE_VAL([ac_cv_linux_exports_sys_wait4], [
174 [extern asmlinkage long sys_wait4(void) __attribute__((weak));],
175 [void *address = &sys_wait4;
176 printk("%p\n", address);],
177 ac_cv_linux_exports_sys_wait4=yes,
178 ac_cv_linux_exports_sys_wait4=no)])
179 AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)])
182 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE], [
183 AC_MSG_CHECKING([for i_blksize in struct inode])
184 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blksize], [
186 [#include <linux/fs.h>],
187 [struct inode _inode;
188 printk("%d\n", _inode.i_blksize);],
189 ac_cv_linux_fs_struct_inode_has_i_blksize=yes,
190 ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
191 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
193 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [
194 AC_MSG_CHECKING([for i_blkbits in struct inode])
195 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
197 [#include <linux/fs.h>],
198 [struct inode _inode;
199 printk("%d\n", _inode.i_blkbits);],
200 ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
201 ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
202 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
203 if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
204 AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
208 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
209 AC_MSG_CHECKING([for i_cdev in struct inode])
210 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
212 [#include <linux/fs.h>],
213 [struct inode _inode;
214 printk("%d\n", _inode.i_cdev);],
215 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
216 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
217 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
220 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
221 AC_MSG_CHECKING([for i_devices in struct inode])
222 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_devices], [
224 [#include <linux/fs.h>],
225 [struct inode _inode;
226 printk("%d\n", _inode.i_devices);],
227 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
228 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
229 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)])
232 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
233 AC_MSG_CHECKING([for i_dirty_data_buffers in struct inode])
234 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers], [
236 [#include <linux/fs.h>],
237 [struct inode _inode;
238 printk("%d\n", _inode.i_dirty_data_buffers);],
239 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
240 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
241 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)])
244 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [
245 AC_MSG_CHECKING([for inotify_lock in struct inode])
246 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_lock], [
248 [#include <linux/fs.h>],
249 [struct inode _inode;
250 printk("%d\n", _inode.inotify_lock);],
251 ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
252 ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
253 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)])
255 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [
256 AC_MSG_CHECKING([for inotify_sem in struct inode])
257 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_sem], [
259 [#include <linux/fs.h>],
260 [struct inode _inode;
261 printk("%x\n", _inode.inotify_sem);],
262 ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
263 ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
264 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)])
267 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
268 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
269 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
271 [#include <linux/fs.h>],
272 [struct inode _inode;
273 printk("%d\n", _inode.i_mapping_overload);],
274 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
275 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
276 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
279 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
280 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
281 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
283 [#include <linux/fs.h>],
284 [struct inode _inode;
285 printk("%d\n", _inode.i_mmap_shared);],
286 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
287 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
288 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
291 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
292 AC_MSG_CHECKING([for i_mutex in struct inode])
293 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
295 [#include <linux/fs.h>],
296 [struct inode _inode;
297 printk("%d\n", _inode.i_mutex);],
298 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
299 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
300 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
303 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
304 AC_MSG_CHECKING([for i_security in struct inode])
305 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
307 [#include <linux/fs.h>],
308 [struct inode _inode;
309 printk("%d\n", _inode.i_security);],
310 ac_cv_linux_fs_struct_inode_has_i_security=yes,
311 ac_cv_linux_fs_struct_inode_has_i_security=no)])
312 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
315 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST], [
316 AC_MSG_CHECKING([for i_sb_list in struct inode])
317 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_sb_list], [
319 [#include <linux/fs.h>],
320 [struct inode _inode;
321 printk("%d\n", _inode.i_sb_list);],
322 ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
323 ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
324 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)])
327 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
328 AC_MSG_CHECKING([for recalc_sigpending arg type])
329 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
331 [#include <linux/sched.h>],
332 [recalc_sigpending();],
333 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
334 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
335 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
338 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
339 AC_MSG_CHECKING([for parent in struct task_struct])
340 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
342 [#include <linux/sched.h>],
343 [struct task_struct _tsk;
344 printk("%d\n", _tsk.parent);],
345 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
346 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
347 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
350 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
351 AC_MSG_CHECKING([for tgid in struct task_struct])
352 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
354 [#include <linux/sched.h>],
355 [struct task_struct _tsk;
356 printk("%d\n", _tsk.tgid);],
357 ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
358 ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
359 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
362 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
363 AC_MSG_CHECKING([for real_parent in struct task_struct])
364 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
366 [#include <linux/sched.h>],
367 [struct task_struct _tsk;
368 printk("%d\n", _tsk.real_parent);],
369 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
370 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
371 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
374 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
375 AC_MSG_CHECKING([for sig in struct task_struct])
376 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
378 [#include <linux/sched.h>],
379 [struct task_struct _tsk;
380 printk("%d\n", _tsk.sig);],
381 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
382 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
383 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
386 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
387 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
388 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
390 [#include <linux/sched.h>],
391 [struct task_struct _tsk;
392 printk("%d\n", _tsk.sigmask_lock);],
393 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
394 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
395 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
398 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
399 AC_MSG_CHECKING([for sighand in struct task_struct])
400 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
402 [#include <linux/sched.h>],
403 [struct task_struct _tsk;
404 printk("%d\n", _tsk.sighand);],
405 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
406 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
407 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
410 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
411 AC_MSG_CHECKING([for rlim in struct task_struct])
412 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
414 [#include <linux/sched.h>],
415 [struct task_struct _tsk;
416 printk("%d\n", _tsk.rlim);],
417 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
418 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
419 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
422 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
423 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
424 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
426 [#include <linux/sched.h>],
427 [struct task_struct _tsk;
428 printk("%d\n", _tsk.signal->rlim);],
429 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
430 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
431 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
434 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
435 AC_MSG_CHECKING([for exit_state in struct task_struct])
436 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
438 [#include <linux/sched.h>],
439 [struct task_struct _tsk;
440 printk("%d\n", _tsk.exit_state);],
441 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
442 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
443 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
446 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
447 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
448 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
450 [#include <linux/fs.h>],
451 [struct super_operations _super;
452 printk("%p\n", _super.alloc_inode);],
453 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
454 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
455 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
458 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
459 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
460 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
462 [#include <linux/net.h>],
463 [sock_create(0,0,0,0,0);],
464 ac_cv_linux_kernel_sock_create_v=yes,
465 ac_cv_linux_kernel_sock_create_v=no)])
466 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
469 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
470 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
471 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
472 save_CPPFLAGS="$CPPFLAGS"
473 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
475 [#include <linux/fs.h>],
476 [page_follow_link(0,0);],
477 ac_cv_linux_kernel_page_follow_link=yes,
478 ac_cv_linux_kernel_page_follow_link=no)
479 CPPFLAGS="$save_CPPFLAGS"])
480 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
483 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
484 AC_MSG_CHECKING([for gfp_mask in struct address_space])
485 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
487 [#include <linux/fs.h>],
488 [struct address_space _a;
489 printk("%d\n", _a.gfp_mask);],
490 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
491 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
492 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
495 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
496 AC_MSG_CHECKING([for i_bytes in struct inode])
497 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
499 [#include <linux/fs.h>],
500 [struct inode _inode;
501 printk("%d\n", _inode.i_bytes);],
502 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
503 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
504 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
507 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
508 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
509 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
511 [#include <linux/fs.h>],
513 printk("%x\n", _i.i_alloc_sem);],
514 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
515 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
516 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
519 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
520 AC_MSG_CHECKING([for i_truncate_sem in struct inode])
521 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
523 [#include <linux/fs.h>],
525 printk("%x\n", _i.i_truncate_sem);],
526 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
527 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
528 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
531 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
532 AC_MSG_CHECKING([for page_lock in struct address_space])
533 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
535 [#include <linux/fs.h>],
536 [struct address_space _a_s;
537 printk("%x\n", _a_s.page_lock);],
538 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
539 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
540 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
543 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
544 AC_MSG_CHECKING([for inode_setattr return type])
545 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
547 [#include <linux/fs.h>],
548 [struct inode _inode;
551 i = inode_setattr(&_inode, &_iattr);],
552 ac_cv_linux_func_inode_setattr_returns_int=yes,
553 ac_cv_linux_func_inode_setattr_returns_int=no)])
554 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
557 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
558 AC_MSG_CHECKING([for write_inode return type])
559 AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
561 [#include <linux/fs.h>],
562 [struct inode _inode;
563 struct super_operations _sops;
565 i = _sops.write_inode(&_inode, 0);],
566 ac_cv_linux_func_write_inode_returns_int=yes,
567 ac_cv_linux_func_write_inode_returns_int=no)])
568 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
571 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
572 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
573 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
575 [#include <linux/fs.h>
576 #include <linux/mm.h>
577 #include <linux/writeback.h>],
578 [struct address_space_operations _aops;
580 struct writeback_control _writeback_control;
581 (void)_aops.writepage(&_page, &_writeback_control);],
582 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
583 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
584 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
587 AC_DEFUN([LINUX_REFRIGERATOR], [
588 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
589 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
591 [#include <linux/sched.h>
592 #ifdef FREEZER_H_EXISTS
593 #include <linux/freezer.h>
595 [refrigerator(PF_FREEZE);],
596 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
597 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
598 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
601 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
602 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
603 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
605 [#include <linux/fs.h>
606 #include <linux/namei.h>],
607 [struct inode _inode;
608 struct dentry _dentry;
609 struct nameidata _nameidata;
610 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
611 ac_cv_linux_func_i_create_takes_nameidata=yes,
612 ac_cv_linux_func_i_create_takes_nameidata=no)])
613 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
616 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
617 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
618 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
620 [#include <linux/fs.h>
621 #include <linux/namei.h>],
622 [struct inode _inode;
623 struct dentry _dentry;
624 struct nameidata _nameidata;
625 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
626 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
627 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
628 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
631 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
632 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
633 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
635 [#include <linux/fs.h>
636 #include <linux/namei.h>],
637 [struct inode _inode;
638 struct dentry _dentry;
639 struct nameidata _nameidata;
640 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
641 ac_cv_linux_func_i_permission_takes_nameidata=yes,
642 ac_cv_linux_func_i_permission_takes_nameidata=no)])
643 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
646 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
647 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
648 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
650 [#include <linux/fs.h>
651 #include <linux/namei.h>],
652 [struct dentry _dentry;
653 struct nameidata _nameidata;
654 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
655 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
656 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
657 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
659 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
660 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
661 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
663 [#include <linux/fs.h>],
664 [get_sb_nodev(0,0,0,0,0);],
665 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
666 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
667 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
669 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
670 AC_MSG_CHECKING([for dentry in statfs])
671 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
673 [#include <linux/fs.h>
674 #include <linux/statfs.h>],
676 extern int vfs_statfs(struct dentry *, struct kstatfs *);
678 ac_cv_linux_statfs_takes_dentry=yes,
679 ac_cv_linux_statfs_takes_dentry=no)])
680 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
682 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
683 AC_MSG_CHECKING([for linux kernel keyring support])
684 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
686 [#include <linux/rwsem.h>
687 #include <linux/key.h>
688 #include <linux/keyctl.h>],
690 request_key(NULL, NULL, NULL);
691 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
692 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
695 #error rebuild your kernel with CONFIG_KEYS
697 ac_cv_linux_keyring_support=yes,
698 ac_cv_linux_keyring_support=no)])
699 AC_MSG_RESULT($ac_cv_linux_keyring_support)
700 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
701 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
704 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
705 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
706 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
708 [#include <linux/rwsem.h>
709 #include <linux/key.h>
711 [(void) key_alloc(NULL, NULL, 0, 0, NULL, 0, 0);],
712 ac_cv_key_alloc_needs_struct_task=yes,
713 ac_cv_key_alloc_needs_struct_task=no)])
714 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
715 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
716 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
719 AC_DEFUN([LINUX_DO_SYNC_READ], [
720 AC_MSG_CHECKING([for linux do_sync_read()])
721 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
722 save_CPPFLAGS="$CPPFLAGS"
723 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
725 [#include <linux/fs.h>],
726 [do_sync_read(NULL, NULL, 0, NULL);],
727 ac_cv_linux_do_sync_read=yes,
728 ac_cv_linux_do_sync_read=no)
729 CPPFLAGS="$save_CPPFLAGS"])
730 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
731 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
732 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
735 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
736 AC_MSG_CHECKING([for linux generic_file_aio_read()])
737 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
738 save_CPPFLAGS="$CPPFLAGS"
739 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
741 [#include <linux/fs.h>],
742 [generic_file_aio_read(NULL, NULL, 0, 0);],
743 ac_cv_linux_generic_file_aio_read=yes,
744 ac_cv_linux_generic_file_aio_read=no)
745 CPPFLAGS="$save_CPPFLAGS"])
746 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
747 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
748 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
751 AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
752 AC_MSG_CHECKING([for linux/freezer.h existance])
753 AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
755 [#include <linux/freezer.h>],
757 ac_cv_linux_freezer_h_exists=yes,
758 ac_cv_linux_freezer_h_exists=no)])
759 AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
760 if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
761 AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
764 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
765 AC_MSG_CHECKING([for todo in struct task_struct])
766 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
768 [#include <linux/sched.h>],
769 [struct task_struct _tsk;
770 printk("%d\n", _tsk.todo);],
771 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
772 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
773 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
775 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
776 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
777 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
779 [#include <linux/kernel.h>
780 #include <linux/workqueue.h>],
782 void f(struct work_struct *w) {}
783 struct work_struct *w;
786 ac_cv_linux_init_work_has_data=yes,
787 ac_cv_linux_init_work_has_data=no)])
788 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
791 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
792 AC_MSG_CHECKING([for flock in struct file_operations])
793 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
795 [#include <linux/fs.h>],
796 [struct file_operations _fop;
797 _fop.flock(NULL, 0, NULL);],
798 ac_cv_linux_fs_struct_fop_has_flock=yes,
799 ac_cv_linux_fs_struct_fop_has_flock=no)])
800 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])