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

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

Issue 12349044: code review 12349044: os, syscall: implement Getwd on darwin using getattrlist (Closed)
Patch Set: diff -r 8aeade4c393e https://go.googlecode.com/hg/ Created 11 years, 7 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/getwd.go ('k') | src/pkg/syscall/syscall_darwin.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 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 // +build darwin freebsd netbsd openbsd 5 // +build darwin freebsd netbsd openbsd
6 6
7 // BSD system call wrappers shared by *BSD based systems 7 // BSD system call wrappers shared by *BSD based systems
8 // including OS X (Darwin) and FreeBSD. Like the other 8 // including OS X (Darwin) and FreeBSD. Like the other
9 // syscall_*.go files it is compiled as Go code but also 9 // syscall_*.go files it is compiled as Go code but also
10 // used as input to mksyscall which parses the //sys 10 // used as input to mksyscall which parses the //sys
11 // lines and generates system call stubs. 11 // lines and generates system call stubs.
12 12
13 package syscall 13 package syscall
14 14
15 import ( 15 import (
16 "runtime" 16 "runtime"
17 "unsafe" 17 "unsafe"
18 ) 18 )
19 19
20 /* 20 /*
21 * Pseudo-system calls
22 */
23
24 // The const provides a compile-time constant so clients
25 // can adjust to whether there is a working Getwd and avoid
26 // even linking this function into the binary. See ../os/getwd.go.
27 const ImplementsGetwd = false
28
29 func Getwd() (string, error) { return "", ENOTSUP }
30
31 /*
32 * Wrapped 21 * Wrapped
33 */ 22 */
34 23
35 //sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error) 24 //sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error)
36 //sysnb setgroups(ngid int, gid *_Gid_t) (err error) 25 //sysnb setgroups(ngid int, gid *_Gid_t) (err error)
37 26
38 func Getgroups() (gids []int, err error) { 27 func Getgroups() (gids []int, err error) {
39 n, err := getgroups(0, nil) 28 n, err := getgroups(0, nil)
40 if err != nil { 29 if err != nil {
41 return nil, err 30 return nil, err
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 munmap: munmap, 526 munmap: munmap,
538 } 527 }
539 528
540 func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e rr error) { 529 func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e rr error) {
541 return mapper.Mmap(fd, offset, length, prot, flags) 530 return mapper.Mmap(fd, offset, length, prot, flags)
542 } 531 }
543 532
544 func Munmap(b []byte) (err error) { 533 func Munmap(b []byte) (err error) {
545 return mapper.Munmap(b) 534 return mapper.Munmap(b)
546 } 535 }
OLDNEW
« no previous file with comments | « src/pkg/os/getwd.go ('k') | src/pkg/syscall/syscall_darwin.go » ('j') | no next file with comments »

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