2005-04-21 16:53:53 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
2005-07-14 17:13:33 +02:00
|
|
|
* sys_setalarm *
|
2005-04-21 16:53:53 +02:00
|
|
|
*===========================================================================*/
|
2005-07-14 17:13:33 +02:00
|
|
|
PUBLIC int sys_setalarm(proc_nr, exp_time, abs_time)
|
2005-04-21 16:53:53 +02:00
|
|
|
int proc_nr; /* process to send SYN_ALARM message to */
|
|
|
|
clock_t exp_time; /* expiration time for the alarm */
|
|
|
|
int abs_time; /* use absolute or relative expiration time */
|
|
|
|
{
|
|
|
|
/* Ask the SYSTEM schedule a synchronous alarm for the caller. The process
|
|
|
|
* number can be SELF if the caller doesn't know its process number.
|
|
|
|
*/
|
|
|
|
message m;
|
|
|
|
|
|
|
|
m.ALRM_PROC_NR = proc_nr; /* receiving process */
|
|
|
|
m.ALRM_EXP_TIME = exp_time; /* the expiration time */
|
|
|
|
m.ALRM_ABS_TIME = abs_time; /* time is absolute? */
|
2005-07-14 17:13:33 +02:00
|
|
|
return _taskcall(SYSTASK, SYS_SETALARM, &m);
|
2005-04-21 16:53:53 +02:00
|
|
|
}
|
|
|
|
|