File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2128,3 +2128,14 @@ void mingw_startup()
2128
2128
/* initialize Unicode console */
2129
2129
winansi_init ();
2130
2130
}
2131
+
2132
+ int uname (struct utsname * buf )
2133
+ {
2134
+ DWORD v = GetVersion ();
2135
+ memset (buf , 0 , sizeof (* buf ));
2136
+ strcpy (buf -> sysname , "Windows" );
2137
+ sprintf (buf -> release , "%u.%u" , v & 0xff , (v >> 8 ) & 0xff );
2138
+ /* assuming NT variants only.. */
2139
+ sprintf (buf -> version , "%u" , (v >> 16 ) & 0x7fff );
2140
+ return 0 ;
2141
+ }
Original file line number Diff line number Diff line change @@ -76,6 +76,14 @@ struct itimerval {
76
76
};
77
77
#define ITIMER_REAL 0
78
78
79
+ struct utsname {
80
+ char sysname [16 ];
81
+ char nodename [1 ];
82
+ char release [16 ];
83
+ char version [16 ];
84
+ char machine [1 ];
85
+ };
86
+
79
87
/*
80
88
* sanitize preprocessor namespace polluted by Windows headers defining
81
89
* macros which collide with git local versions
@@ -171,6 +179,7 @@ struct passwd *getpwuid(uid_t uid);
171
179
int setitimer (int type , struct itimerval * in , struct itimerval * out );
172
180
int sigaction (int sig , struct sigaction * in , struct sigaction * out );
173
181
int link (const char * oldpath , const char * newpath );
182
+ int uname (struct utsname * buf );
174
183
175
184
/*
176
185
* replacements of existing functions
You can’t perform that action at this time.
0 commit comments