extern int execfve(void*, const char**, const char**);
extern int execeve(void*, size_t, char *const [], char *const []);
extern unsigned int sleep(unsigned int);
-extern int brk(void*);
-extern void* sbrk(int);
#endif /* _UNISTD_H */
.global vfork
.global _exit
.global execeve
- .global brk
- .global sbrk
.global mmap
.global munmap
.global sigaction
popl %ebx
ret
-brk:
- pushl $0
- call sbrk
-
- /*
- * The eax register contains the current sbrk, 8(%esp) the desired sbrk.
- * We have to pass the difference to sbrk() to increase or decrease it.
- */
- movl 8(%esp), %edx
- subl %eax, %edx
-
- /* sbrk(8(%esp) - sbrk(0)) */
- movl %edx, (%esp)
- call sbrk
-
- addl $4, %esp
- ret
-
-sbrk:
- pushl %ebx
-
- movl $SYS_SBRK, %eax
- movl 8(%esp), %ebx
- int $SYSCALL_POSIX
-
- popl %ebx
- ret
-
mmap:
pushl %ebx
pushl %ebp