Unix Programming - Re: sleep_on_timeout() equivalent on aix

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2005 > Re: sleep_on_timeout() equivalent on aix





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: sleep_on_timeout() equivalent on aix
Kamal R. Prasad

2005-03-30, 7:55 am

kamalp@acm.org (Kamal R. Prasad) wrote in message news:<181e352f.0503290751.4c73c627@posting.google.com>...
> Hello,
>
> Is there a sleep_on_timeout() equivalent on AIX? This is basically a
> function in linux which a kernel module can use to wait for an event
> or wakeup if the timeout has occured (instead).
>
> thanks
> -kamal



There is a w_start() for the kind of granualarity Im looking at. But
for some reason the timer function isn't being called after the kernel
decrements the count.
-----------------
struct watchdog* wd = malloc(struct watchdog));
pin(wd, sizeof(struct watchdog));
wd->func = my_func;
wd->next = wd->prev = NULL;
wd->restart = wd->count = 20;
while (w_init(wd) != 0);
w_start(wd);
t_id = thread_self();
rc = e_sleep_thread(&t_id, NULL, INTERRUPTIBLE);
if (rc = INTERRUPTED)
{
....
}

my_func(struct watchdog*)
{
//this never gets called by the AIX kernel
uprintf("im in the timer\n");
//send a signal to t_id
}
-----------------------------------------
thanks for any help
-kamal
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com