Improved server example

This commit is contained in:
2025-02-08 17:34:11 +01:00
parent 526385280a
commit d0d096bcd2
5 changed files with 37 additions and 10 deletions

View File

@ -1,3 +1,11 @@
struct sockaddr_in_bsd {
sin_len Int8
sin_family Int8
sin_port Int16
sin_addr Int64
sin_zero Int64
}
socket(family Int, type Int, protocol Int) -> Int {
return syscall(0x2000061, family, type, protocol)
}
@ -6,7 +14,7 @@ accept(fd Int, address Pointer, length Int) -> Int {
return syscall(0x200001E, fd, address, length)
}
bind(fd Int, address Pointer, length Int) -> Int {
bind(fd Int, address *sockaddr_in_bsd, length Int) -> Int {
return syscall(0x2000068, fd, address, length)
}