Messages in this thread | | | Date | Thu, 24 Apr 2008 17:03:25 +0100 | From | Alan Cox <> | 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
| |