[PATCH] POSIX timers for 2.4.0

From: Robert H. de Vries (rhdv@rhdv.cistron.nl)
Date: Thu Jan 25 2001 - 13:12:48 EST


Hi Linus,

Please accept this patch for inclusion. The impact on the kernel is
negligible and it makes the kernel a bit more POSIX feature complete. I
have received good feedback from people who have used the patch and I have
used it a lot myself without any problems.

This patch should not impact processes not using POSIX timers. The pointer
to the array of POSIX timers is left NULL. Nothing is done. When the first
timer is created and when a clone with the TIMER_CLONE flag is called, the
timer overhead is created.
 
As a reaction to the question if this should be in the kernel in the first
place: IMHO, there is no way to emulate these calls in user space by using
the setitimer() system call. For the following reasons:
 
a. setitimer() sends only SIGALRM, POSIX timers can send any signal.
 
b. setitimer() does not know about overruns, POSIX timers do.
 
c. setitimer() can be used only once in a given process, you can have
   upto 32 (configurable) POSIX timers at the same time in your process.
 
d. setitimer() cannot send extra information with its signal, POSIX timers
   can send a si_value when using RT signals.

There have been no changes to the code for almost half a year now. The code
has been shown to work on UP and SMP on x86 platforms. There is (untested)
support for most other platforms.

The patch is attached to this mail.

Test code and some other patches can be found on:
http://www.rhdv.cistron.nl/posix.html

         Robert

-- 
Robert de Vries
rhdv@rhdv.cistron.nl


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 31 2001 - 21:00:22 EST