From: David Howells The attached patch moves the syscall declarations from linux/key.h into linux/syscalls.h. Also declare struct user_struct in advance as that might not have been declared yet at the point of inclusion. Signed-Off-By: David Howells Signed-off-by: Andrew Morton --- 25-akpm/include/linux/key.h | 26 ++++++-------------------- 25-akpm/include/linux/syscalls.h | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) diff -puN include/linux/key.h~move-syscall-declarations-from-linux-keyh-2 include/linux/key.h --- 25/include/linux/key.h~move-syscall-declarations-from-linux-keyh-2 2004-09-30 22:36:20.507753952 -0700 +++ 25-akpm/include/linux/key.h 2004-09-30 22:36:20.512753192 -0700 @@ -22,15 +22,17 @@ #include #ifdef __KERNEL__ -#ifdef CONFIG_KEYS - -#undef KEY_DEBUGGING /* key handle serial number */ typedef int32_t key_serial_t; /* key handle permissions mask */ typedef uint32_t key_perm_t; + +#ifdef CONFIG_KEYS + +#undef KEY_DEBUGGING + #define KEY_USR_VIEW 0x00010000 /* user can view a key's attributes */ #define KEY_USR_READ 0x00020000 /* user can read key payload / view keyring */ #define KEY_USR_WRITE 0x00040000 /* user can update key payload / add link to keyring */ @@ -53,6 +55,7 @@ typedef uint32_t key_perm_t; #define KEY_OTH_ALL 0x0000001f struct seq_file; +struct user_struct; struct key; struct key_type; @@ -251,20 +254,6 @@ extern int exec_keys(struct task_struct extern void key_fsuid_changed(struct task_struct *tsk); extern void key_fsgid_changed(struct task_struct *tsk); -asmlinkage long sys_add_key(const char __user *_type, - const char __user *_description, - const void __user *_payload, - size_t plen, - key_serial_t destringid); - -asmlinkage long sys_request_key(const char __user *_type, - const char __user *_description, - const char __user *_callout_info, - key_serial_t destringid); - -asmlinkage long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3, - unsigned long arg4, unsigned long arg5); - #else /* CONFIG_KEYS */ #define key_put(k) do { } while(0) @@ -276,9 +265,6 @@ asmlinkage long sys_keyctl(int cmd, unsi #define exec_keys(t) do { } while(0) #define key_fsuid_changed(t) do { } while(0) #define key_fsgid_changed(t) do { } while(0) -#define sys_addkey(a,b,c,d,e) (-ENOSYS) -#define sys_request_key(a,b,c,d,e) (-ENOSYS) -#define sys_keyctl(a,b,c,d,e) (-ENOSYS) #endif /* CONFIG_KEYS */ #endif /* __KERNEL__ */ diff -puN include/linux/syscalls.h~move-syscall-declarations-from-linux-keyh-2 include/linux/syscalls.h --- 25/include/linux/syscalls.h~move-syscall-declarations-from-linux-keyh-2 2004-09-30 22:36:20.508753800 -0700 +++ 25-akpm/include/linux/syscalls.h 2004-09-30 22:36:20.513753040 -0700 @@ -61,6 +61,7 @@ struct mq_attr; #include #include #include +#include asmlinkage long sys_time(int __user *tloc); asmlinkage long sys_stime(time_t __user *tptr); @@ -491,4 +492,18 @@ asmlinkage long sys_syslog(int type, cha asmlinkage long sys_uselib(const char __user *library); asmlinkage long sys_ni_syscall(void); +asmlinkage long sys_add_key(const char __user *_type, + const char __user *_description, + const void __user *_payload, + size_t plen, + key_serial_t destringid); + +asmlinkage long sys_request_key(const char __user *_type, + const char __user *_description, + const char __user *_callout_info, + key_serial_t destringid); + +asmlinkage long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5); + #endif _