9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Another silly one..
@ 2001-10-23 16:19 Ish Rattan
  2001-10-23 16:34 ` Lucio De Re
  0 siblings, 1 reply; 2+ messages in thread
From: Ish Rattan @ 2001-10-23 16:19 UTC (permalink / raw)
  To: 9fans


I am trying to figure the usage of
	int atnotify(int (*f)(void *, char *), int in);

to set up an alarm signal hendler. I can't get past the type mismatch
error. Any pointers will be appreciated. The sample code is given below.

-ishwar
---
#include <u.h>
#include <libc.h>

int handle(void *uureg, char *signal)
{
   print("signal seen: %s\n", signal);
   return 1;
}

main()
{
   char *reason="alarm";

   atnotify(handle(nil, reason), 1);
   alarm(1000);
   print("All done..\n");
   exits(0);
}
----



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

* Re: [9fans] Another silly one..
  2001-10-23 16:19 [9fans] Another silly one Ish Rattan
@ 2001-10-23 16:34 ` Lucio De Re
  0 siblings, 0 replies; 2+ messages in thread
From: Lucio De Re @ 2001-10-23 16:34 UTC (permalink / raw)
  To: 9fans

On Tue, Oct 23, 2001 at 12:19:48PM -0400, Ish Rattan wrote:
> 
>    atnotify(handle(nil, reason), 1);
remove              ^^^^^^^^^^^^^ you want the function name, not a
call to it.

>    alarm(1000);
>    print("All done..\n");
>    exits(0);
> }
> ----


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

end of thread, other threads:[~2001-10-23 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-23 16:19 [9fans] Another silly one Ish Rattan
2001-10-23 16:34 ` Lucio De Re

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).