Hello,
I just stumbled over a strange behaviour of 2.6-Kernels when being bootet
thru pxelinux: alarms do not occur.
Example:
/* ------------------------------------------------------- */
#include <stdio.h>
#include <signal.h>
void catch_sig(int sig_num)
{
fprintf(stderr,"catch_sig %d\n", sig_num);
(void)signal(sig_num, catch_sig);
}
main()
{
catch_sig(SIGALRM);
alarm(3);
pause();
exit(0);
}
/* ---------------------------------------------- */
The program sleeps endlessly in pause().
The problem occurs with kernel 2.6.11, 2.6.11.4, 2.6.11.11
when being booted thru pxelinux (tested with 3.08 and 2.11) only,
that is the program behaves as intended when exactly the same kernel
is booted with lilo or grub.
The problem did not occur on 2.4-kernels (the latest running version I
tested was 2.4.25).
The same problem happens when using setitimer() as within the following
example:
/* ---------------------------------------------- */
#include <stdio.h>
#include <signal.h>
#include <sys/time.h>
void catch_sig(int sig_num)
{
fprintf(stderr,"catch_sig %d\n", sig_num);
(void)signal(sig_num, catch_sig);
}
main()
{
int res;
struct itimerval itimer;
catch_sig(SIGALRM);
itimer.it_value.tv_sec = 0;
itimer.it_value.tv_usec = 200*1000;
itimer.it_interval.tv_sec = 0;
itimer.it_interval.tv_usec = 300*1000;
res = setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0);
fprintf(stderr,"setitimer: res=%d\n", res);
for(;;) pause() ;
}
/* ---------------------------------------------- */
Any ideas?
Any ideas for tracking down the problem?
Regards,
Hans
--
Hans Korneder hans (at) korneder (dot) de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]