Commit 05743967 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

nodefs: futimens() on loopbackfile.

parent ebdf939a
......@@ -28,9 +28,7 @@ func (f *loopbackFile) Utimens(ctx context.Context, a *time.Time, m *time.Time)
ts[0] = fuse.UtimeToTimespec(a)
ts[1] = fuse.UtimeToTimespec(m)
f.mu.Lock()
var err error
// NOSUBMIT
// err := futimens(int(f.File.Fd()), &ts)
err := futimens(int(f.File.Fd()), &ts)
f.mu.Unlock()
return fuse.ToStatus(err)
}
// Copyright 2016 the Go-FUSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package nodefs
import (
"syscall"
"unsafe"
)
// futimens - futimens(3) calls utimensat(2) with "pathname" set to null and
// "flags" set to zero
func futimens(fd int, times *[2]syscall.Timespec) (err error) {
_, _, e1 := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(fd), 0, uintptr(unsafe.Pointer(times)), uintptr(0), 0, 0)
if e1 != 0 {
err = syscall.Errno(e1)
}
return
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment