|
From: Tom H. <to...@co...> - 2005-03-30 13:17:58
|
In message <424...@go...>
Jeremy Fitzhardinge <je...@go...> wrote:
> If nothing else, the kal_* functions may as well be called
> VG_(getpid)(), etc, rather than either changing all the callers or
> having a file full of stub functions.
I was a bit unsure whether or not to get rid of the libc layer
altogether - in many cases it makes sense as the routines are
just stubs to forward to the KAL routines but some like mmap
and friends have extra logic in the libc layer to update the
segment mappings and similar.
>> Int VG_(getppid) ( void )
>> {
>>- Int res;
>>- res = VG_(do_syscall0)(__NR_getppid);
>>- return res;
>>+ return VG_(getppid)();
>> }
>>
> This might take a while to terminate...
Fixed in my local tree.
>>+Addr VG_(kal_mmap)(Addr start, SizeT length, UInt prot, UInt flags,
>>+ UInt fd, OffT offset)
>>+{
>>+ UWord args[6];
>>+
>>+ args[0] = start;
>>+ args[1] = length;
>>+ args[2] = prot;
>>+ args[3] = flags;
>>+ args[4] = fd;
>>+ args[5] = offset;
>>+
>>+ return VG_(do_syscall1)(__NR_mmap, (UWord)args);
>>+}
>>
> I think mmap2 would be preferable here.
The code was all copied from what the libc code was already doing
but you're probably right. It might make sense to use rt_sigpending
on x86 as well, that way we can share with amd64. The other signal
routines already use the rt version anyway.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|