todo: error conditions
This commit is contained in:
parent
d69183c0d1
commit
60e9bcf95c
1 changed files with 5 additions and 3 deletions
8
main.s
8
main.s
|
@ -58,7 +58,7 @@ poll:
|
|||
syscall
|
||||
cmp rax, 0
|
||||
je poll
|
||||
jl exit
|
||||
jl exit ; TODO handle this gracefully
|
||||
mov rdi, rbx
|
||||
|
||||
; rdi - server fd
|
||||
|
@ -81,6 +81,7 @@ pollfds__scan__found:
|
|||
je pollfds__scan__found__server
|
||||
|
||||
pollfds__scan__found__client:
|
||||
; TODO check r10w, incl for POLLNVAL & POLLERR
|
||||
push rdi
|
||||
|
||||
mov rax, SYS_WRITE
|
||||
|
@ -90,7 +91,7 @@ pollfds__scan__found__client:
|
|||
mov rdx, goodbye_len
|
||||
syscall
|
||||
cmp rax, 0
|
||||
jl exit
|
||||
jl exit ; TODO handle this gracefully
|
||||
|
||||
mov rax, SYS_SHUTDOWN
|
||||
mov rdi, 0
|
||||
|
@ -110,6 +111,7 @@ pollfds__scan__found__client:
|
|||
jmp pollfds__scan__loop
|
||||
|
||||
pollfds__scan__found__server:
|
||||
; TODO check r10w, incl for POLLNVAL & POLLERR
|
||||
push rdi
|
||||
|
||||
mov rax, SYS_ACCEPT
|
||||
|
@ -117,7 +119,7 @@ pollfds__scan__found__server:
|
|||
mov rdx, 0
|
||||
syscall
|
||||
cmp rax, 0
|
||||
jl exit
|
||||
jl exit ; TODO handle this gracefully
|
||||
|
||||
mov rdi, rax
|
||||
mov si, POLLIN | POLLOUT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue