public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.12: itimer_real timers don't survive execve() any more
@ 2005-08-04 16:45 Gerd Knorr
  2005-08-04 21:22 ` [PATCH] " George Anzinger
  0 siblings, 1 reply; 10+ messages in thread
From: Gerd Knorr @ 2005-08-04 16:45 UTC (permalink / raw)
  To: Linux Kernel Mailing List

  Hi,

Somewhere between 2.6.11 and 2.6.12 the regression in $subject
was added to the linux kernel.  Testcase below.

Ideas on that anyone?

  Gerd

==============================[ test_exec_alarm.c ]==============================
#include <sys/time.h>
#include <unistd.h>
#include <string.h>

int main(int argc, char ** argv)
{
    struct itimerval value;
    int retval;
    static char hosted_executable[256];
    char * hosted_executable_args[2];

    /* Set the alarm timer. */
    value.it_interval.tv_sec = 0;
    value.it_interval.tv_usec = 0;
    value.it_value.tv_sec = 200;
    value.it_value.tv_usec = 0;
    retval = setitimer(ITIMER_REAL, &value, NULL);
    if (retval != 0) {
        perror("setitimer()");
        return 1;
    }

    /* Prepare the file name of the hosted executable. */
    strcpy(hosted_executable, "./test_getitimer");

    /* Prepare the command line arguments. */
    hosted_executable_args[0] = hosted_executable;
    hosted_executable_args[1] = NULL;

    /* Execute the hosted executable which should inherit the timer. */
    retval = execvp(hosted_executable, hosted_executable_args);

    /* If we get here, the execvp() call failed. */
    perror("execvp()");
    return 1;
}
==============================[ test_getitimer.c ]==============================
#include <sys/time.h>
#include <stdio.h>

int main(int argc, char ** argv)
{
    struct itimerval value;
    int retval;

    retval = getitimer(ITIMER_REAL, &value);
    if (retval != 0) {
        perror("getitimer()");
        return 1;
    }

    printf("alarm timer value: %u sec, %u msec\n", value.it_value.tv_sec, value.it_value.tv_usec);
    return 0;
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-08-06  0:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04 16:45 2.6.12: itimer_real timers don't survive execve() any more Gerd Knorr
2005-08-04 21:22 ` [PATCH] " George Anzinger
2005-08-04 21:34   ` Roland McGrath
2005-08-04 22:02     ` Andrew Morton
2005-08-04 22:10       ` George Anzinger
2005-08-05  8:44       ` Gerd Knorr
2005-08-05 15:33         ` George Anzinger
2005-08-05 22:10           ` Roland McGrath
2005-08-06  0:50             ` George Anzinger
2005-08-04 21:37   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox