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_COMPLETION_H_EXISTS], [
17 AC_CACHE_CHECK([for linux/completion.h], [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 AS_IF([test "x$ac_linux_completion_h_exists" = xyes],
28 [AC_DEFINE(HAVE_LINUX_COMPLETION_H, 1,
29 [Define if your kernel has a usable linux/completion.h])])
32 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
33 AC_MSG_CHECKING([for defined for_each_process])
34 AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
36 [#include <linux/sched.h>],
37 [#ifndef for_each_process
38 #error for_each_process not defined
40 ac_cv_linux_defines_for_each_process=yes,
41 ac_cv_linux_defines_for_each_process=no)])
42 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
45 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
46 AC_MSG_CHECKING([for defined prev_task])
47 AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
49 [#include <linux/sched.h>],
51 #error prev_task not defined
53 ac_cv_linux_defines_prev_task=yes,
54 ac_cv_linux_defines_prev_task=no)])
55 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
58 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
59 AC_MSG_CHECKING([for exported init_mm])
60 AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
62 [extern struct mm_struct init_mm;],
63 [void *address = &init_mm;
64 printk("%p\n", address);],
65 ac_cv_linux_exports_init_mm=yes,
66 ac_cv_linux_exports_init_mm=no)])
67 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
70 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
71 AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
72 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
74 [#include <linux/modversions.h>],
75 [#ifndef __ver_kallsyms_address_to_symbol
76 #error kallsyms_address_to_symbol not exported
78 ac_cv_linux_exports_kallsyms_address=yes,
79 ac_cv_linux_exports_kallsyms_address=no)])
80 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
83 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
84 AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
85 AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
87 [#include <linux/modversions.h>],
88 [#ifndef __ver_kallsyms_symbol_to_address
89 #error kallsyms_symbol_to_address not exported
91 ac_cv_linux_exports_kallsyms_symbol=yes,
92 ac_cv_linux_exports_kallsyms_symbol=no)])
93 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
95 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
96 AC_MSG_CHECKING([for exported sys_call_table])
97 AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
99 [#include <linux/modversions.h>],
100 [#ifndef __ver_sys_call_table
101 #error sys_call_table not exported
103 ac_cv_linux_exports_sys_call_table=yes,
104 ac_cv_linux_exports_sys_call_table=no)])
105 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
108 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
109 AC_MSG_CHECKING([for exported ia32_sys_call_table])
110 AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
112 [#include <linux/modversions.h>],
113 [#ifndef __ver_ia32_sys_call_table
114 #error ia32_sys_call_table not exported
116 ac_cv_linux_exports_ia32_sys_call_table=yes,
117 ac_cv_linux_exports_ia32_sys_call_table=no)])
118 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
121 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
122 AC_MSG_CHECKING([for exported sys_chdir])
123 AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
125 [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
126 [void *address = &sys_chdir;
127 printk("%p\n", address);],
128 ac_cv_linux_exports_sys_chdir=yes,
129 ac_cv_linux_exports_sys_chdir=no)])
130 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
132 AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
133 AC_MSG_CHECKING([for exported sys_open])
134 AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
136 [extern asmlinkage long sys_open(void) __attribute__((weak));],
137 [void *address = &sys_open;
138 printk("%p\n", address);],
139 ac_cv_linux_exports_sys_open=yes,
140 ac_cv_linux_exports_sys_open=no)])
141 AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
144 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
145 AC_MSG_CHECKING([for recalc_sigpending arg type])
146 AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
148 [#include <linux/sched.h>],
149 [recalc_sigpending();],
150 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
151 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
152 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
155 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
156 AC_CACHE_CHECK([for signal->rlim in struct task_struct],
157 [ac_cv_linux_sched_struct_task_struct_has_signal_rlim],
159 [#include <linux/sched.h>],
160 [struct task_struct _tsk;
161 printk("%d\n", _tsk.signal->rlim);],
162 ac_cv_linux_struct_task_struct_has_signal_rlim=yes,
163 ac_cv_linux_struct_task_struct_has_signal_rlim=no)])
164 AS_IF([test "x$ac_cv_linux_struct_task_struct_has_signal_rlim" = "xyes"],
165 [AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM, 1,
166 [define if your struct task_struct has signal->rlim])])
170 AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
171 AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels])
172 AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [
174 [#include <linux/fs.h>],
175 [posix_lock_file(0,0,0);],
176 ac_cv_linux_kernel_posix_lock_file_wait_arg=yes,
177 ac_cv_linux_kernel_posix_lock_file_wait_arg=no)])
178 AC_MSG_RESULT($ac_cv_linux_kernel_posix_lock_file_wait_arg)])
180 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
181 AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
182 AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
184 [#include <linux/net.h>],
185 [sock_create(0,0,0,0,0);],
186 ac_cv_linux_kernel_sock_create_v=yes,
187 ac_cv_linux_kernel_sock_create_v=no)])
188 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
191 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
192 AC_MSG_CHECKING([for inode_setattr return type])
193 AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
195 [#include <linux/fs.h>],
196 [struct inode _inode;
199 i = inode_setattr(&_inode, &_iattr);],
200 ac_cv_linux_func_inode_setattr_returns_int=yes,
201 ac_cv_linux_func_inode_setattr_returns_int=no)])
202 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
205 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
206 AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
207 AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
209 [#include <linux/fs.h>
210 #include <linux/mm.h>
211 #include <linux/writeback.h>],
212 [struct address_space_operations _aops;
214 struct writeback_control _writeback_control;
215 (void)_aops.writepage(&_page, &_writeback_control);],
216 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
217 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
218 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
221 AC_DEFUN([LINUX_REFRIGERATOR], [
222 AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
223 AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
225 [#include <linux/sched.h>
226 #ifdef HAVE_LINUX_FREEZER_H
227 #include <linux/freezer.h>
229 [refrigerator(PF_FREEZE);],
230 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
231 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
232 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)
233 if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes"; then
234 AC_DEFINE([LINUX_REFRIGERATOR_TAKES_PF_FREEZE], 1, [define if your refrigerator takes PF_FREEZE])
237 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
238 AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
239 AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
241 [#include <linux/fs.h>
242 #include <linux/namei.h>],
243 [struct inode _inode;
244 struct dentry _dentry;
245 struct nameidata _nameidata;
246 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
247 ac_cv_linux_func_i_create_takes_nameidata=yes,
248 ac_cv_linux_func_i_create_takes_nameidata=no)])
249 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
252 AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
253 AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
254 AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
256 [#include <linux/fs.h>
257 #include <linux/namei.h>],
258 [struct inode _inode;
259 struct dentry _dentry;
260 struct nameidata _nameidata;
261 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
262 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
263 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
264 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
267 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
268 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
269 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
271 [#include <linux/fs.h>
272 #include <linux/namei.h>],
273 [struct inode _inode;
274 struct dentry _dentry;
275 struct nameidata _nameidata;
276 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
277 ac_cv_linux_func_i_permission_takes_nameidata=yes,
278 ac_cv_linux_func_i_permission_takes_nameidata=no)])
279 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
282 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
283 AC_MSG_CHECKING([whether inode_operations.put_link takes an opaque cookie])
284 AC_CACHE_VAL([ac_cv_linux_func_i_put_link_takes_cookie], [
286 [#include <linux/fs.h>
287 #include <linux/namei.h>],
288 [struct inode _inode;
289 struct dentry _dentry;
290 struct nameidata _nameidata;
292 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
293 ac_cv_linux_func_i_put_link_takes_cookie=yes,
294 ac_cv_linux_func_i_put_link_takes_cookie=no)])
295 AC_MSG_RESULT($ac_cv_linux_func_i_put_link_takes_cookie)])
298 AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
299 AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
300 AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
302 [#include <linux/fs.h>
303 #include <linux/namei.h>],
304 [struct dentry _dentry;
305 struct nameidata _nameidata;
306 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
307 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
308 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
309 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])
311 AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
312 AC_MSG_CHECKING([for struct vfsmount * in get_sb_nodev()])
313 AC_CACHE_VAL([ac_cv_linux_get_sb_has_struct_vfsmount], [
315 [#include <linux/fs.h>],
316 [get_sb_nodev(0,0,0,0,0);],
317 ac_cv_linux_get_sb_has_struct_vfsmount=yes,
318 ac_cv_linux_get_sb_has_struct_vfsmount=no)])
319 AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
321 AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
322 AC_MSG_CHECKING([for dentry in statfs])
323 AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
325 [#include <linux/fs.h>
326 #include <linux/statfs.h>],
328 extern int vfs_statfs(struct dentry *, struct kstatfs *);
330 ac_cv_linux_statfs_takes_dentry=yes,
331 ac_cv_linux_statfs_takes_dentry=no)])
332 AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
335 AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
336 AC_MSG_CHECKING([for linux kernel keyring support])
337 AC_CACHE_VAL([ac_cv_linux_keyring_support], [
339 [#include <linux/rwsem.h>
340 #ifdef HAVE_LINUX_KEY_TYPE_H
341 #include <linux/key-type.h>
343 #include <linux/key.h>
344 #include <linux/keyctl.h>],
346 request_key(NULL, NULL, NULL);
347 #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
348 #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
351 #error rebuild your kernel with CONFIG_KEYS
353 ac_cv_linux_keyring_support=yes,
354 ac_cv_linux_keyring_support=no)])
355 AC_MSG_RESULT($ac_cv_linux_keyring_support)
356 if test "x$ac_cv_linux_keyring_support" = "xyes"; then
357 AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
360 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
361 AC_MSG_CHECKING([if key_alloc() takes a struct task *])
362 AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
363 save_CPPFLAGS="$CPPFLAGS"
364 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
366 [#include <linux/rwsem.h>
367 #include <linux/key.h>
369 [struct task_struct *t=NULL;
370 (void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
371 ac_cv_key_alloc_needs_struct_task=yes,
372 ac_cv_key_alloc_needs_struct_task=no)
373 CPPFLAGS="$save_CPPFLAGS"])
374 AC_MSG_RESULT($ac_cv_key_alloc_needs_struct_task)
375 if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
376 AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
379 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
380 AC_MSG_CHECKING([if key_alloc() takes credentials])
381 AC_CACHE_VAL([ac_cv_key_alloc_needs_cred], [
382 save_CPPFLAGS="$CPPFLAGS"
383 CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
385 [#include <linux/rwsem.h>
386 #include <linux/key.h>
388 [struct cred *c = NULL;
389 (void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
390 ac_cv_key_alloc_needs_cred=yes,
391 ac_cv_key_alloc_needs_cred=no)
392 CPPFLAGS="$save_CPPFLAGS"])
393 AC_MSG_RESULT($ac_cv_key_alloc_needs_cred)
394 if test "x$ac_cv_key_alloc_needs_cred" = "xyes"; then
395 AC_DEFINE([KEY_ALLOC_NEEDS_CRED], 1, [define if key_alloc takes credentials])
398 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
399 AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
400 AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
402 [#include <linux/kernel.h>
403 #include <linux/workqueue.h>],
405 void f(struct work_struct *w) {}
406 struct work_struct *w;
409 ac_cv_linux_init_work_has_data=yes,
410 ac_cv_linux_init_work_has_data=no)])
411 AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
413 AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
414 AC_MSG_CHECKING([whether register_sysctl_table has an insert_at_head flag argument])
415 AC_CACHE_VAL([ac_cv_linux_register_sysctl_table_noflag], [
417 [#include <linux/sysctl.h>],
419 register_sysctl_table (t);],
420 ac_cv_linux_register_sysctl_table_noflag=yes,
421 ac_cv_linux_register_sysctl_table_noflag=no)])
422 AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
424 AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
425 AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
426 AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
428 [#include <linux/fs.h>],
429 [struct inode _inode;
432 (void)_inode.i_fop->flush(&_file, &id);],
433 ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
434 ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
435 AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
437 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
438 AC_MSG_CHECKING([whether kmem_cache_t exists])
439 AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
441 [#include <linux/slab.h>],
443 ac_cv_linux_have_kmem_cache_t=yes,
444 ac_cv_linux_have_kmem_cache_t=no)])
445 AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
447 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
448 AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
449 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
451 [#include <linux/slab.h>],
452 [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
453 ac_cv_linux_kmem_cache_create_takes_dtor=yes,
454 ac_cv_linux_kmem_cache_create_takes_dtor=no)])
455 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
457 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID], [
458 AC_MSG_CHECKING([whether kmem_cache_create constructor function takes a void pointer argument])
459 AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_ctor_takes_void], [
460 save_CPPFLAGS="$CPPFLAGS"
461 CPPFLAGS="$CPPFLAGS -Werror"
463 [#include <linux/slab.h>],
464 [void _ctor(void *v) { };
465 kmem_cache_create(NULL, 0, 0, 0, _ctor);],
466 ac_cv_linux_kmem_cache_create_ctor_takes_void=yes,
467 ac_cv_linux_kmem_cache_create_ctor_takes_void=no)
468 CPPFLAGS="$save_CPPFLAGS"
470 AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_ctor_takes_void)
471 if test "x$ac_cv_linux_kmem_cache_create_ctor_takes_void" = "xyes"; then
472 AC_DEFINE([KMEM_CACHE_CTOR_TAKES_VOID], 1, [define if kmem_cache_create constructor function takes a single void pointer argument])
475 AC_DEFUN([LINUX_HAVE_SVC_ADDR_IN], [
476 AC_MSG_CHECKING([whether svc_addr_in exists])
477 AC_CACHE_VAL([ac_cv_linux_have_svc_addr_in], [
479 [#include <linux/sunrpc/svc.h>],
480 [svc_addr_in(NULL);],
481 ac_cv_linux_have_svc_addr_in=yes,
482 ac_cv_linux_have_svc_addr_in=no)])
483 AC_MSG_RESULT($ac_cv_linux_have_svc_addr_in)])
485 dnl This function checks not just the existence of the splice functions,
486 dnl but also that the signature matches (they gained an extra argument
488 AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
489 AC_CACHE_CHECK([for splice_write and splice_read in struct file_operations],
490 [ac_cv_linux_fs_struct_fop_has_splice], [
492 [#include <linux/fs.h>],
493 [struct file_operations _fop;
494 _fop.splice_write(NULL, NULL, NULL, 0, 0);
495 _fop.splice_read(NULL, NULL, NULL, 0, 0);],
496 ac_cv_linux_fs_struct_fop_has_splice=yes,
497 ac_cv_linux_fs_struct_fop_has_splice=no)])
498 AS_IF([test "x$ac_cv_linux_fs_struct_fop_has_splice" = "xyes"],
499 [AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_SPLICE, 1,
500 [define if struct file_operations has splice functions])])
503 AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
504 AC_MSG_CHECKING([for new kmem_cache init function parameters])
505 AC_CACHE_VAL([ac_cv_linux_kmem_cache_init], [
507 [#include <linux/slab.h>],
508 [extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
510 void (*)(struct kmem_cache *, void *));
512 ac_cv_linux_kmem_cache_init=yes,
513 ac_cv_linux_kmem_cache_init=no)])
514 AC_MSG_RESULT($ac_cv_linux_kmem_cache_init)])
516 AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
517 AC_MSG_CHECKING([for sysctl table checking])
518 AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
520 [#include <linux/sysctl.h>],
521 [ extern int sysctl_check_table(int) __attribute__((weak));
522 sysctl_check_table(NULL);],
523 ac_cv_linux_sysctl_table_checking=no,
524 ac_cv_linux_sysctl_table_checking=yes)])
525 AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
527 AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
528 AC_MSG_CHECKING([if proc_root_fs is defined and exported])
529 AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [
531 [#include <linux/proc_fs.h>],
532 [struct proc_dir_entry *p = proc_root_fs;],
533 ac_cv_linux_exports_proc_root_fs=yes,
534 ac_cv_linux_exports_proc_root_fs=no)])
535 AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs)
536 if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then
537 AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
540 AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
541 AC_MSG_CHECKING([if d_path() takes a struct path argument])
542 AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
544 [#include <linux/dcache.h>],
546 d_path(p, NULL, 0);],
547 ac_cv_linux_d_path_takes_struct_path=yes,
548 ac_cv_linux_d_path_takes_struct_path=no)])
549 AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
550 if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
551 AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
554 AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
555 AC_MSG_CHECKING([if kernel uses new export ops])
556 AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
558 [#include <linux/exportfs.h>],
559 [struct export_operations _eops;
560 _eops.fh_to_parent(NULL, NULL, 0, 0);],
561 ac_cv_linux_new_export_ops=yes,
562 ac_cv_linux_new_export_ops=no)])
563 AC_MSG_RESULT($ac_cv_linux_new_export_ops)
564 if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
565 AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
569 AC_DEFUN([LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT], [
570 AC_MSG_CHECKING([if posix_test_lock returns a struct file_lock])
571 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_returns_conflict], [
573 [#include <linux/fs.h>],
574 [struct file_lock *lock;
576 lock = posix_test_lock(file, lock);],
577 ac_cv_linux_posix_test_lock_returns_conflict=yes,
578 ac_cv_linux_posix_test_lock_returns_conflict=no)])
579 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_returns_conflict)
580 if test "x$ac_cv_linux_posix_test_lock_returns_conflict" = "xyes"; then
581 AC_DEFINE([POSIX_TEST_LOCK_RETURNS_CONFLICT], 1, [define if posix_test_lock returns the conflicting lock])
584 AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
585 AC_MSG_CHECKING([if posix_test_lock takes a conflict argument])
586 AC_CACHE_VAL([ac_cv_linux_posix_test_lock_conflict_arg], [
588 [#include <linux/fs.h>],
589 [ struct file_lock *lock;
591 posix_test_lock(file, lock, lock);],
592 ac_cv_linux_posix_test_lock_conflict_arg=yes,
593 ac_cv_lonuc_posix_test_lock_conflict_arg=no)])
594 AC_MSG_RESULT($ac_cv_linux_posix_test_lock_conflict_arg)
595 if test "x$ac_cv_linux_posix_test_lock_conflict_arg" = "xyes"; then
596 AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
599 AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
600 AC_MSG_CHECKING([for exported key_type_keyring])
601 AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
604 #ifdef HAVE_LINUX_KEY_TYPE_H
605 #include <linux/key-type.h>
607 #include <linux/key.h>],
609 printk("%s", key_type_keyring.name);
611 ac_cv_linux_exports_key_type_keyring=yes,
612 ac_cv_linux_exports_key_type_keyring=no)])
613 AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
614 if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
615 AC_DEFINE([EXPORTED_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
618 AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [
619 AC_MSG_CHECKING([for KEYCTL_SESSION_TO_PARENT])
620 AC_CACHE_VAL([ac_cv_linux_have_session_to_parent], [
622 [ #include <linux/keyctl.h>],
623 [ int i = KEYCTL_SESSION_TO_PARENT;],
624 ac_cv_linux_have_session_to_parent=yes,
625 ac_cv_linux_have_session_to_parent=no)])
626 AC_MSG_RESULT($ac_cv_linux_have_session_to_parent)
627 if test "x$ac_cv_linux_have_session_to_parent" = "xyes"; then
628 AC_DEFINE([HAVE_SESSION_TO_PARENT], 1, [define if keyctl has the KEYCTL_SESSION_TO_PARENT function])
631 AC_DEFUN([LINUX_HAVE_TRY_TO_FREEZE], [
632 AC_MSG_CHECKING([for try_to_freeze])
633 AC_CACHE_CHECK([for try_to_freeze], [ac_cv_linux_have_try_to_freeze],
635 [#include <linux/sched.h>
636 #ifdef HAVE_LINUX_FREEZER_H
637 #include <linux/freezer.h>
639 [#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
640 try_to_freeze(PF_FREEZE);
645 ac_cv_linux_have_try_to_freeze=yes,
646 ac_cv_linux_have_try_to_freeze=no)])
647 AS_IF([test "x$ac_cv_linux_have_try_to_freeze" = "xyes"],
648 [AC_DEFINE([HAVE_TRY_TO_FREEZE], 1,
649 [define if your kernel has the try_to_freeze function])])