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]

Re: atime preservation


> A long time ago, someone added O_NOATIME in the glibc documentation: an
> option to open that would avoid changing the atime on read(). 

That's because GNU/Hurd has implemented it for a long time.

> 1) There's no way to tell if the kernel supports O_NOATIME or not [...]

This is a Linux kernel issue.  I agree it would be best if Linux would
fail with EINVAL when given flags it cannot implement.

> 1) open() may return EINVAL if it is passed O_NOATIME and the file does not 
> support that flag.

Amending the manual to mention that giving invalid flags may yield EINVAL
would be fine.

> 2) new system calls readlinkopt() and opendiropt(), which work like readlink() 
> and opendir() but take an extra flag argument, the only flag (at present)
> being O_NOATIME. They set EINVAL if the file is not a symbolic link (for
> readlinkopt()) or does not support a passed flag.

opendir is not a system call.  readlink is.  For readlink to behave
differently, you need kernel support that behaves differently.  This is not
the place to request that.  opendir could behave differently by passing
different flags to open.  It is probably more useful to have an opendirfd
or suchlike that takes a file descriptor you've opened however you like.
Does using opendir on /dev/fd/NN give you the behavior you want?


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