From 04b08da9af0c450d645ab7389d1467308cfc2db8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 4 Mar 2013 21:27:36 +0100 Subject: Imported Upstream version 1.1~hg20130304 --- misc/cgo/stdio/stdio.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 misc/cgo/stdio/stdio.go (limited to 'misc/cgo/stdio/stdio.go') diff --git a/misc/cgo/stdio/stdio.go b/misc/cgo/stdio/stdio.go new file mode 100644 index 000000000..76cb8ad80 --- /dev/null +++ b/misc/cgo/stdio/stdio.go @@ -0,0 +1,22 @@ +// skip + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package stdio + +/* +#include + +// on mingw, stderr and stdout are defined as &_iob[FILENO] +// on netbsd, they are defined as &__sF[FILENO] +// and cgo doesn't recognize them, so write a function to get them, +// instead of depending on internals of libc implementation. +FILE *getStdout(void) { return stdout; } +FILE *getStderr(void) { return stderr; } +*/ +import "C" + +var Stdout = (*File)(C.getStdout()) +var Stderr = (*File)(C.getStderr()) -- cgit v1.2.3