...

Source file src/cmd/cgo/internal/teststdio/testdata/stdio/stdio.go

Documentation: cmd/cgo/internal/teststdio/testdata/stdio

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

View as plain text