1 AC_DEFUN([LINUX_CONFIG_H_EXISTS], [
2 AC_MSG_CHECKING([for linux/config.h existance])
3 AC_CACHE_VAL([ac_cv_linux_config_h_exists], [
5 [#include <linux/config.h>],
7 ac_cv_linux_config_h_exists=yes,
8 ac_cv_linux_config_h_exists=no)])
9 AC_MSG_RESULT($ac_cv_linux_config_h_exists)
10 if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
11 AC_DEFINE([CONFIG_H_EXISTS], 1, [define if linux/config.h exists])
15 AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
16 AC_MSG_CHECKING([for linux/completion.h existance])
17 AC_CACHE_VAL([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 AC_MSG_RESULT($ac_cv_linux_completion_h_exists)])
30 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
31 AC_MSG_CHECKING([for defined for_each_process])
32 AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
34 [#include <linux/sched.h>],
35 [#ifndef for_each_process
36 #error for_each_process not defined
38 ac_cv_linux_defines_for_each_process=yes,
39 ac_cv_linux_defines_for_each_process=no)])
40 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
43 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
44 AC_MSG_CHECKING([for defined prev_task])
45 AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
47 [#include <linux/sched.h>],
49 #error prev_task not defined
51 ac_cv_linux_defines_prev_task=yes,
52 ac_cv_linux_defines_prev_task=no)])
53 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
56 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
57 AC_MSG_CHECKING([for exported init_mm])
58 AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
60 [#include <linux/modversions.h>],
61 [#ifndef __ver_init_mm
62 #error init_mm not exported
64 ac_cv_linux_exports_init_mm=yes,
65 ac_cv_linux_exports_init_mm=no)])
66 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
69 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
70 AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
71 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
73 [#include <linux/modversions.h>],
74 [#ifndef __ver_kallsyms_address_to_symbol
75 #error kallsyms_address_to_symbol not exported
77 ac_cv_linux_exports_kallsyms_address=yes,
78 ac_cv_linux_exports_kallsyms_address=no)])
79 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
82 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
83 AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
84 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
86 [#include <linux/modversions.h>],
87 [#ifndef __ver_kallsyms_symbol_to_address
88 #error kallsyms_symbol_to_address not exported
90 ac_cv_linux_exports_kallsyms_symbol=yes,
91 ac_cv_linux_exports_kallsyms_symbol=no)])
92 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
94 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
95 AC_MSG_CHECKING([for exported sys_call_table])
96 AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
98 [#include <linux/modversions.h>],
99 [#ifndef __ver_sys_call_table
100 #error sys_call_table not exported
102 ac_cv_linux_exports_sys_call_table=yes,
103 ac_cv_linux_exports_sys_call_table=no)])
104 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
107 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
108 AC_MSG_CHECKING([for exported ia32_sys_call_table])
109 AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
111 [#include <linux/modversions.h>],
112 [#ifndef __ver_ia32_sys_call_table
113 #error ia32_sys_call_table not exported
115 ac_cv_linux_exports_ia32_sys_call_table=yes,
116 ac_cv_linux_exports_ia32_sys_call_table=no)])
117 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
120 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
121 AC_MSG_CHECKING([for exported sys_chdir])
122 AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
124 [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
125 [void *address = &sys_chdir;
126 printk("%p\n", address);],
127 ac_cv_linux_exports_sys_chdir=yes,
128 ac_cv_linux_exports_sys_chdir=no)])
129 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
132 AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
133 AC_MSG_CHECKING([for exported sys_close])
134 AC_CACHE_VAL([ac_cv_linux_exports_sys_close], [
136 [extern asmlinkage long sys_close(void) __attribute__((weak));],
137 [void *address = &sys_close;
138 printk("%p\n", address);],
139 ac_cv_linux_exports_sys_close=yes,
140 ac_cv_linux_exports_sys_close=no)])
141 AC_MSG_RESULT($ac_cv_linux_exports_sys_close)])
144 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
145 AC_MSG_CHECKING([for exported sys_open])
146 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
148 [extern asmlinkage long sys_open(void) __attribute__((weak));],
149 [void *address = &sys_open;
150 printk("%p\n", address);],
151 ac_cv_linux_exports_sys_open=yes,
152 ac_cv_linux_exports_sys_open=no)])
153 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
156 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
157 AC_MSG_CHECKING([for exported sys_wait4])
158 AC_CACHE_VAL([ac_cv_linux_exports_sys_wait4], [
160 [extern asmlinkage long sys_wait4(void) __attribute__((weak));],
161 [void *address = &sys_wait4;
162 printk("%p\n", address);],
163 ac_cv_linux_exports_sys_wait4=yes,
164 ac_cv_linux_exports_sys_wait4=no)])
165 AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)])
168 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKSIZE], [
169 AC_MSG_CHECKING([for i_blksize in struct inode])
170 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blksize], [
172 [#include <linux/fs.h>],
173 [struct inode _inode;
174 printk("%d\n", _inode.i_blksize);],
175 ac_cv_linux_fs_struct_inode_has_i_blksize=yes,
176 ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
177 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
179 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
180 AC_MSG_CHECKING([for i_cdev in struct inode])
181 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
183 [#include <linux/fs.h>],
184 [struct inode _inode;
185 printk("%d\n", _inode.i_cdev);],
186 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
187 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
188 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
191 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
192 AC_MSG_CHECKING([for i_devices in struct inode])
193 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_devices], [
195 [#include <linux/fs.h>],
196 [struct inode _inode;
197 printk("%d\n", _inode.i_devices);],
198 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
199 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
200 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)])
203 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
204 AC_MSG_CHECKING([for i_dirty_data_buffers in struct inode])
205 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers], [
207 [#include <linux/fs.h>],
208 [struct inode _inode;
209 printk("%d\n", _inode.i_dirty_data_buffers);],
210 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
211 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
212 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)])
215 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [
216 AC_MSG_CHECKING([for inotify_lock in struct inode])
217 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_lock], [
219 [#include <linux/fs.h>],
220 [struct inode _inode;
221 printk("%d\n", _inode.inotify_lock);],
222 ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
223 ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
224 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)])
226 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [
227 AC_MSG_CHECKING([for inotify_sem in struct inode])
228 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_sem], [
230 [#include <linux/fs.h>],
231 [struct inode _inode;
232 printk("%x\n", _inode.inotify_sem);],
233 ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
234 ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
235 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)])
238 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
239 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
240 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
242 [#include <linux/fs.h>],
243 [struct inode _inode;
244 printk("%d\n", _inode.i_mapping_overload);],
245 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
246 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
247 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
250 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
251 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
252 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
254 [#include <linux/fs.h>],
255 [struct inode _inode;
256 printk("%d\n", _inode.i_mmap_shared);],
257 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
258 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
259 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
262 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
263 AC_MSG_CHECKING([for i_mutex in struct inode])
264 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
266 [#include <linux/fs.h>],
267 [struct inode _inode;
268 printk("%d\n", _inode.i_mutex);],
269 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
270 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
271 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
274 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
275 AC_MSG_CHECKING([for i_security in struct inode])
276 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
278 [#include <linux/fs.h>],
279 [struct inode _inode;
280 printk("%d\n", _inode.i_security);],
281 ac_cv_linux_fs_struct_inode_has_i_security=yes,
282 ac_cv_linux_fs_struct_inode_has_i_security=no)])
283 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
286 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST], [
287 AC_MSG_CHECKING([for i_sb_list in struct inode])
288 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_sb_list], [
290 [#include <linux/fs.h>],
291 [struct inode _inode;
292 printk("%d\n", _inode.i_sb_list);],
293 ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
294 ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
295 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)])
298 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
299 AC_MSG_CHECKING([for recalc_sigpending arg type])
300 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
302 [#include <linux/sched.h>],
303 [recalc_sigpending();],
304 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
305 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
306 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
309 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
310 AC_MSG_CHECKING([for parent in struct task_struct])
311 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
313 [#include <linux/sched.h>],
314 [struct task_struct _tsk;
315 printk("%d\n", _tsk.parent);],
316 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
317 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
318 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
321 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
322 AC_MSG_CHECKING([for real_parent in struct task_struct])
323 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
325 [#include <linux/sched.h>],
326 [struct task_struct _tsk;
327 printk("%d\n", _tsk.real_parent);],
328 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
329 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
330 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
333 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
334 AC_MSG_CHECKING([for sig in struct task_struct])
335 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
337 [#include <linux/sched.h>],
338 [struct task_struct _tsk;
339 printk("%d\n", _tsk.sig);],
340 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
341 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
342 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
345 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
346 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
347 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
349 [#include <linux/sched.h>],
350 [struct task_struct _tsk;
351 printk("%d\n", _tsk.sigmask_lock);],
352 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
353 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
354 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
357 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
358 AC_MSG_CHECKING([for sighand in struct task_struct])
359 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
361 [#include <linux/sched.h>],
362 [struct task_struct _tsk;
363 printk("%d\n", _tsk.sighand);],
364 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
365 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
366 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
369 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
370 AC_MSG_CHECKING([for rlim in struct task_struct])
371 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
373 [#include <linux/sched.h>],
374 [struct task_struct _tsk;
375 printk("%d\n", _tsk.rlim);],
376 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
377 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
378 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
381 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
382 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
383 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
385 [#include <linux/sched.h>],
386 [struct task_struct _tsk;
387 printk("%d\n", _tsk.signal->rlim);],
388 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
389 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
390 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
393 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
394 AC_MSG_CHECKING([for exit_state in struct task_struct])
395 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
397 [#include <linux/sched.h>],
398 [struct task_struct _tsk;
399 printk("%d\n", _tsk.exit_state);],
400 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
401 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
402 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
405 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
406 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
407 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
409 [#include <linux/fs.h>],
410 [struct super_operations _super;
411 printk("%p\n", _super.alloc_inode);],
412 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
413 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
414 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
417 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
418 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
419 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
421 [#include <linux/net.h>],
422 [sock_create(0,0,0,0,0);],
423 ac_cv_linux_kernel_sock_create_v=yes,
424 ac_cv_linux_kernel_sock_create_v=no)])
425 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
428 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
429 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
430 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
431 save_CPPFLAGS="$CPPFLAGS"
432 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
434 [#include <linux/fs.h>],
435 [page_follow_link(0,0);],
436 ac_cv_linux_kernel_page_follow_link=yes,
437 ac_cv_linux_kernel_page_follow_link=no)
438 CPPFLAGS="$save_CPPFLAGS"])
439 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
442 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
443 AC_MSG_CHECKING([for gfp_mask in struct address_space])
444 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
446 [#include <linux/fs.h>],
447 [struct address_space _a;
448 printk("%d\n", _a.gfp_mask);],
449 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
450 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
451 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
454 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
455 AC_MSG_CHECKING([for i_bytes in struct inode])
456 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
458 [#include <linux/fs.h>],
459 [struct inode _inode;
460 printk("%d\n", _inode.i_bytes);],
461 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
462 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
463 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
466 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
467 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
468 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
470 [#include <linux/fs.h>],
472 printk("%x\n", _i.i_alloc_sem);],
473 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
474 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
475 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
478 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
479 AC_MSG_CHECKING([for i_truncate_sem in struct inode])
480 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
482 [#include <linux/fs.h>],
484 printk("%x\n", _i.i_truncate_sem);],
485 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
486 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
487 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
490 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
491 AC_MSG_CHECKING([for page_lock in struct address_space])
492 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
494 [#include <linux/fs.h>],
495 [struct address_space _a_s;
496 printk("%x\n", _a_s.page_lock);],
497 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
498 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
499 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
502 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
503 AC_MSG_CHECKING([for inode_setattr return type])
504 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
506 [#include <linux/fs.h>],
507 [struct inode _inode;
510 i = inode_setattr(&_inode, &_iattr);],
511 ac_cv_linux_func_inode_setattr_returns_int=yes,
512 ac_cv_linux_func_inode_setattr_returns_int=no)])
513 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
516 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
517 AC_MSG_CHECKING([for write_inode return type])
518 AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
520 [#include <linux/fs.h>],
521 [struct inode _inode;
522 struct super_operations _sops;
524 i = _sops.write_inode(&_inode, 0);],
525 ac_cv_linux_func_write_inode_returns_int=yes,
526 ac_cv_linux_func_write_inode_returns_int=no)])
527 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
530 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
531 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
532 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
534 [#include <linux/fs.h>
535 #include <linux/mm.h>
536 #include <linux/writeback.h>],
537 [struct address_space_operations _aops;
539 struct writeback_control _writeback_control;
540 (void)_aops.writepage(&_page, &_writeback_control);],
541 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
542 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
543 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
546 AC_DEFUN([LINUX_REFRIGERATOR], [
547 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
548 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
550 [#include <linux/sched.h>],
551 [refrigerator(PF_FREEZE);],
552 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
553 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
554 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
557 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
558 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
559 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
561 [#include <linux/fs.h>
562 #include <linux/namei.h>],
563 [struct inode _inode;
564 struct dentry _dentry;
565 struct nameidata _nameidata;
566 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
567 ac_cv_linux_func_i_create_takes_nameidata=yes,
568 ac_cv_linux_func_i_create_takes_nameidata=no)])
569 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
572 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
573 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
574 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
576 [#include <linux/fs.h>
577 #include <linux/namei.h>],
578 [struct inode _inode;
579 struct dentry _dentry;
580 struct nameidata _nameidata;
581 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
582 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
583 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
584 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
587 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
588 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
589 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
591 [#include <linux/fs.h>
592 #include <linux/namei.h>],
593 [struct inode _inode;
594 struct dentry _dentry;
595 struct nameidata _nameidata;
596 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
597 ac_cv_linux_func_i_permission_takes_nameidata=yes,
598 ac_cv_linux_func_i_permission_takes_nameidata=no)])
599 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
602 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
603 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
604 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
606 [#include <linux/fs.h>
607 #include <linux/namei.h>],
608 [struct dentry _dentry;
609 struct nameidata _nameidata;
610 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
611 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
612 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
613 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
615 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
616 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
617 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
619 [#include <linux/fs.h>],
620 [get_sb_nodev(0,0,0,0,0);],
621 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
622 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
623 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
625 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
626 AC_MSG_CHECKING([for dentry in statfs])
627 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
629 [#include <linux/fs.h>
630 #include <linux/statfs.h>],
632 extern int vfs_statfs(struct dentry *, struct kstatfs *);
634 ac_cv_linux_statfs_takes_dentry=yes,
635 ac_cv_linux_statfs_takes_dentry=no)])
636 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
638 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
639 AC_MSG_CHECKING([for linux kernel keyring support])
640 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
642 [#include <linux/rwsem.h>
643 #include <linux/key.h>
644 #include <linux/keyctl.h>],
646 request_key(NULL, NULL, NULL);
647 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
648 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
651 #error rebuild your kernel with CONFIG_KEYS
653 ac_cv_linux_keyring_support=yes,
654 ac_cv_linux_keyring_support=no)])
655 AC_MSG_RESULT($ac_cv_linux_keyring_support)
656 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
657 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
660 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
661 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
662 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
664 [#include <linux/rwsem.h>
665 #include <linux/key.h>
667 [(void) key_alloc(NULL, NULL, 0, 0, NULL, 0, 0);],
668 ac_cv_key_alloc_needs_struct_task=yes,
669 ac_cv_key_alloc_needs_struct_task=no)])
670 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
671 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
672 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
675 AC_DEFUN([LINUX_DO_SYNC_READ], [
676 AC_MSG_CHECKING([for linux do_sync_read()])
677 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
678 save_CPPFLAGS="$CPPFLAGS"
679 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
681 [#include <linux/fs.h>],
682 [do_sync_read(NULL, NULL, 0, NULL);],
683 ac_cv_linux_do_sync_read=yes,
684 ac_cv_linux_do_sync_read=no)
685 CPPFLAGS="$save_CPPFLAGS"])
686 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
687 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
688 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
691 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
692 AC_MSG_CHECKING([for linux generic_file_aio_read()])
693 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
694 save_CPPFLAGS="$CPPFLAGS"
695 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
697 [#include <linux/fs.h>],
698 [generic_file_aio_read(NULL, NULL, 0, 0);],
699 ac_cv_linux_generic_file_aio_read=yes,
700 ac_cv_linux_generic_file_aio_read=no)
701 CPPFLAGS="$save_CPPFLAGS"])
702 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
703 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
704 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])