| 1 |
package sysfs |
| 2 |
|
| 3 |
import ( |
| 4 |
"syscall" |
| 5 |
"unsafe" |
| 6 |
|
| 7 |
experimentalsys "github.com/tetratelabs/wazero/experimental/sys" |
| 8 |
) |
| 9 |
|
| 10 |
const _UTIME_OMIT = -2 |
| 11 |
|
| 12 |
func utimens(path string, atim, mtim int64) experimentalsys.Errno { |
| 13 |
times := timesToTimespecs(atim, mtim) |
| 14 |
if times == nil { |
| 15 |
return 0 |
| 16 |
} |
| 17 |
return experimentalsys.UnwrapOSError(syscall.UtimesNano(path, times[:])) |
| 18 |
} |
| 19 |
|
| 20 |
func futimens(fd uintptr, atim, mtim int64) experimentalsys.Errno { |
| 21 |
times := timesToTimespecs(atim, mtim) |
| 22 |
if times == nil { |
| 23 |
return 0 |
| 24 |
} |
| 25 |
_p0 := unsafe.Pointer(×[0]) |
| 26 |
|
| 27 |
|
| 28 |
_, _, e1 := syscall_syscall6(libc_futimens_trampoline_addr, fd, uintptr(_p0), 0, 0, 0, 0) |
| 29 |
return experimentalsys.UnwrapOSError(e1) |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
var libc_futimens_trampoline_addr uintptr |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|