Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous spec of __wasi_fstflags_t #20

Closed
sunfishcode opened this issue Feb 4, 2021 · 1 comment
Closed

Ambiguous spec of __wasi_fstflags_t #20

sunfishcode opened this issue Feb 4, 2021 · 1 comment

Comments

@sunfishcode
Copy link
Member

As originally reported in bytecodealliance/wasmtime#270:

Possible values:

    __WASI_FILESTAT_SET_ATIM
    Adjust the last data access timestamp to the value stored in __wasi_filestat_t::st_atim.

    __WASI_FILESTAT_SET_ATIM_NOW
    Adjust the last data access timestamp to the time of clock __WASI_CLOCK_REALTIME.

    __WASI_FILESTAT_SET_MTIM
    Adjust the last data modification timestamp to the value stored in __wasi_filestat_t::st_mtim.

    __WASI_FILESTAT_SET_MTIM_NOW
    Adjust the last data modification timestamp to the time of clock __WASI_CLOCK_REALTIME.

It is unclear what the behavior is, when the both flags __WASI_FILESTAT_SET_MTIM and __WASI_FILESTAT_SET_MTIM_NOW are set. Should whichever of them take precedence or should one return EINVAL? This should be clarified in the API docs.

I suggest we return EINVAL, which is the behavior implemented in CraneStation/wasi-common#54

@sunfishcode
Copy link
Member Author

This API has since been redesigned; set-times now uses new-timestamp to indicate no-change, now, or a specific timestamp value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant