@@ -168,12 +168,21 @@ statbuf_native2app(const struct stat *statbuf_native,
168
168
statbuf_app -> st_blksize = (unsigned )statbuf_native -> st_blksize ;
169
169
statbuf_app -> st_blocks = (unsigned )statbuf_native -> st_blocks ;
170
170
statbuf_app -> st_ino = (int64 )statbuf_native -> st_ino ;
171
+ #if defined(__APPLE__ )
172
+ statbuf_app -> st_atim .tv_sec = (int )statbuf_native -> st_atimespec .tv_sec ;
173
+ statbuf_app -> st_atim .tv_nsec = (int )statbuf_native -> st_atimespec .tv_nsec ;
174
+ statbuf_app -> st_mtim .tv_sec = (int )statbuf_native -> st_mtimespec .tv_sec ;
175
+ statbuf_app -> st_mtim .tv_nsec = (int )statbuf_native -> st_mtimespec .tv_nsec ;
176
+ statbuf_app -> st_ctim .tv_sec = (int )statbuf_native -> st_ctimespec .tv_sec ;
177
+ statbuf_app -> st_ctim .tv_nsec = (int )statbuf_native -> st_ctimespec .tv_nsec ;
178
+ #else
171
179
statbuf_app -> st_atim .tv_sec = (int )statbuf_native -> st_atim .tv_sec ;
172
180
statbuf_app -> st_atim .tv_nsec = (int )statbuf_native -> st_atim .tv_nsec ;
173
181
statbuf_app -> st_mtim .tv_sec = (int )statbuf_native -> st_mtim .tv_sec ;
174
182
statbuf_app -> st_mtim .tv_nsec = (int )statbuf_native -> st_mtim .tv_nsec ;
175
183
statbuf_app -> st_ctim .tv_sec = (int )statbuf_native -> st_ctim .tv_sec ;
176
184
statbuf_app -> st_ctim .tv_nsec = (int )statbuf_native -> st_ctim .tv_nsec ;
185
+ #endif
177
186
}
178
187
179
188
static int
@@ -261,7 +270,8 @@ getentropy_wrapper(wasm_exec_env_t exec_env, void *buffer, uint32 length)
261
270
{
262
271
if (buffer == NULL )
263
272
return -1 ;
264
- #if defined(_DEFAULT_SOURCE ) || defined(BH_PLATFORM_LINUX_SGX )
273
+ #if defined(_DEFAULT_SOURCE ) || defined(BH_PLATFORM_LINUX_SGX ) \
274
+ || defined(__APPLE__ )
265
275
return getentropy (buffer , length );
266
276
#else
267
277
return syscall (SYS_getrandom , buffer , length , 0 );
0 commit comments