[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE : open syscall wrapper - is this bug free ?
Ted Unangst wrote:
>Sorry for this OT, but this list is the closer i get!
>I am in need for writing an open syscall wrapper. Since i do not want
>deal with stdargs my approach went like this:
I have had the same problem, and i have fixed it with this on i386/*BSD:
So, I can do this:
int apx_open(const char *path, int flags, mode_t mode)
if ((ret = my_call(open)) == -1)
In fact, my_call() copy the current stack frame into a new one, and then
call the function in the first arg. So, the arg in apx_open() will be
unchanged after the my_call() call.
When open() return, we can get this value by the return of my_call().