2016-11-23 18:25:55 +00:00
|
|
|
! The system call checks the timeval pointer but doesn't store the
|
|
|
|
! time there. If the pointer wasn't NULL, then the system call
|
|
|
|
! returns the time in a pair of registers.
|
|
|
|
|
2016-10-02 18:58:05 +00:00
|
|
|
.sect .text
|
|
|
|
.define _gettimeofday
|
|
|
|
_gettimeofday:
|
|
|
|
mov eax, 116
|
|
|
|
int 0x80
|
|
|
|
jb .set_errno
|
2016-11-23 18:25:55 +00:00
|
|
|
mov ebx, 4(esp) ! timeval pointer
|
|
|
|
test ebx, ebx
|
|
|
|
je 1f
|
|
|
|
mov 0(ebx), eax ! seconds
|
|
|
|
mov 4(ebx), edx ! microseconds
|
|
|
|
1:
|
|
|
|
mov eax, 0 ! return 0
|
2016-10-02 18:58:05 +00:00
|
|
|
ret
|