mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
os: stub out support for some more features
This is necessary for the following: - to make sure os/exec can be imported - to make sure internal/testenv can be imported The internal/testenv package (which imports os/exec) is used by a lot of tests. By adding support for it, more tests can be run. This commit adds a bunch of new packages that now pass all tests.
This commit is contained in:
committed by
Ron Evans
parent
6cbaed75c8
commit
718746dd21
@@ -2,4 +2,23 @@
|
||||
|
||||
package os
|
||||
|
||||
import "syscall"
|
||||
|
||||
type syscallFd = int
|
||||
|
||||
func Pipe() (r *File, w *File, err error) {
|
||||
var p [2]int
|
||||
err = handleSyscallError(syscall.Pipe2(p[:], syscall.O_CLOEXEC))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
r = &File{
|
||||
handle: unixFileHandle(p[0]),
|
||||
name: "|0",
|
||||
}
|
||||
w = &File{
|
||||
handle: unixFileHandle(p[1]),
|
||||
name: "|1",
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user