Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > is this an signal handler or a alarm ?

Reply
Thread Tools

is this an signal handler or a alarm ?

 
 
LeTubs
Guest
Posts: n/a
 
      04-30-2004
Hi

I'm not sure if this is correct ...place to post but here goes

This is what i'm trying to do, I want to write a signal / alarm handler
( I don't know which hence the posting here, as once I know the proper
name /useage then I'll use google to try and find out more
information )....
Thus any tips or pointers would be helpful (and I'm using a UNIX variant as
OS)

Many Thanks
David

the (?) means I'm not sure if I need the variable or not...

xxxxxxx( &MyTimeFunction, (?)(void *)SleepCounter );

do_some_other_work(......)
..
..
..
/* Check to see if the sleep counter has been set (ie it has
waited a specific time or timeout period
*/
xxxxxxx( SleepCounter );

void * MyTimeFunction( void * arg ){

int MySleepCounter = (int) arg;
for ( i = 0; i < SOME_SYSTEM_COUNTER; i++ ){}

/* Not sure on this bit also but want to set a value of 1
to denote the sleep time has been set
*/
SleepCounter = 1;
}





 
Reply With Quote
 
 
 
 
Christopher Benson-Manica
Guest
Posts: n/a
 
      04-30-2004
LeTubs <(E-Mail Removed)> spoke thus:

> I'm not sure if this is correct ...place to post but here goes


(It isn't. Now you know.)

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
 
Reply With Quote
 
 
 
 
Karthik
Guest
Posts: n/a
 
      04-30-2004
LeTubs wrote:
> Hi
>


IMHO, Most appropriate to comp.unix.programmer . Setting followup-to
appropriately.

HTH
 
Reply With Quote
 
E. Robert Tisdale
Guest
Posts: n/a
 
      04-30-2004
LeTubs wrote:

> I'm not sure if this is correct ...place to post but here goes
>
> This is what I'm trying to do, I want to write a signal/alarm handler
> (I don't know which hence the posting here,
> as once I know the proper name/useage
> then I'll use google to try and find out more information )....
> Thus any tips or pointers would be helpful
> (and I'm using a UNIX variant as OS)


SIGNAL(2) Linux Programmerís Manual SIGNAL(2)

NAME
signal - ANSI C signal handling

SYNOPSIS
#include <signal.h>

typedef void (*sighandler_t)(int);

sighandler_t signal(int signum, sighandler_t handler);

DESCRIPTION
The signal() system call installs a new signal handler
for the signal with number signum.
The signal handler is set to sighandler which may be
a user specified function, or either SIG_IGN or SIG_DFL.

Upon arrival of a signal with number signum,
the following happens.
If the corresponding handler is set to SIG_IGN,
then the signal is ignored. If the handler is set to SIG_DFL,
then the default action associated to the signal
(see signal(7)) occurs. Finally,
if the handler is set to a function sighandler,
then first either the handler is reset to SIG_DFL
or an implementation-dependent blocking of the signal
is performed and next sighandler is called with argument signum.

Using a signal handler function for a signal
is called "catching the signal".
The signals SIGKILL and SIGSTOP cannot be caught or ignored.

RETURN VALUE
The signal() function returns
the previous value of the signal handler, or SIG_ERR on error.

.
.
.

CONFORMING TO
ANSI C

SEE ALSO
kill(1), kill(2), killpg(2), pause(2), raise(3),
sigaction(2), signal(7), sigsetops(3), sigvec(2), alarm(2)

Linux 2.2 2000-04-28 SIGNAL(2)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
timeout using alarm signal question?? Ishwar Rattan Python 0 07-22-2004 03:49 PM
Zone Alarm or Zone Alarm Pro? Jones Computer Information 5 02-20-2004 07:29 PM
Audible alarm in Zone Alarm? Patch Computer Support 4 08-18-2003 07:43 PM



Advertisments