Files
tinygo/src/syscall/syscall.go
T
Scott Feldman a511f18c64 stub out more types/funcs to compile against golang.org/x/net/internal/socket (#4037)
* stub out more types/funcs to compile against golang.org/x/net/internal/socket

These are changes need to compile github.com/domainr/dnsr/ with TinyGo.
See issue https://github.com/tinygo-org/net/issues/14.

These change are mostly to fix missing symbols in src/crypto/tls and
src/net.  Missing types and functions are cut-and-pasted from go1.21.4.
Functions are stubbed out returning errors.New("not implemented").

DNRS is compiled by running tinygo test:

   sfeldma@nuc:~/work/dnsr$ tinygo test -target=wasi

With this patch, and a corresponding patch for tinygo-org/net to fixup
src/net, you should get a clean compile.
2023-12-17 15:32:53 +01:00

29 lines
517 B
Go

package syscall
import (
"errors"
"sync/atomic"
)
const (
MSG_DONTWAIT = 0x40
AF_INET = 0x2
AF_INET6 = 0xa
)
func Exit(code int)
type Rlimit struct {
Cur uint64
Max uint64
}
// origRlimitNofile, if not {0, 0}, is the original soft RLIMIT_NOFILE.
// When we can assume that we are bootstrapping with Go 1.19,
// this can be atomic.Pointer[Rlimit].
var origRlimitNofile atomic.Value // of Rlimit
func Setrlimit(resource int, rlim *Rlimit) error {
return errors.New("Setrlimit not implemented")
}