[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080424170325.569afa43@the-village.bc.nu>
Date: Thu, 24 Apr 2008 17:03:25 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Ulrich Drepper <drepper@...hat.com>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org
Subject: Re: [PATCH] alternative^2 to sys_indirect: socket, socketpair
Comments all come down to implementation details and it basically looks
sound and fairly small clean change (especially when the various wrappers
and _flags changes were replaced by just fixing up the callers to
functions in a final implementation.
Add a new accept() and it looks good to me
> - fd = get_unused_fd();
> + fd = get_unused_fd_flags(flags);
Better to fix up the existing users who don't pass flags (and check why
they need not to), Implementation detail
> -int sock_map_fd(struct socket *sock)
> +static int sock_map_fd_flags(struct socket *sock, int flags)
No need to rename these, the compiler errors will let us quickly
find/fix any users.
> +int sock_map_fd(struct socket *sock)
> +{
> + return sock_map_fd_flags(sock, 0);
> +}
Ditto
> + /* Extract the close-on-exec flag. */
> + if ((type & SOCK_CLOEXEC) != 0) {
> + fflags = O_CLOEXEC;
> + type &= ~SOCK_CLOEXEC;
> + /* Extract the close-on-exec flag. */
> + if ((type & SOCK_CLOEXEC) != 0) {
> + fflags = O_CLOEXEC;
> + type &= ~SOCK_CLOEXEC;
> + }
Should probably be done once in one place in case we ever add future flags
--
--
"Alan, I'm getting a bit worried about you."
-- Linus Torvalds
--
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