LWN.net Logo

Re: [patch 7/8] fdmap v2 - implement sys_socket2

From:  Linus Torvalds <torvalds-AT-linux-foundation.org>
To:  Matt Mackall <mpm-AT-selenic.com>
Subject:  Re: [patch 7/8] fdmap v2 - implement sys_socket2
Date:  Thu, 7 Jun 2007 19:25:03 -0700 (PDT)
Cc:  Alan Cox <alan-AT-lxorguk.ukuu.org.uk>, Davide Libenzi <davidel-AT-xmailserver.org>, Linux Kernel Mailing List <linux-kernel-AT-vger.kernel.org>, Andrew Morton <akpm-AT-linux-foundation.org>, Ulrich Drepper <drepper-AT-redhat.com>, Ingo Molnar <mingo-AT-elte.hu>, Eric Dumazet <dada1-AT-cosmosbay.com>
Archive-link:  Article, Thread



On Thu, 7 Jun 2007, Matt Mackall wrote:
> 
> First, how does this work in-kernel? Does it set a flag in the thread
> struct that magically gets used in the actual syscall? Or do we pass
> flags down to the sys_foo() function in some manner?

Set a flag in the thread-struct.

In fact, that's how "access()" already works.

And yes, syslets would need to have their own thread-structs and/or 
save/restore the thing.

> Second, I think we're likely to run out of flag bits really quickly as
> this is a good dumping spot for patching up our many slightly
> brain-damaged APIs (be they POSIX or Linux-specific).

Well, I do suspect that we'd need to basically make the flags be 
per-system call. With "common features" (ie a system call that doesn't 
return a file descriptor would re-use the bit for "nonlinear-fd" for 
something else, while a system call that doesn't do path lookup would use 
all the LOOKUP_xyzzy bits for something else).

I agree that if we kept flags _totally_ separate, we'd run out of them 
really quickly. But I don't think we want to ever be in the situation 
where _one_ set of system calls would need that many flags. If we get 
there, we'd really be much better off with a new system call!

> Third, can I do sys_indirect(sys_indirect(foo, args), flags1), flags2)?

I'd say no.

> Fourth, can we do sys_indirect(foo, args, flags | ASYNC) and get most
> of the way to merging this with the syslet proposal?

I think that may well be a really good idea.

		Linus


(Log in to post comments)

Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds