[OpenAFS-devel] keyring/pag support for linux

Jeffrey Hutzelman jhutz@cmu.edu
Thu, 03 Aug 2006 00:51:39 -0400


On Thursday, August 03, 2006 12:31:24 AM -0400 Jeffrey Hutzelman 
<jhutz@cmu.edu> wrote:

> On Wednesday, August 02, 2006 10:19:39 AM -0400 Derrick J Brashear
> <shadow@dementia.org> wrote:
>
>>> You could also use something like:
>>>
>>> 	# include <asm/unistd.h>
>>>
>>> 	static inline _syscall2(long, keyctl, int, option, void*, arg2)
>>>
>>> 	long serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL);
>>
>> Is keyctl() exported in the kernel now? Otherwise, this won't work for
>> us.
>
> No; you misunderstand.  _syscall2() is a macro which emits the complete
> definition of a 2-argument syscall.  The above expands to something like
>
> static inline long keyctl(int option, void* arg2) {
>   return _syscall(SYS_keyctl, option, arg2);
> }
>
> except the function body is slightly more complicated.
>
> But like Chas, I don't expect that construct to work in the kernel.

Hm; actually, I see David says that will work in the kernel.  I guess I can 
believe that.

-- Jeff