Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105416
b: refs/heads/master
c: 11fcb6c
h: refs/heads/master
v: v3
  • Loading branch information
Ulrich Drepper authored and Linus Torvalds committed Jul 24, 2008
1 parent 7b35926 commit 20fa25a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b087498eb5605673b0f260a7620d91818cd72304
refs/heads/master: 11fcb6c14676023d0bd437841f5dcd670e7990a0
5 changes: 3 additions & 2 deletions trunk/fs/timerfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
int ufd;
struct timerfd_ctx *ctx;

if (flags)
if (flags & ~TFD_CLOEXEC)
return -EINVAL;
if (clockid != CLOCK_MONOTONIC &&
clockid != CLOCK_REALTIME)
Expand All @@ -198,7 +198,8 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
ctx->clockid = clockid;
hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);

ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, 0);
ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
flags & O_CLOEXEC);
if (ufd < 0)
kfree(ctx);

Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/timerfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
#ifndef _LINUX_TIMERFD_H
#define _LINUX_TIMERFD_H

/* For O_CLOEXEC */
#include <linux/fcntl.h>

/* Flags for timerfd_settime. */
#define TFD_TIMER_ABSTIME (1 << 0)

/* Flags for timerfd_create. */
#define TFD_CLOEXEC O_CLOEXEC


#endif /* _LINUX_TIMERFD_H */
Expand Down

0 comments on commit 20fa25a

Please sign in to comment.