}
func UtimesNano(path string, ts []Timespec) error {
- // TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it
- // isn't supported by darwin so this uses utimes instead
if len(ts) != 2 {
return EINVAL
}
+ err := utimensat(_AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])))
+ if err != ENOSYS {
+ return err
+ }
// Not as efficient as it could be because Timespec and
// Timeval have different types in the different OSes
tv := [2]Timeval{
return
}
+func utimensat(dirfd int, path string, times *[2]Timespec) error {
+ // Darwin doesn't support SYS_UTIMENSAT
+ return ENOSYS
+}
+
/*
* Wrapped
*/
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
+//sys utimensat(dirfd int, path string, times *[2]Timespec) (err error)
/*
* Unimplemented
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
+//sys utimensat(dirfd int, path string, times *[2]Timespec) (err error)
/*
* Unimplemented
//sys munmap(addr uintptr, length uintptr) (err error)
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
+//sys utimensat(dirfd int, path string, times *[2]Timespec) (err error)
/*
* Unimplemented
//sys munmap(addr uintptr, length uintptr) (err error)
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
+//sys utimensat(dirfd int, path string, times *[2]Timespec) (err error)
/*
* Unimplemented
// thrsleep
// thrwakeup
// unlinkat
-// utimensat
// vfork
// writev
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg
//sys getexecname() (path unsafe.Pointer, err error) = libc.getexecname
+//sys utimensat(dirfd int, path string, times *[2]Timespec) (err error)
func Getexecname() (path string, err error) {
ptr, err := getexecname()
type BpfHdr C.struct_bpf_hdr
+// Misc
+
+const (
+ _AT_FDCWD = C.AT_FDCWD
+)
+
// Terminal handling
type Termios C.struct_termios
type BpfHdr C.struct_bpf_hdr
+// Misc
+
+const (
+ _AT_FDCWD = C.AT_FDCWD
+)
+
// Terminal handling
type Termios C.struct_termios
type BpfZbufHeader C.struct_bpf_zbuf_header
+// Misc
+
+const (
+ _AT_FDCWD = C.AT_FDCWD
+)
+
// Terminal handling
type Termios C.struct_termios
type BpfTimeval C.struct_bpf_timeval
+// Misc
+
+const (
+ _AT_FDCWD = C.AT_FDCWD
+)
+
// Terminal handling
type Termios C.struct_termios
type BpfTimeval C.struct_bpf_timeval
+// Misc
+
+const (
+ _AT_FDCWD = C.AT_FDCWD
+)
+
// Terminal handling
type Termios C.struct_termios
type BpfHdr C.struct_bpf_hdr
+// Misc
+
+const (
+ _AT_FDCWD = C.AT_FDCWD
+)
+
// Terminal handling
type Termios C.struct_termios
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
-// mksyscall.pl -l32 -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go
+// mksyscall.pl -l32 -netbsd -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// +build netbsd,arm
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
//go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so"
//go:cgo_import_dynamic libc_getexecname getexecname "libc.so"
+//go:cgo_import_dynamic libc_utimensat utimensat "libc.so"
//go:linkname libc_Getcwd libc_Getcwd
//go:linkname libc_getgroups libc_getgroups
//go:linkname libc_recvfrom libc_recvfrom
//go:linkname libc___xnet_recvmsg libc___xnet_recvmsg
//go:linkname libc_getexecname libc_getexecname
+//go:linkname libc_utimensat libc_utimensat
type libcFunc uintptr
libc_setsockopt,
libc_recvfrom,
libc___xnet_recvmsg,
- libc_getexecname libcFunc
+ libc_getexecname,
+ libc_utimensat libcFunc
)
func Getcwd(buf []byte) (n int, err error) {
}
return
}
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_utimensat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); }
SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }
SYS_VMM_GUEST_SYNC_ADDR = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }
+ SYS_UTIMENSAT = 539 // { int utimensat(int fd, const char *path, const struct timespec *ts, int flags); }
SYS_ACCEPT4 = 541 // { int accept4(int s, caddr_t name, int *anamelen, int flags); }
)
SYS_ACCEPT4 = 541 // { int accept4(int s, \
SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); }
SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \
+ SYS_UTIMENSAT = 547 // { int utimensat(int fd, \
)
SYS_ACCEPT4 = 541 // { int accept4(int s, \
SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); }
SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \
+ SYS_UTIMENSAT = 547 // { int utimensat(int fd, \
)
SYS_ACCEPT4 = 541 // { int accept4(int s, \
SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); }
SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \
+ SYS_UTIMENSAT = 547 // { int utimensat(int fd, \
)
Pad_cgo_0 [2]byte
}
+const (
+ _AT_FDCWD = -0x2
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Pad_cgo_0 [2]byte
}
+const (
+ _AT_FDCWD = -0x2
+)
+
type Termios struct {
Iflag uint64
Oflag uint64
Pad_cgo_0 [2]byte
}
+const (
+ _AT_FDCWD = -0x2
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Pad_cgo_0 [2]byte
}
+const (
+ _AT_FDCWD = -0x2
+)
+
type Termios struct {
Iflag uint64
Oflag uint64
Pad_cgo_0 [6]byte
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
X_bzh_pad [5]uint32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
X_bzh_pad [5]uint32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
X_bzh_pad [5]uint32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Usec int32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Usec int64
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Usec int32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Usec uint32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Usec uint32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Usec uint32
}
+const (
+ _AT_FDCWD = -0x64
+)
+
type Termios struct {
Iflag uint32
Oflag uint32
Pad_cgo_0 [2]byte
}
+const (
+ _AT_FDCWD = 0xffd19553
+)
+
type Termios struct {
Iflag uint32
Oflag uint32