Home | History | Annotate | Line # | Download | only in cpio
      1 /*-
      2  * SPDX-License-Identifier: BSD-2-Clause
      3  *
      4  * Copyright (c) 2009 Michihiro NAKAJIMA
      5  * All rights reserved.
      6  */
      7 #ifndef CPIO_WINDOWS_H
      8 #define CPIO_WINDOWS_H 1
      9 #include <windows.h>
     10 
     11 #include <io.h>
     12 #include <string.h>
     13 
     14 #define getgrgid(id)	NULL
     15 #define getgrnam(name)	NULL
     16 #define getpwnam(name)	NULL
     17 #define getpwuid(id)	NULL
     18 
     19 #if defined(_MSC_VER)
     20  #if _MSC_VER < 1900
     21  #define snprintf	sprintf_s
     22  #endif // _MSC_VER < 1900
     23 #define strdup		_strdup
     24 #define open	_open
     25 #define read	_read
     26 #define close	_close
     27 #endif
     28 
     29 struct passwd {
     30 	char	*pw_name;
     31 	uid_t	 pw_uid;
     32 	gid_t	 pw_gid;
     33 };
     34 
     35 struct group {
     36 	char	*gr_name;
     37 	gid_t	 gr_gid;
     38 };
     39 
     40 struct _timeval64i32 {
     41 	time_t		tv_sec;
     42 	long		tv_usec;
     43 };
     44 #define __timeval _timeval64i32
     45 
     46 extern int futimes(int fd, const struct __timeval *times);
     47 #ifndef HAVE_FUTIMES
     48 #define HAVE_FUTIMES 1
     49 #endif
     50 extern int utimes(const char *name, const struct __timeval *times);
     51 #ifndef HAVE_UTIMES
     52 #define HAVE_UTIMES 1
     53 #endif
     54 
     55 #endif /* !CPIO_WINDOWS_H */
     56