[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0710021239580.17814@alien.or.mcafeemobile.com>
Date: Tue, 2 Oct 2007 12:52:42 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Denys Vlasenko <vda.linux@...glemail.com>
cc: Al Viro <viro@....linux.org.uk>,
Ulrich Drepper <drepper@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: F_DUPFD_CLOEXEC implementation
On Tue, 2 Oct 2007, Denys Vlasenko wrote:
> I have following proposals:
>
> * make recv(..., MSG_DONTWAIT) work on any fd
>
> Sounds neat, but not trivial to implement in current kernel.
This is mildly ugly, if you ask me. Those are socket functions, and the
flags parameter contain some pretty specific network meanings.
> * new fcntl command F_DUPFL: fcntl(fd, F_DUPFL, n):
> Analogous to F_DUPFD, but gives you *unshared* copy of the fd.
> Further seeks, fcntl(fd, F_SETFL, O_NONBLOCK), etc won't affect
> any other process.
You'll need an ad-hoc copy function though, since your memcpy-based one is
gonna explode even before memcpy returns ;) You'll have problems with
ref-counting too. And that layer is not designed to cleanly support that
operation.
Unfortunately the "clean" solution would involve changing a whole bunch of
code, and I don't feel exactly sure it'd be worth it.
- Davide
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists