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

Side by Side Diff: src/pkg/syscall/syscall_plan9.go

Issue 6015046: code review 6015046: syscall: remove the Signal type on Plan 9 (Closed)
Patch Set: diff -r d65c6e0efbb3 https://code.google.com/p/go/ Created 12 years, 10 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 | « src/pkg/os/exec_posix.go ('k') | src/pkg/syscall/zerrors_plan9_386.go » ('j') | 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 // Plan 9 system calls. 5 // Plan 9 system calls.
6 // This file is compiled as ordinary Go code, 6 // This file is compiled as ordinary Go code,
7 // but it is also input to mksyscall, 7 // but it is also input to mksyscall,
8 // which parses the //sys lines and generates system call stubs. 8 // which parses the //sys lines and generates system call stubs.
9 // Note that sometimes we use a lowercase //sys name and 9 // Note that sometimes we use a lowercase //sys name and
10 // wrap it in our own nicer implementation. 10 // wrap it in our own nicer implementation.
11 11
12 package syscall 12 package syscall
13 13
14 import "unsafe" 14 import "unsafe"
15 15
16 const ImplementsGetwd = true 16 const ImplementsGetwd = true
17 17
18 // ErrorString implements Error's String method by returning itself. 18 // ErrorString implements Error's String method by returning itself.
19 type ErrorString string 19 type ErrorString string
20 20
21 func (e ErrorString) Error() string { return string(e) } 21 func (e ErrorString) Error() string { return string(e) }
22 22
23 // NewError converts s to an ErrorString, which satisfies the Error interface. 23 // NewError converts s to an ErrorString, which satisfies the Error interface.
24 func NewError(s string) error { return ErrorString(s) } 24 func NewError(s string) error { return ErrorString(s) }
25 25
26 // A Note is a string describing a process note.
27 // It implements the os.Signal interface.
28 type Note string
29
30 func (n Note) Signal() {}
31
32 func (n Note) String() string {
33 return string(n)
34 }
35
26 var ( 36 var (
27 Stdin = 0 37 Stdin = 0
28 Stdout = 1 38 Stdout = 1
29 Stderr = 2 39 Stderr = 2
30 40
31 EAFNOSUPPORT = NewError("address family not supported by protocol") 41 EAFNOSUPPORT = NewError("address family not supported by protocol")
32 EISDIR = NewError("file is a directory") 42 EISDIR = NewError("file is a directory")
33 ) 43 )
34 44
35 // For testing: clients can set this flag to force 45 // For testing: clients can set this flag to force
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 325
316 func Getegid() (egid int) { return -1 } 326 func Getegid() (egid int) { return -1 }
317 func Geteuid() (euid int) { return -1 } 327 func Geteuid() (euid int) { return -1 }
318 func Getgid() (gid int) { return -1 } 328 func Getgid() (gid int) { return -1 }
319 func Getuid() (uid int) { return -1 } 329 func Getuid() (uid int) { return -1 }
320 330
321 func Getgroups() (gids []int, err error) { 331 func Getgroups() (gids []int, err error) {
322 return make([]int, 0), nil 332 return make([]int, 0), nil
323 } 333 }
324 334
325 type Signal int
326
327 func (s Signal) Signal() {}
328
329 func (s Signal) String() string {
330 return ""
331 }
332
333 //sys Dup(oldfd int, newfd int) (fd int, err error) 335 //sys Dup(oldfd int, newfd int) (fd int, err error)
334 //sys Open(path string, mode int) (fd int, err error) 336 //sys Open(path string, mode int) (fd int, err error)
335 //sys Create(path string, mode int, perm uint32) (fd int, err error) 337 //sys Create(path string, mode int, perm uint32) (fd int, err error)
336 //sys Remove(path string) (err error) 338 //sys Remove(path string) (err error)
337 //sys Pread(fd int, p []byte, offset int64) (n int, err error) 339 //sys Pread(fd int, p []byte, offset int64) (n int, err error)
338 //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) 340 //sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
339 //sys Close(fd int) (err error) 341 //sys Close(fd int) (err error)
340 //sys Chdir(path string) (err error) 342 //sys Chdir(path string) (err error)
341 //sys Bind(name string, old string, flag int) (err error) 343 //sys Bind(name string, old string, flag int) (err error)
342 //sys Mount(fd int, afd int, old string, flag int, aname string) (err error) 344 //sys Mount(fd int, afd int, old string, flag int, aname string) (err error)
343 //sys Stat(path string, edir []byte) (n int, err error) 345 //sys Stat(path string, edir []byte) (n int, err error)
344 //sys Fstat(fd int, edir []byte) (n int, err error) 346 //sys Fstat(fd int, edir []byte) (n int, err error)
345 //sys Wstat(path string, edir []byte) (err error) 347 //sys Wstat(path string, edir []byte) (err error)
346 //sys Fwstat(fd int, edir []byte) (err error) 348 //sys Fwstat(fd int, edir []byte) (err error)
OLDNEW
« no previous file with comments | « src/pkg/os/exec_posix.go ('k') | src/pkg/syscall/zerrors_plan9_386.go » ('j') | no next file with comments »

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