]> asedeno.scripts.mit.edu Git - git.git/blob - compat/mingw.c
Add target architecture MinGW.
[git.git] / compat / mingw.c
1 #include "../git-compat-util.h"
2
3 unsigned int _CRT_fmode = _O_BINARY;
4
5 unsigned int sleep (unsigned int seconds)
6 {
7         Sleep(seconds*1000);
8         return 0;
9 }
10
11 int mkstemp(char *template)
12 {
13         char *filename = mktemp(template);
14         if (filename == NULL)
15                 return -1;
16         return open(filename, O_RDWR | O_CREAT, 0600);
17 }
18
19 int gettimeofday(struct timeval *tv, void *tz)
20 {
21         return -1;
22 }
23
24 int poll(struct pollfd *ufds, unsigned int nfds, int timeout)
25 {
26         return -1;
27 }
28
29 struct tm *gmtime_r(const time_t *timep, struct tm *result)
30 {
31         /* gmtime() in MSVCRT.DLL is thread-safe, but not reentrant */
32         memcpy(result, gmtime(timep), sizeof(struct tm));
33         return result;
34 }
35
36 struct tm *localtime_r(const time_t *timep, struct tm *result)
37 {
38         /* localtime() in MSVCRT.DLL is thread-safe, but not reentrant */
39         memcpy(result, localtime(timep), sizeof(struct tm));
40         return result;
41 }
42
43 struct passwd *getpwuid(int uid)
44 {
45         static struct passwd p;
46         return &p;
47 }
48
49 int setitimer(int type, struct itimerval *in, struct itimerval *out)
50 {
51         return -1;
52 }
53
54 int sigaction(int sig, struct sigaction *in, struct sigaction *out)
55 {
56         return -1;
57 }