q/lib/net/net_linux.q
2025-02-17 14:31:47 +01:00

10 lines
190 B
Plaintext

import sys
bind(socket int, port int) -> int {
addr := new(sys.sockaddr_in)
addr.sin_family = 2
addr.sin_port = htons(port)
err := sys.bind(socket, addr, 20)
delete(addr)
return err
}