//go:build !tinygo

package sysfs

import (
	
	
	_ 

	experimentalsys 
)

const (
	_AT_FDCWD   = -0x64
	_UTIME_OMIT = (1 << 30) - 2
)

func utimens( string, ,  int64) experimentalsys.Errno {
	 := timesToTimespecs(, )
	if  == nil {
		return 0
	}

	var  int
	var  *byte
	,  := syscall.BytePtrFromString()
	if  == nil {
		 = utimensat(_AT_FDCWD, uintptr(unsafe.Pointer()), , )
	}
	return experimentalsys.UnwrapOSError()
}

// On linux, implement futimens via utimensat with the NUL path.
func futimens( uintptr, ,  int64) experimentalsys.Errno {
	 := timesToTimespecs(, )
	if  == nil {
		return 0
	}
	return experimentalsys.UnwrapOSError(utimensat(int(), 0 /* NUL */, , 0))
}

// utimensat is like syscall.utimensat special-cased to accept a NUL string for the path value.
func utimensat( int,  uintptr,  *[2]syscall.Timespec,  int) ( error) {
	, ,  := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(), , uintptr(unsafe.Pointer()), uintptr(), 0, 0)
	if  != 0 {
		 = 
	}
	return
}