File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
184
184
int ufd ;
185
185
struct timerfd_ctx * ctx ;
186
186
187
- if (flags & ~TFD_CLOEXEC )
187
+ if (flags & ~( TFD_CLOEXEC | TFD_NONBLOCK ) )
188
188
return - EINVAL ;
189
189
if (clockid != CLOCK_MONOTONIC &&
190
190
clockid != CLOCK_REALTIME )
@@ -199,7 +199,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
199
199
hrtimer_init (& ctx -> tmr , clockid , HRTIMER_MODE_ABS );
200
200
201
201
ufd = anon_inode_getfd ("[timerfd]" , & timerfd_fops , ctx ,
202
- flags & O_CLOEXEC );
202
+ flags & ( O_CLOEXEC | O_NONBLOCK ) );
203
203
if (ufd < 0 )
204
204
kfree (ctx );
205
205
Original file line number Diff line number Diff line change 8
8
#ifndef _LINUX_TIMERFD_H
9
9
#define _LINUX_TIMERFD_H
10
10
11
- /* For O_CLOEXEC */
11
+ /* For O_CLOEXEC and O_NONBLOCK */
12
12
#include <linux/fcntl.h>
13
13
14
14
/* Flags for timerfd_settime. */
15
15
#define TFD_TIMER_ABSTIME (1 << 0)
16
16
17
17
/* Flags for timerfd_create. */
18
18
#define TFD_CLOEXEC O_CLOEXEC
19
+ #define TFD_NONBLOCK O_NONBLOCK
19
20
20
21
21
22
#endif /* _LINUX_TIMERFD_H */
You can’t perform that action at this time.
0 commit comments