Bug#202243: glibc utimes glitch with coreutils 'touch' (original) (raw)
- To: Paul Eggert <eggert@CS.UCLA.EDU>
- Cc: bug-gnulib@gnu.org, bug-coreutils@gnu.org, libc-alpha@sources.redhat.com, 202243@bugs.debian.org
- Subject: Bug#202243: glibc utimes glitch with coreutils 'touch'
- From: Jim Meyering <jim@meyering.net>
- Date: Sun, 10 Aug 2003 10:19:16 +0200
- Message-id: <[🔎] 858yq1udq3.fsf@pi.meyering.net>
- Reply-to: Jim Meyering <jim@meyering.net>, 202243@bugs.debian.org
- In-reply-to: <[🔎] 873cgaqa8v.fsf@penguin.cs.ucla.edu> (Paul Eggert's message of "09 Aug 2003 23:48:00 -0700")
- References: 85isp6v9tj.fsf@pi.meyering.net <[🔎] 873cgaqa8v.fsf@penguin.cs.ucla.edu>
Paul Eggert eggert@CS.UCLA.EDU wrote:
I'll submit an alternate patch to coreutils so that it works around this glibc glitch. The simplest workaround is to not invoke utimes when building with glibc; perhaps I can improve on that, but I don't know.
We don't have to condemn the coreutils always to use the inferior utime interface on glibc systems. Instead, I'm adding a configure-time test of utimes, so that if it works, coreutils will use it.
Here's the C program it'll compile and run. So far it compiles and exits successfully on all systems listed except for the one with Debian libc6 version 2.3.2-1.
/* tested with gcc on the following: AIX 4.3 (both gcc and cc) openbsd 3.2 solaris 9 netbsd 1.6 OSF1 V4.0 (both gcc and cc) linux 2.4.20, 2.4.21 */ #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <utime.h>
int main () { static struct timeval timeval[2] = {{9, 10}, {11, 12}}; struct stat sbuf; char const *file = "x"; FILE *f;
exit ( ! ((f = fopen (file, "w")) && fclose (f) == 0 && utimes (file, timeval) == 0 && lstat (file, &sbuf) == 0 && sbuf.st_atime == timeval[0].tv_sec && sbuf.st_mtime == timeval[1].tv_sec) ); }
Reply to:
- Follow-Ups:
- Bug#202243: glibc utimes glitch with coreutils 'touch'
* From: Dan Kegel dank@kegel.com - Bug#202243: glibc utimes glitch with coreutils 'touch'
* From: GOTO Masanori gotom@debian.or.jp
- Bug#202243: glibc utimes glitch with coreutils 'touch'
- References:
- Bug#202243: glibc utimes glitch with coreutils 'touch'
* From: Paul Eggert eggert@CS.UCLA.EDU
- Bug#202243: glibc utimes glitch with coreutils 'touch'
- Prev by Date:Bug#204706: libc6: Binary incompatibility
- Next by Date:Bug#204805: libc6.1-dev: new libc breaks intel C/C++ compiler
- Previous by thread:Bug#202243: glibc utimes glitch with coreutils 'touch'
- Next by thread:Bug#202243: glibc utimes glitch with coreutils 'touch'
- Index(es):