stat-w32.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Core of implementation of fstat and stat for native Windows.
  2. Copyright (C) 2017-2023 Free Software Foundation, Inc.
  3. This file is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as
  5. published by the Free Software Foundation; either version 2.1 of the
  6. License, or (at your option) any later version.
  7. This file is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  13. #ifndef _STAT_W32_H
  14. #define _STAT_W32_H 1
  15. /* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */
  16. #if _GL_WINDOWS_STAT_TIMESPEC
  17. extern struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft);
  18. #else
  19. extern time_t _gl_convert_FILETIME_to_POSIX (const FILETIME *ft);
  20. #endif
  21. /* Fill *BUF with information about the file designated by H.
  22. PATH is the file name, if known, otherwise NULL.
  23. Return 0 if successful, or -1 with errno set upon failure. */
  24. extern int _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf);
  25. /* Bitmasks for st_mode. */
  26. #define S_IREAD_UGO (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6))
  27. #define S_IWRITE_UGO (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
  28. #define S_IEXEC_UGO (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6))
  29. #endif /* _STAT_W32_H */