mirror of
https://github.com/Quad4-Software/Reticulum-Go
synced 2026-08-29 23:48:44 -04:00
Keep epoll and kqueue on standard Go, and stop TinyGo from trying those backends on linux hosts.
20 lines
413 B
Go
20 lines
413 B
Go
// SPDX-License-Identifier: Apache-2.0
|
|
// Copyright (c) 2024-2026 Quad4.io
|
|
|
|
//go:build !tinygo
|
|
|
|
package backbone
|
|
|
|
import "runtime"
|
|
|
|
// DefaultBackend picks the native multiplexer for the current platform.
|
|
func DefaultBackend() Backend {
|
|
switch runtime.GOOS {
|
|
case "linux", "android":
|
|
return BackendEpoll
|
|
case "darwin", "freebsd", "netbsd", "openbsd":
|
|
return BackendKqueue
|
|
default:
|
|
return BackendGo
|
|
}
|
|
}
|