Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Side by Side Diff: src/pkg/os/file_plan9.go

Issue 4657074: code review 4657074: os: fix build for Plan 9 (Closed)
Patch Set: diff -r 67b160cd5fa4 https://go.googlecode.com/hg/ Created 13 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
9 "syscall" 10 "syscall"
10 ) 11 )
11 12
13 // File represents an open file descriptor.
14 type File struct {
15 fd int
16 name string
17 dirinfo *dirInfo // nil unless directory being read
18 nepipe int // number of consecutive EPIPE in Write
19 l sync.Mutex // used to implement windows pread/pwrite
brainman 2011/07/05 05:11:42 This lock is for windows only. I don't think you n
20 }
21
22 // Fd returns the integer Unix file descriptor referencing the open file.
23 func (file *File) Fd() int {
24 if file == nil {
25 return -1
26 }
27 return file.fd
28 }
29
30 // NewFile returns a new File with the given file descriptor and name.
31 func NewFile(fd int, name string) *File {
32 if fd < 0 {
33 return nil
34 }
35 f := &File{fd: fd, name: name}
36 runtime.SetFinalizer(f, (*File).Close)
37 return f
38 }
39
12 // Auxiliary information if the File describes a directory 40 // Auxiliary information if the File describes a directory
13 type dirInfo struct { 41 type dirInfo struct {
14 buf [syscall.STATMAX]byte // buffer for directory I/O 42 buf [syscall.STATMAX]byte // buffer for directory I/O
15 nbuf int // length of buf; return value from Read 43 nbuf int // length of buf; return value from Read
16 bufp int // location of next record in buf. 44 bufp int // location of next record in buf.
17 } 45 }
18 46
19 func epipecheck(file *File, e syscall.Error) { 47 func epipecheck(file *File, e syscall.Error) {
20 } 48 }
21 49
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return EPLAN9 341 return EPLAN9
314 } 342 }
315 343
316 func Lchown(name string, uid, gid int) Error { 344 func Lchown(name string, uid, gid int) Error {
317 return EPLAN9 345 return EPLAN9
318 } 346 }
319 347
320 func (f *File) Chown(uid, gid int) Error { 348 func (f *File) Chown(uid, gid int) Error {
321 return EPLAN9 349 return EPLAN9
322 } 350 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b