Improved error handling for struct types

This commit is contained in:
2025-02-08 16:29:56 +01:00
parent 97cdcbd1cb
commit 526385280a
5 changed files with 22 additions and 9 deletions

View File

@ -13,7 +13,7 @@ accept(fd Int, address Pointer, length Int) -> Int {
return syscall(43, fd, address, length)
}
bind(fd Int, address Pointer, length Int) -> Int {
bind(fd Int, address *sockaddr_in, length Int) -> Int {
return syscall(49, fd, address, length)
}

View File

@ -1,3 +1,8 @@
nanosleep(duration Pointer) -> Int {
struct timespec {
seconds Int
nanoseconds Int
}
nanosleep(duration *timespec) -> Int {
return syscall(35, duration, 0)
}

View File

@ -7,7 +7,7 @@ sleep(nanoseconds Int) {
seconds, nanoseconds = nanoseconds / 1000000000
}
duration := new(timespec)
duration := new(sys.timespec)
duration.seconds = seconds
duration.nanoseconds = nanoseconds
sys.nanosleep(duration)

View File

@ -1,4 +0,0 @@
struct timespec {
seconds Int
nanoseconds Int
}