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_BLKBITS], [
180 AC_MSG_CHECKING([for i_blkbits in struct inode])
181 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
183 [#include <linux/fs.h>],
184 [struct inode _inode;
185 printk("%d\n", _inode.i_blkbits);],
186 ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
187 ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
188 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
189 if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
190 AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
194 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
195 AC_MSG_CHECKING([for i_cdev in struct inode])
196 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
198 [#include <linux/fs.h>],
199 [struct inode _inode;
200 printk("%d\n", _inode.i_cdev);],
201 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
202 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
203 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
206 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
207 AC_MSG_CHECKING([for i_devices in struct inode])
208 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_devices], [
210 [#include <linux/fs.h>],
211 [struct inode _inode;
212 printk("%d\n", _inode.i_devices);],
213 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
214 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
215 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)])
218 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
219 AC_MSG_CHECKING([for i_dirty_data_buffers in struct inode])
220 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers], [
222 [#include <linux/fs.h>],
223 [struct inode _inode;
224 printk("%d\n", _inode.i_dirty_data_buffers);],
225 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
226 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
227 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)])
230 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [
231 AC_MSG_CHECKING([for inotify_lock in struct inode])
232 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_lock], [
234 [#include <linux/fs.h>],
235 [struct inode _inode;
236 printk("%d\n", _inode.inotify_lock);],
237 ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
238 ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
239 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)])
241 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [
242 AC_MSG_CHECKING([for inotify_sem in struct inode])
243 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_sem], [
245 [#include <linux/fs.h>],
246 [struct inode _inode;
247 printk("%x\n", _inode.inotify_sem);],
248 ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
249 ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
250 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)])
253 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
254 AC_MSG_CHECKING([for i_mapping_overload in struct inode])
255 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
257 [#include <linux/fs.h>],
258 [struct inode _inode;
259 printk("%d\n", _inode.i_mapping_overload);],
260 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
261 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
262 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
265 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
266 AC_MSG_CHECKING([for i_mmap_shared in struct inode])
267 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
269 [#include <linux/fs.h>],
270 [struct inode _inode;
271 printk("%d\n", _inode.i_mmap_shared);],
272 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
273 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
274 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
277 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
278 AC_MSG_CHECKING([for i_mutex in struct inode])
279 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
281 [#include <linux/fs.h>],
282 [struct inode _inode;
283 printk("%d\n", _inode.i_mutex);],
284 ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
285 ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
286 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
289 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
290 AC_MSG_CHECKING([for i_security in struct inode])
291 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
293 [#include <linux/fs.h>],
294 [struct inode _inode;
295 printk("%d\n", _inode.i_security);],
296 ac_cv_linux_fs_struct_inode_has_i_security=yes,
297 ac_cv_linux_fs_struct_inode_has_i_security=no)])
298 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
301 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST], [
302 AC_MSG_CHECKING([for i_sb_list in struct inode])
303 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_sb_list], [
305 [#include <linux/fs.h>],
306 [struct inode _inode;
307 printk("%d\n", _inode.i_sb_list);],
308 ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
309 ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
310 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)])
313 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
314 AC_MSG_CHECKING([for recalc_sigpending arg type])
315 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
317 [#include <linux/sched.h>],
318 [recalc_sigpending();],
319 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
320 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
321 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
324 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
325 AC_MSG_CHECKING([for parent in struct task_struct])
326 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
328 [#include <linux/sched.h>],
329 [struct task_struct _tsk;
330 printk("%d\n", _tsk.parent);],
331 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
332 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
333 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
336 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
337 AC_MSG_CHECKING([for real_parent in struct task_struct])
338 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
340 [#include <linux/sched.h>],
341 [struct task_struct _tsk;
342 printk("%d\n", _tsk.real_parent);],
343 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
344 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
345 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
348 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
349 AC_MSG_CHECKING([for sig in struct task_struct])
350 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
352 [#include <linux/sched.h>],
353 [struct task_struct _tsk;
354 printk("%d\n", _tsk.sig);],
355 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
356 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
357 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
360 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
361 AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
362 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
364 [#include <linux/sched.h>],
365 [struct task_struct _tsk;
366 printk("%d\n", _tsk.sigmask_lock);],
367 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
368 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
369 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
372 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
373 AC_MSG_CHECKING([for sighand in struct task_struct])
374 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
376 [#include <linux/sched.h>],
377 [struct task_struct _tsk;
378 printk("%d\n", _tsk.sighand);],
379 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
380 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
381 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
384 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
385 AC_MSG_CHECKING([for rlim in struct task_struct])
386 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
388 [#include <linux/sched.h>],
389 [struct task_struct _tsk;
390 printk("%d\n", _tsk.rlim);],
391 ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
392 ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
393 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
396 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
397 AC_MSG_CHECKING([for signal->rlim in struct task_struct])
398 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
400 [#include <linux/sched.h>],
401 [struct task_struct _tsk;
402 printk("%d\n", _tsk.signal->rlim);],
403 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
404 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
405 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
408 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
409 AC_MSG_CHECKING([for exit_state in struct task_struct])
410 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
412 [#include <linux/sched.h>],
413 [struct task_struct _tsk;
414 printk("%d\n", _tsk.exit_state);],
415 ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
416 ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
417 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
420 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
421 AC_MSG_CHECKING([for alloc_inode in struct super_operations])
422 AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
424 [#include <linux/fs.h>],
425 [struct super_operations _super;
426 printk("%p\n", _super.alloc_inode);],
427 ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
428 ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
429 AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
432 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
433 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
434 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
436 [#include <linux/net.h>],
437 [sock_create(0,0,0,0,0);],
438 ac_cv_linux_kernel_sock_create_v=yes,
439 ac_cv_linux_kernel_sock_create_v=no)])
440 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
443 AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
444 AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
445 AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
446 save_CPPFLAGS="$CPPFLAGS"
447 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
449 [#include <linux/fs.h>],
450 [page_follow_link(0,0);],
451 ac_cv_linux_kernel_page_follow_link=yes,
452 ac_cv_linux_kernel_page_follow_link=no)
453 CPPFLAGS="$save_CPPFLAGS"])
454 AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
457 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
458 AC_MSG_CHECKING([for gfp_mask in struct address_space])
459 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
461 [#include <linux/fs.h>],
462 [struct address_space _a;
463 printk("%d\n", _a.gfp_mask);],
464 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
465 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
466 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
469 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
470 AC_MSG_CHECKING([for i_bytes in struct inode])
471 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
473 [#include <linux/fs.h>],
474 [struct inode _inode;
475 printk("%d\n", _inode.i_bytes);],
476 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
477 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
478 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
481 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
482 AC_MSG_CHECKING([for i_alloc_sem in struct inode])
483 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
485 [#include <linux/fs.h>],
487 printk("%x\n", _i.i_alloc_sem);],
488 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
489 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
490 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
493 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
494 AC_MSG_CHECKING([for i_truncate_sem in struct inode])
495 AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
497 [#include <linux/fs.h>],
499 printk("%x\n", _i.i_truncate_sem);],
500 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
501 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
502 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
505 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
506 AC_MSG_CHECKING([for page_lock in struct address_space])
507 AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
509 [#include <linux/fs.h>],
510 [struct address_space _a_s;
511 printk("%x\n", _a_s.page_lock);],
512 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
513 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
514 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
517 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
518 AC_MSG_CHECKING([for inode_setattr return type])
519 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
521 [#include <linux/fs.h>],
522 [struct inode _inode;
525 i = inode_setattr(&_inode, &_iattr);],
526 ac_cv_linux_func_inode_setattr_returns_int=yes,
527 ac_cv_linux_func_inode_setattr_returns_int=no)])
528 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
531 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
532 AC_MSG_CHECKING([for write_inode return type])
533 AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
535 [#include <linux/fs.h>],
536 [struct inode _inode;
537 struct super_operations _sops;
539 i = _sops.write_inode(&_inode, 0);],
540 ac_cv_linux_func_write_inode_returns_int=yes,
541 ac_cv_linux_func_write_inode_returns_int=no)])
542 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
545 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
546 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
547 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
549 [#include <linux/fs.h>
550 #include <linux/mm.h>
551 #include <linux/writeback.h>],
552 [struct address_space_operations _aops;
554 struct writeback_control _writeback_control;
555 (void)_aops.writepage(&_page, &_writeback_control);],
556 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
557 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
558 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
561 AC_DEFUN([LINUX_REFRIGERATOR], [
562 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
563 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
565 [#include <linux/sched.h>
566 #ifdef FREEZER_H_EXISTS
567 #include <linux/freezer.h>
569 [refrigerator(PF_FREEZE);],
570 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
571 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
572 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
575 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
576 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
577 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
579 [#include <linux/fs.h>
580 #include <linux/namei.h>],
581 [struct inode _inode;
582 struct dentry _dentry;
583 struct nameidata _nameidata;
584 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
585 ac_cv_linux_func_i_create_takes_nameidata=yes,
586 ac_cv_linux_func_i_create_takes_nameidata=no)])
587 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
590 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
591 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
592 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
594 [#include <linux/fs.h>
595 #include <linux/namei.h>],
596 [struct inode _inode;
597 struct dentry _dentry;
598 struct nameidata _nameidata;
599 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
600 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
601 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
602 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
605 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
606 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
607 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
609 [#include <linux/fs.h>
610 #include <linux/namei.h>],
611 [struct inode _inode;
612 struct dentry _dentry;
613 struct nameidata _nameidata;
614 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
615 ac_cv_linux_func_i_permission_takes_nameidata=yes,
616 ac_cv_linux_func_i_permission_takes_nameidata=no)])
617 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
620 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
621 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
622 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
624 [#include <linux/fs.h>
625 #include <linux/namei.h>],
626 [struct dentry _dentry;
627 struct nameidata _nameidata;
628 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
629 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
630 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
631 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
633 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
634 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
635 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
637 [#include <linux/fs.h>],
638 [get_sb_nodev(0,0,0,0,0);],
639 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
640 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
641 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
643 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
644 AC_MSG_CHECKING([for dentry in statfs])
645 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
647 [#include <linux/fs.h>
648 #include <linux/statfs.h>],
650 extern int vfs_statfs(struct dentry *, struct kstatfs *);
652 ac_cv_linux_statfs_takes_dentry=yes,
653 ac_cv_linux_statfs_takes_dentry=no)])
654 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
656 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
657 AC_MSG_CHECKING([for linux kernel keyring support])
658 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
660 [#include <linux/rwsem.h>
661 #include <linux/key.h>
662 #include <linux/keyctl.h>],
664 request_key(NULL, NULL, NULL);
665 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
666 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
669 #error rebuild your kernel with CONFIG_KEYS
671 ac_cv_linux_keyring_support=yes,
672 ac_cv_linux_keyring_support=no)])
673 AC_MSG_RESULT($ac_cv_linux_keyring_support)
674 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
675 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
678 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
679 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
680 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
682 [#include <linux/rwsem.h>
683 #include <linux/key.h>
685 [(void) key_alloc(NULL, NULL, 0, 0, NULL, 0, 0);],
686 ac_cv_key_alloc_needs_struct_task=yes,
687 ac_cv_key_alloc_needs_struct_task=no)])
688 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
689 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
690 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
693 AC_DEFUN([LINUX_DO_SYNC_READ], [
694 AC_MSG_CHECKING([for linux do_sync_read()])
695 AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
696 save_CPPFLAGS="$CPPFLAGS"
697 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
699 [#include <linux/fs.h>],
700 [do_sync_read(NULL, NULL, 0, NULL);],
701 ac_cv_linux_do_sync_read=yes,
702 ac_cv_linux_do_sync_read=no)
703 CPPFLAGS="$save_CPPFLAGS"])
704 AC_MSG_RESULT($ac_cv_linux_do_sync_read)
705 if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
706 AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
709 AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
710 AC_MSG_CHECKING([for linux generic_file_aio_read()])
711 AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
712 save_CPPFLAGS="$CPPFLAGS"
713 CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
715 [#include <linux/fs.h>],
716 [generic_file_aio_read(NULL, NULL, 0, 0);],
717 ac_cv_linux_generic_file_aio_read=yes,
718 ac_cv_linux_generic_file_aio_read=no)
719 CPPFLAGS="$save_CPPFLAGS"])
720 AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
721 if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
722 AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
725 AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
726 AC_MSG_CHECKING([for linux/freezer.h existance])
727 AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
729 [#include <linux/freezer.h>],
731 ac_cv_linux_freezer_h_exists=yes,
732 ac_cv_linux_freezer_h_exists=no)])
733 AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
734 if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
735 AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
738 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
739 AC_MSG_CHECKING([for todo in struct task_struct])
740 AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
742 [#include <linux/sched.h>],
743 [struct task_struct _tsk;
744 printk("%d\n", _tsk.todo);],
745 ac_cv_linux_sched_struct_task_struct_has_todo=yes,
746 ac_cv_linux_sched_struct_task_struct_has_todo=no)])
747 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
749 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
750 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
751 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
753 [#include <linux/kernel.h>
754 #include <linux/workqueue.h>],
756 void f(struct work_struct *w) {}
757 struct work_struct *w;
760 ac_cv_linux_init_work_has_data=yes,
761 ac_cv_linux_init_work_has_data=no)])
762 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
765 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_FLOCK], [
766 AC_MSG_CHECKING([for flock in struct file_operations])
767 AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_flock], [
769 [#include <linux/fs.h>],
770 [struct file_operations _fop;
771 _fop.flock(NULL, 0, NULL);],
772 ac_cv_linux_fs_struct_fop_has_flock=yes,
773 ac_cv_linux_fs_struct_fop_has_flock=no)])
774 AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_flock)])