syscall: add Timespec.Unix() for wasi.

This allows archive/tar to build (but not yet pass).
Этот коммит содержится в:
Damian Gryski 2023-03-03 10:15:01 -08:00 коммит произвёл Damian Gryski
родитель 4716298044
коммит cf4a6d3253

Просмотреть файл

@ -210,6 +210,11 @@ type Timespec struct {
Nsec int64
}
// Unix returns the time stored in ts as seconds plus nanoseconds.
func (ts *Timespec) Unix() (sec int64, nsec int64) {
return int64(ts.Sec), int64(ts.Nsec)
}
// https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/headers/public/__struct_stat.h
// https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/headers/public/__typedef_ino_t.h
// etc.