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