push SYS_xxx
int 80h
// eax now holds the return of the kernel call
// where did td->td_retval[0] go ?
pid_t pid = syscall(SYS_gettid); // I'd assume this doesn't use td_retval[0] (can't find source of it in kernel)
exiled said:Thanks for the reply, I had already looked into that before and there didn't seem to be a whole lot of information in there, it seems there is a macro that defines KERNCALL and some basic system call which interrupts into the kernel.
#include "compat.h"
#include "SYS.h"
RSYSCALL(NAME)
.section .note.GNU-stack, "", %%progbits