This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: atime preservation
- From: Ian Turner <ian at zmanda dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 27 Sep 2005 16:28:45 -0700
- Subject: Re: atime preservation
- References: <20050927231021.F2FB1180E20@magilla.sf.frob.com>
> This is a Linux kernel issue. I agree it would be best if Linux would
> fail with EINVAL when given flags it cannot implement.
Right. I just wanted to discuss including this possibility in the glibc
documentation.
> > 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?
readlink() would have to be a new system call, but I figure the libc folks
have as much to say as the kernel folks about the form that system call
should take.
opendirfd() would be fine. The Linux documentation says not to use O_DIRECTORY
outside of an implementation of opendir(), but that could be changed.
In Linux, O_NOATIME is a fd-specific flag, and opening from /proc/self/fd/
generates a new fd, not just a new name for the old one.