|
@@ -6,17 +6,20 @@ global _start
|
6
|
6
|
_start:
|
7
|
7
|
|
8
|
8
|
; set stdin non blocking
|
|
9
|
+xor rdx, rdx
|
9
|
10
|
mov rax, 72 ; fcntl
|
10
|
11
|
mov rdi, 0 ; stdin
|
11
|
12
|
mov rsi, 3 ; F_GETFL
|
12
|
|
-mov rdx, 0
|
13
|
13
|
syscall
|
14
|
14
|
mov rdx, rax
|
15
|
|
-or rdx, 4 ; O_NONBLOCK
|
|
15
|
+or rdx, 0x800 ; O_NONBLOCK
|
|
16
|
+dbg:
|
16
|
17
|
mov rax, 72 ; fcntl
|
17
|
18
|
mov rdi, 0 ; stdin
|
18
|
19
|
mov rsi, 4 ; F_SETFL
|
19
|
20
|
syscall
|
|
21
|
+cmp rax, 0
|
|
22
|
+jne fault
|
20
|
23
|
|
21
|
24
|
mov rax, 228 ; clock_gettime
|
22
|
25
|
mov rdi, 0 ; CLOCK_REALTIME
|
|
@@ -207,7 +210,7 @@ hours: db "000000000"
|
207
|
210
|
timestr: db ":00:00.0000 ", 0x0D
|
208
|
211
|
timestrlen: equ $ - timestr
|
209
|
212
|
|
210
|
|
-nl: db 10
|
|
213
|
+nl: db 0x0A
|
211
|
214
|
buf: db 0
|
212
|
215
|
|
213
|
216
|
ts_cur:
|