Re: [PATCH 0/3] *at syscalls: Intro

From: Linus Torvalds
Date: Fri Dec 16 2005 - 12:51:02 EST




On Thu, 15 Dec 2005, Nicholas Miell wrote:
>
> Don't take this as an objection to implementation of the *at() syscalls
> in Linux, though; rather, look at is as a request for the addition of
> int pthread_attr_setfssharing_np(pthread_attr_t *attr, int share) and
> int pthread_attr_getfssharing_np(pthread_attr_t *attr) to glibc.

I don't think separate fs/files makes sense with pthreads.

Why? Signals.

Signals are shared in a pthread environment, so signal handlers can happen
in any thread. If you don't share the filesystem thing, your signal
handlers had better not do any file operations. You'd better not try to
use the old "send a byte down a pipe" trick to wake somebody else up,
because the thread you may take the signal in may not _have_ that pipe fd
open.

Now, opening files in a signal handler may be unusual enough that
having separate cwd/root (!CLONE_FS as opposed to !CLONE_FILES) might be
more commonly usable, but it's still potentially asking for some really
funky behaviour.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/