Skip to content
  • LRN's avatar
    W32: drop _wstat64(), get stat data manually · d3d6ef60
    LRN authored
    It turns out that UCRT (which is the C runtime that Visual Studio
    uses by default these days) quietly changed the semantics for
    stat() functions and its variants. Previously they provided data
    for the symlink (if the file queried was a symlink), now they
    provide data for the target of the symlink.
    
    glib used to call _wstat64() to get certain stat-ish data about
    files, such as st_dev, since it was deemed that computing that
    data in glib using custom code would be pointless, as _wstat64()
    worked just fine.
    
    With UCRT this is no longer true. This commit drops _wstat64() in
    favour of a bunch of custom calls that populate the stat buffer
    manually. This way glib correctly gets information about a symlink,
    not its target.
    
    The _fstat64() call is still being used, as it does not suffer
    from this problem and thus remains untouched.
    d3d6ef60