This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] linux: use F_GETFL to validate futimes fd


Use fcntl(F_GETFL) to validate the file descriptor in the futimes()
fallback path.

Before this commit, glibc used fctnl(F_GETFD) to check for EBADF but
F_GETFD has to acquire a RCU read lock and do a fdtable lookup;
F_GETFL just reads the f_flags field of the struct file.

I haven't signed the copyright assignment but I'm happy to renounce all
rights and put it in the public domain it that makes things easier.

Signed-off-by: Ben Noordhuis <info@bnoordhuis.nl>

ChangeLog                         |    5 +++++
sysdeps/unix/sysv/linux/futimes.c |    2 +-
2 files changed, 6 insertions(+), 1 deletion(-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]