LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Windows system calls. | 5 // Windows system calls. |
6 | 6 |
7 package syscall | 7 package syscall |
8 | 8 |
9 import ( | 9 import ( |
10 "unicode/utf16" | 10 "unicode/utf16" |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) | 444 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) |
445 if e != nil { | 445 if e != nil { |
446 return e | 446 return e |
447 } | 447 } |
448 defer Close(h) | 448 defer Close(h) |
449 a := NsecToFiletime(tv[0].Nanoseconds()) | 449 a := NsecToFiletime(tv[0].Nanoseconds()) |
450 w := NsecToFiletime(tv[1].Nanoseconds()) | 450 w := NsecToFiletime(tv[1].Nanoseconds()) |
451 return SetFileTime(h, nil, &a, &w) | 451 return SetFileTime(h, nil, &a, &w) |
452 } | 452 } |
453 | 453 |
454 const ImplementsUtimens = true | 454 func UtimesNano(path string, ts []Timespec) (err error) { |
455 | |
456 func Utimens(path string, ts []Timespec) (err error) { | |
457 if len(ts) != 2 { | 455 if len(ts) != 2 { |
458 return EINVAL | 456 return EINVAL |
459 } | 457 } |
460 » pathp, e := utf16PtrFromString(path) | 458 » pathp, e := UTF16PtrFromString(path) |
461 if e != nil { | 459 if e != nil { |
462 return e | 460 return e |
463 } | 461 } |
464 h, e := CreateFile(pathp, | 462 h, e := CreateFile(pathp, |
465 FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, | 463 FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, |
466 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) | 464 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) |
467 if e != nil { | 465 if e != nil { |
468 return e | 466 return e |
469 } | 467 } |
470 defer Close(h) | 468 defer Close(h) |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 | 861 |
864 func (s Signal) String() string { | 862 func (s Signal) String() string { |
865 if 0 <= s && int(s) < len(signals) { | 863 if 0 <= s && int(s) < len(signals) { |
866 str := signals[s] | 864 str := signals[s] |
867 if str != "" { | 865 if str != "" { |
868 return str | 866 return str |
869 } | 867 } |
870 } | 868 } |
871 return "signal " + itoa(int(s)) | 869 return "signal " + itoa(int(s)) |
872 } | 870 } |
LEFT | RIGHT |