Re: [PATCH] Add a fast version of fstat to cygwin port

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

 



2009/3/19 Johannes Sixt <j.sixt@xxxxxxxxxxxxx>:
> Alex Riesen schrieb:
>> BTW, why do we have to #undef fstat, but not stat/lstat?
>
> Because stat and lstat are #defined with an argument list, but in those
> instances where the cygwin version of stat/lstat is meant, they are used
> *without* argument list (see cygwin_stat/lstat_stub), and no macro
> expansion happens, and therefore we don't need to #undef the macro.
>
> OTOH, do_fstat calls into cygwin's fstat() if the file handle is not a
> file and uses an argument list that would cause a macro expansion if it
> were not #undef'd:
>
...
>> +     /* direct non-file handles to cygwin's fstat() */
>> +     if (GetFileType(fh) != FILE_TYPE_DISK)
>> +             return fstat(fd, buf);
>
> We never do that for stat/lstat.

I see. Not immediately obvious :)
Thanks!
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux