LEFT | RIGHT |
(no file at all) | |
| 1 // skip |
| 2 |
1 // Copyright 2009 The Go Authors. All rights reserved. | 3 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
4 | |
5 // +build !netbsd | |
6 | 6 |
7 package stdio | 7 package stdio |
8 | 8 |
9 /* | 9 /* |
10 #include <stdio.h> | 10 #include <stdio.h> |
| 11 |
| 12 // on mingw, stderr and stdout are defined as &_iob[FILENO] |
| 13 // on netbsd, they are defined as &__sF[FILENO] |
| 14 // and cgo doesn't recognize them, so write a function to get them, |
| 15 // instead of depending on internals of libc implementation. |
| 16 FILE *getStdout(void) { return stdout; } |
| 17 FILE *getStderr(void) { return stderr; } |
11 */ | 18 */ |
12 import "C" | 19 import "C" |
13 | 20 |
14 var Stdout = (*File)(C.stdout) | 21 var Stdout = (*File)(C.getStdout()) |
15 var Stderr = (*File)(C.stderr) | 22 var Stderr = (*File)(C.getStderr()) |
LEFT | RIGHT |