Commit 7c542d2b authored by blackle's avatar blackle
Browse files

Use waitpid instead of waitid to save four bytes

parent 3a60aa21
......@@ -12,7 +12,7 @@
%define SYS_memfd_create 356
%define SYS_fork 2
%define SYS_waitid 284
%define SYS_waitpid 7
%define SYS_execve 11
%define SYS_open 5
%define SYS_lseek 19
......@@ -27,14 +27,16 @@ org 0xEBDB0000
ehdr: ;~e_ident
; jg short 0x47 (inc ebp) ; dec esp ; inc esi
db 0x7F,"EL";"F" ;!E_MAGIC
inc esi
db 0x7F,"ELF" ;!E_MAGIC
xor ebx, ebx
mov ax, SYS_waitid
lea esi, [ebx+P_ALL]
xchg eax, edi ;edi is zero now and will be overwritten eventually
mov al, SYS_waitpid
int 0x80
db 0x3D ; cmp eax, ...
dw 2 ;!e_type
......@@ -109,7 +111,7 @@ _start.4:
int 0x80
test eax, eax
jnz short _parent
jnz short _parent.0
;jz short _child
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment