- if e := syscall.Fwstat(f.fd, pdir(nil, &d)); e != nil {
- return &PathError{"truncate", f.name, e}
+ var buf [syscall.STATFIXLEN]byte
+ n, err := d.Marshal(buf[:])
+ if err != nil {
+ return &PathError{"truncate", f.name, err}
+ }
+ if err = syscall.Fwstat(f.fd, buf[:n]); err != nil {
+ return &PathError{"truncate", f.name, err}