LEFT | RIGHT |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 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 package os | 5 package os |
6 | 6 |
7 import ( | 7 import ( |
8 "runtime" | 8 "runtime" |
9 "sync" | |
10 "syscall" | 9 "syscall" |
11 ) | 10 ) |
12 | 11 |
13 // File represents an open file descriptor. | 12 // File represents an open file descriptor. |
14 type File struct { | 13 type File struct { |
15 fd int | 14 fd int |
16 name string | 15 name string |
17 » dirinfo *dirInfo // nil unless directory being read | 16 » dirinfo *dirInfo // nil unless directory being read |
18 » nepipe int // number of consecutive EPIPE in Write | 17 » nepipe int // number of consecutive EPIPE in Write |
19 » l sync.Mutex // used to implement windows pread/pwrite | |
20 } | 18 } |
21 | 19 |
22 // Fd returns the integer Unix file descriptor referencing the open file. | 20 // Fd returns the integer Unix file descriptor referencing the open file. |
23 func (file *File) Fd() int { | 21 func (file *File) Fd() int { |
24 if file == nil { | 22 if file == nil { |
25 return -1 | 23 return -1 |
26 } | 24 } |
27 return file.fd | 25 return file.fd |
28 } | 26 } |
29 | 27 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 return EPLAN9 | 339 return EPLAN9 |
342 } | 340 } |
343 | 341 |
344 func Lchown(name string, uid, gid int) Error { | 342 func Lchown(name string, uid, gid int) Error { |
345 return EPLAN9 | 343 return EPLAN9 |
346 } | 344 } |
347 | 345 |
348 func (f *File) Chown(uid, gid int) Error { | 346 func (f *File) Chown(uid, gid int) Error { |
349 return EPLAN9 | 347 return EPLAN9 |
350 } | 348 } |
LEFT | RIGHT |