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()
21282128 /* initialize Unicode console */
21292129 winansi_init ();
21302130}
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 {
7676};
7777#define ITIMER_REAL 0
7878
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+
7987/*
8088 * sanitize preprocessor namespace polluted by Windows headers defining
8189 * macros which collide with git local versions
@@ -171,6 +179,7 @@ struct passwd *getpwuid(uid_t uid);
171179int setitimer (int type , struct itimerval * in , struct itimerval * out );
172180int sigaction (int sig , struct sigaction * in , struct sigaction * out );
173181int link (const char * oldpath , const char * newpath );
182+ int uname (struct utsname * buf );
174183
175184/*
176185 * replacements of existing functions
You can’t perform that action at this time.
0 commit comments