Re: [PATCH 15/18] flag parameters: NONBLOCK in timerfd_create

Davide Libenzi
2008-05-06T22:45:39Z

On Tue, 6 May 2008, Ulrich Drepper wrote:

> diff --git a/fs/timerfd.c b/fs/timerfd.c
> index c6ef5e3..75d44ef 100644
> --- a/fs/timerfd.c
> +++ b/fs/timerfd.c
> @@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
> int ufd;
> struct timerfd_ctx *ctx;
>
> - if (flags & ~TFD_CLOEXEC)
> + if (flags & ~(TFD_CLOEXEC | TFD_NONBLOCK))
> return -EINVAL;
> if (clockid != CLOCK_MONOTONIC &&
> clockid != CLOCK_REALTIME)
> @@ -199,7 +199,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
> hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
>
> ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
> - flags & O_CLOEXEC);
> + flags & (O_CLOEXEC | O_NONBLOCK));
> if (ufd < 0)
> kfree(ctx);

This is perfectly fine for me. Since the flags space for these new
syscalls is almost empty, it makes perfect sense to just map them to the
original O_* flags.

Acked-by: Davide Libenzi <davidel@xmailserver.org>

(for the whole serie)

- Davide