[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] interix timestamp issues

From: Markus Duft
Subject: Re: [Bug-tar] interix timestamp issues
Date: Fri, 13 May 2011 08:15:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110506 Lightning/1.0b3pre Thunderbird/3.1.10

On 05/12/11 18:10, Paul Eggert wrote:
> On 05/12/11 01:38, Markus Duft wrote:
>> this doesn't help, and doesn't even compile, as interix also doesn't have 
>> sync()
> OK, how about this patch to utimens.c instead?

tested, but doesn't help either. the problem is, that fdutimensat calls 
utimensat on interix in any case, as futimes always fails (as required 
functions are missing). utimensat gets passed the 'dir' instead of the 'fd' in 
fdutimensat, anf this is the reason for fd always being -1 in utimens, and thus 
i'm not able to sync the file in there without a "sync-all-files" call, which 
is (again) missing... i'm really forced to do the sync on every open fd.

also, maybe you misunderstood something (i think so based on your comment in 
the patch about NFS): we're not talking about NFS, really here - this is the 
"normal" filesystem, whatever it may be under the hoods (NTFS, any FAT 
incarnation, even ext2 with the windows driver). it's just interix itself that 
is so "incomplete" (not even broken, the existing calls do what i'd expect, but 
to do what we want, the calls are missing ... :))

while writing this, i just started thinking whether i could introduce another 
"improvement" to libsuacomp, which already handles a lot of I/O related stuff 
for me. for example i'm wrapping all read/write/close calls from libc. and (for 
different reasons), i'm memorizing whenever an fd gets write-dirty, so i could 
easily implement a sync() that flushes all open fd's that have been written.

maybe i could even implement a futimes by memorizing the timestamps and 
re-setting them after closing the file...

would that be better than hacking around in gnulib? libsuacomp is required 
anyway to get a more sane system. otherwise interix suffers from some quite 
annoying diseases like throwing around EAGAIN's all the time.

Regards, Markus

> diff --git a/lib/utimens.c b/lib/utimens.c
> index c190411..f738c68 100644
> --- a/lib/utimens.c
> +++ b/lib/utimens.c
> @@ -58,6 +58,13 @@ struct utimbuf
>  #endif
> +/* Interix's NFS implementation seems particularly bug-prone; see
> +   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00293.html>.  */
> +#if __INTERIX
> +static void sync (void) {}
> +#endif
> +
>  /* Cache variables for whether the utimensat syscall works; used to
>     avoid calling the syscall if we know it will just fail with ENOSYS,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]