lkml.org 
[lkml]   [2008]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-04-24 18:35    [W:0.034 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site