File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 22
22
#include <time.h>
23
23
#include <sys/utsname.h>
24
24
#include <emscripten/console.h>
25
+ #include <emscripten/version.h>
25
26
26
27
static int g_pid = 42 ;
27
28
static int g_pgid = 42 ;
@@ -42,15 +43,22 @@ static mode_t g_umask = S_IRWXU | S_IRWXG | S_IRWXO;
42
43
return -ENOSYS; \
43
44
}
44
45
46
+ #define STRINGIFY (s ) #s
47
+ #define STR (s ) STRINGIFY(s)
48
+
45
49
int __syscall_uname (intptr_t buf ) {
46
50
if (!buf ) {
47
51
return - EFAULT ;
48
52
}
53
+ const char * full_version = STR (__EMSCRIPTEN_major__ ) "." \
54
+ STR (__EMSCRIPTEN_minor__ ) "." \
55
+ STR (__EMSCRIPTEN_tiny__ );
56
+
49
57
struct utsname * utsname = (struct utsname * )buf ;
50
58
51
59
strcpy (utsname -> sysname , "Emscripten" );
52
60
strcpy (utsname -> nodename , "emscripten" );
53
- strcpy (utsname -> release , "1.0" );
61
+ strcpy (utsname -> release , full_version );
54
62
strcpy (utsname -> version , "#1" );
55
63
#ifdef __wams64__
56
64
strcpy (utsname -> machine , "wasm64" );
Original file line number Diff line number Diff line change 1
1
ret: 0
2
2
sysname: Emscripten
3
3
nodename: emscripten
4
- release: 1.0
4
+ release: \d+.\d+.\d+
5
5
version: #1
6
6
machine: wasm32
Original file line number Diff line number Diff line change @@ -6062,7 +6062,7 @@ def test_posixtime(self):
6062
6062
self .do_core_test ('test_posixtime.c' )
6063
6063
6064
6064
def test_uname (self ):
6065
- self .do_core_test ('test_uname.c' )
6065
+ self .do_core_test ('test_uname.c' , regex = True )
6066
6066
6067
6067
def test_unary_literal (self ):
6068
6068
self .do_core_test ('test_unary_literal.cpp' )
You can’t perform that action at this time.
0 commit comments