[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
3.0 libc_r.a signal bug!
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: 3.0 libc_r.a signal bug!
- From: Kent Watsen <kent_(_at_)_watsen_(_dot_)_net>
- Date: Thu, 25 Jul 2002 00:32:05 -0700
The following code works when compiled with
gcc test.c
but fails when compiled with
gcc test.c -lc_r
or
gcc test.c -pthread
I'm I to believe that no multithreaded apps on
OpenBSD are interruptable?
Kent Watsen
-- test.c --
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <stdbool.h>
bool alive = true;
static void handleFunc(int sig) {
printf("interrupted!\n");
alive = false;
}
int main(int argc, char* argv[]) {
signal(SIGINT, handleFunc);
while (alive==true) {
printf("waiting...\n");
usleep(100000);
}
printf("done\n");
return 0;
}
Visit your host, monkey.org