mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 11:37:46 +00:00
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.
This commit is contained in:
@@ -1,3 +1,28 @@
|
||||
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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user