@@ -1282,18 +1282,20 @@ wasmtime_ssp_fd_fdstat_get(wasm_exec_env_t exec_env, struct fd_table *curfds,
1282
1282
1283
1283
if ((ret & O_APPEND ) != 0 )
1284
1284
buf -> fs_flags |= __WASI_FDFLAG_APPEND ;
1285
- #ifdef O_DSYNC
1285
+ #ifdef CONFIG_HAS_O_DSYNC
1286
1286
if ((ret & O_DSYNC ) != 0 )
1287
1287
buf -> fs_flags |= __WASI_FDFLAG_DSYNC ;
1288
1288
#endif
1289
1289
if ((ret & O_NONBLOCK ) != 0 )
1290
1290
buf -> fs_flags |= __WASI_FDFLAG_NONBLOCK ;
1291
- #ifdef O_RSYNC
1291
+ #ifdef CONFIG_HAS_O_RSYNC
1292
1292
if ((ret & O_RSYNC ) != 0 )
1293
1293
buf -> fs_flags |= __WASI_FDFLAG_RSYNC ;
1294
1294
#endif
1295
+ #ifdef CONFIG_HAS_O_SYNC
1295
1296
if ((ret & O_SYNC ) != 0 )
1296
1297
buf -> fs_flags |= __WASI_FDFLAG_SYNC ;
1298
+ #endif
1297
1299
return 0 ;
1298
1300
}
1299
1301
@@ -1306,21 +1308,25 @@ wasmtime_ssp_fd_fdstat_set_flags(wasm_exec_env_t exec_env,
1306
1308
if ((fs_flags & __WASI_FDFLAG_APPEND ) != 0 )
1307
1309
noflags |= O_APPEND ;
1308
1310
if ((fs_flags & __WASI_FDFLAG_DSYNC ) != 0 )
1309
- #ifdef O_DSYNC
1311
+ #ifdef CONFIG_HAS_O_DSYNC
1310
1312
noflags |= O_DSYNC ;
1311
1313
#else
1312
- noflags |= O_SYNC ;
1314
+ return __WASI_ENOTSUP ;
1313
1315
#endif
1314
1316
if ((fs_flags & __WASI_FDFLAG_NONBLOCK ) != 0 )
1315
1317
noflags |= O_NONBLOCK ;
1316
1318
if ((fs_flags & __WASI_FDFLAG_RSYNC ) != 0 )
1317
- #ifdef O_RSYNC
1319
+ #ifdef CONFIG_HAS_O_RSYNC
1318
1320
noflags |= O_RSYNC ;
1319
1321
#else
1320
- noflags |= O_SYNC ;
1322
+ return __WASI_ENOTSUP ;
1321
1323
#endif
1322
1324
if ((fs_flags & __WASI_FDFLAG_SYNC ) != 0 )
1325
+ #ifdef CONFIG_HAS_O_SYNC
1323
1326
noflags |= O_SYNC ;
1327
+ #else
1328
+ return __WASI_ENOTSUP ;
1329
+ #endif
1324
1330
1325
1331
struct fd_object * fo ;
1326
1332
__wasi_errno_t error =
@@ -1971,26 +1977,30 @@ wasmtime_ssp_path_open(wasm_exec_env_t exec_env, struct fd_table *curfds,
1971
1977
if ((fs_flags & __WASI_FDFLAG_APPEND ) != 0 )
1972
1978
noflags |= O_APPEND ;
1973
1979
if ((fs_flags & __WASI_FDFLAG_DSYNC ) != 0 ) {
1974
- #ifdef O_DSYNC
1980
+ #ifdef CONFIG_HAS_O_DSYNC
1975
1981
noflags |= O_DSYNC ;
1982
+ needed_inheriting |= __WASI_RIGHT_FD_DATASYNC ;
1976
1983
#else
1977
- noflags |= O_SYNC ;
1984
+ return __WASI_ENOTSUP ;
1978
1985
#endif
1979
- needed_inheriting |= __WASI_RIGHT_FD_DATASYNC ;
1980
1986
}
1981
1987
if ((fs_flags & __WASI_FDFLAG_NONBLOCK ) != 0 )
1982
1988
noflags |= O_NONBLOCK ;
1983
1989
if ((fs_flags & __WASI_FDFLAG_RSYNC ) != 0 ) {
1984
- #ifdef O_RSYNC
1990
+ #ifdef CONFIG_HAS_O_RSYNC
1985
1991
noflags |= O_RSYNC ;
1992
+ needed_inheriting |= __WASI_RIGHT_FD_SYNC ;
1986
1993
#else
1987
- noflags |= O_SYNC ;
1994
+ return __WASI_ENOTSUP ;
1988
1995
#endif
1989
- needed_inheriting |= __WASI_RIGHT_FD_SYNC ;
1990
1996
}
1991
1997
if ((fs_flags & __WASI_FDFLAG_SYNC ) != 0 ) {
1998
+ #ifdef CONFIG_HAS_O_SYNC
1992
1999
noflags |= O_SYNC ;
1993
2000
needed_inheriting |= __WASI_RIGHT_FD_SYNC ;
2001
+ #else
2002
+ return __WASI_ENOTSUP ;
2003
+ #endif
1994
2004
}
1995
2005
if (write && (noflags & (O_APPEND | O_TRUNC )) == 0 )
1996
2006
needed_inheriting |= __WASI_RIGHT_FD_SEEK ;
0 commit comments