On 17 January 2014 19:20, Erik de Castro Lopo <mle+to...@mega-nerd.com> wrote: > When I implemented the POSIX timer syscalls a little while ago I got > them working for my specific use case. Since then someone pointed > out that the implementation was not complete and I'd like to fix > that. The ticket is here: > > https://bugs.launchpad.net/qemu/+bug/1042388#27 > > and the guest user space test case here: > > > https://bugs.launchpad.net/qemu/+bug/1042388/+attachment/3948443/+files/timer_test.c
OK, so the test case is using a sigevent with type SIGEV_THREAD, which means "Notify the process by invoking sigev_notify_function "as if" it were the start function of a new thread." However, this is not what you need to implement, because that is the libc API, not the syscall API. The syscall actually being done here is: timer_create(CLOCK_REALTIME, {0x8331098, 32, SIGEV_THREAD_ID, {8113}}, {0x1}) = 0 (libc creates a thread for purposes of making the function calls, and then asks the kernel to signal that thread so it knows when to do the calls). So all you need to do is implement SIGEV_THREAD_ID correctly, which should be pretty straightforward (you can let the host kernel deal with the error checking on the thread ID, you just need to pass all the information through, I think). thanks -- PMM