Seebs <[email protected]> writes:
> And so far as I know, it's not actually *possible* to in the general
> case. I really don't think it's safe to try to catch syscall().
I think, something like
----
static void (*orig_syscall)();
long syscall(long number, ...)
{
switch (number) {
case __NR_renameat2: return _renameat2_syscall(.......);
}
void *res =__builtin_apply(orig_syscall, __builtin_apply_args(),
sizeof(uintmax_t) * 7);
__builtin_return(res);
}
----
will work to wrap syscall(2). Params for _renameat2_syscall() can be
extracted by va_args.
Code generated above is very ineffective; perhaps you can create
specialized assembly instructions which just jump into orig_syscall.
Enrico
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core