This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Errors from cppcheck
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Brooks Moses <bmoses at google dot com>, <libc-alpha at sourceware dot org>
- Date: Tue, 27 Aug 2013 20:40:21 +0000
- Subject: Re: Errors from cppcheck
- Authentication-results: sourceware.org; auth=none
- References: <20130824094123 dot GA21033 at domone dot kolej dot mff dot cuni dot cz> <521B9D97 dot 7010506 at google dot com> <20130826201429 dot GB8772 at domone dot kolej dot mff dot cuni dot cz>
On Mon, 26 Aug 2013, Ondrej Bilka wrote:
> > Needs evaluation: Relies on __ASSUME_UTIMES not being defined if
> > __NR_utimes is not defined.
> >
> Here we could check if these conditions are neede. Minimal supported
> kernel version is 2.6.16 and there is following comment:
>
> Starting with 2.6.22 the Linux kernel has the utimensat syscall which
> can be used to implement futimes. Earlier kernels have no futimes()
> syscall so we use the /proc filesystem. */
Since this is utimes not utimensat, more relevant is:
/* The utimes syscall has been available for some architectures
forever. For x86 it was introduced after 2.5.75, for x86-64,
ppc, and ppc64 it was introduced in 2.6.0-test3, for s390 it was
introduced in 2.6.21-rc5. */
But even if you increase the minimum kernel version, you have the issue
that hppa at least does not have the utimes syscall at all - it went
straight to utimensat. In the event of increasing the minimum version
sufficiently to assume both syscalls on all architectures that ever got
them, this probably means hppa should start to use
ports/sysdeps/unix/sysv/linux/generic/utimes.c so that
sysdeps/unix/sysv/linux/utimes.c can then assume the utimes syscall is
present (subject to determining status for other architectures).
--
Joseph S. Myers
joseph@codesourcery.com