Joel Sherrill Joel.Sherrill at
Sat Dec 21 01:33:21 UTC 2013

Depending on what it is doing, using time fire after might be a better option.

On Dec 20, 2013 1:52 PM, "Claus, Ric" <claus at> wrote:
A program that I’m trying to make compatible with RTEMS (iperf 2.0.5) uses the posix function setitimer(), which has only a trivial implementation under RTEMS.  I modified the code as follows:

    if ( mMode_Time ) {
        memset (&it, 0, sizeof (it));
        it.it_value.tv_sec = (int) (mSettings->mAmount / 100.0);
        it.it_value.tv_usec = (int) 10000 * (mSettings->mAmount -
            it.it_value.tv_sec * 100.0);
#ifndef __rtems__
        err = setitimer( ITIMER_REAL, &it, NULL );
        if ( err != 0 ) {
        FAIL (mSettings->mAmount > UINT_MAX / 10000, "ualarm", mSettings);

        ualarm(mSettings->mAmount * 10000, 0);

If implementing setitimer( ITIMER_REAL, … ) with ualarm() is a valid thing to do (please comment), would it be useful for me to provide a patch to setitimer() that operates this way?  I’m not sure whether in this scenario the alarm must be cancelled with alarm(0, 0) later or not, but that would prevent this from being a generic solution.

rtems-devel mailing list
rtems-devel at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the devel mailing list