mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
src/os: export correct values for os.DevNull for each OS
This commit introduces `os.DevNull` exports for all supported OS targets.
This commit is contained in:
@@ -26,8 +26,6 @@ var (
|
|||||||
Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr")
|
Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr")
|
||||||
)
|
)
|
||||||
|
|
||||||
const DevNull = "/dev/null"
|
|
||||||
|
|
||||||
// isOS indicates whether we're running on a real operating system with
|
// isOS indicates whether we're running on a real operating system with
|
||||||
// filesystem support.
|
// filesystem support.
|
||||||
const isOS = true
|
const isOS = true
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ var (
|
|||||||
Stderr = NewFile(2, "/dev/stderr")
|
Stderr = NewFile(2, "/dev/stderr")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const DevNull = "/dev/null"
|
||||||
|
|
||||||
// isOS indicates whether we're running on a real operating system with
|
// isOS indicates whether we're running on a real operating system with
|
||||||
// filesystem support.
|
// filesystem support.
|
||||||
const isOS = false
|
const isOS = false
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
//go:build darwin || (linux && !baremetal)
|
//go:build darwin || (linux && !baremetal)
|
||||||
// +build darwin linux,!baremetal
|
// +build darwin linux,!baremetal
|
||||||
|
|
||||||
|
// target wasi sets GOOS=linux and thus the +linux build tag,
|
||||||
|
// even though it doesn't show up in "tinygo info target -wasi"
|
||||||
|
|
||||||
// Portions copyright 2009 The Go Authors. All rights reserved.
|
// Portions copyright 2009 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
@@ -12,6 +15,8 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const DevNull = "/dev/null"
|
||||||
|
|
||||||
type syscallFd = int
|
type syscallFd = int
|
||||||
|
|
||||||
// fixLongPath is a noop on non-Windows platforms.
|
// fixLongPath is a noop on non-Windows platforms.
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import (
|
|||||||
"unicode/utf16"
|
"unicode/utf16"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const DevNull = "NUL"
|
||||||
|
|
||||||
type syscallFd = syscall.Handle
|
type syscallFd = syscall.Handle
|
||||||
|
|
||||||
// Symlink is a stub, it is not implemented.
|
// Symlink is a stub, it is not implemented.
|
||||||
|
|||||||
Reference in New Issue
Block a user