Sponsored Content
Full Discussion: Event firing
Top Forums Programming Event firing Post 5810 by Nadeem Mistry on Thursday 23rd of August 2001 11:35:58 PM
Old 08-24-2001
Event firing

I am writing a program in C.
It is kind of a daemon process.
In this program, at the end of every 2 hours,
i need to fire an event. How can i achieve this
timer effect in my program?
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk Script Is Not Firing

Why is my awk script not firing and how can I confirm? #!/usr/bin/ksh # LU 5 FEB 2007 12:35 OLDDATE=`cat TIMEFILE` for FILE in `find /home/Upload -prune -type f -newer TIMEFILE` do gawk -f convert_sun.awk "/home/Upload/$FILE" done date > TIMEFILE (5 Replies)
Discussion started by: goodmis
5 Replies

2. Shell Programming and Scripting

Connecting+Firing plsql to Oracle DB in one go

Hi, I am using the below command to connect to a remote Oracle DB from my unix shell script. sqlplus -s user1/password1@remotedbhost:1252/demo @/tmp/PROC_MS.prc But I get the below error. 1. Can you confirm if my code is correct ? 2. Can you help me overcome the error ? (3 Replies)
Discussion started by: mohtashims
3 Replies

3. Shell Programming and Scripting

Help to create audit log while firing 'rm' command

Hi, I would like to get the audit log with username, directory and the date whenever user fires 'rm' command anywhere in the file locations. Is there any possibility to capture the 'rm' command and its parameters from any environment by the single function ? Please advise me. ... (4 Replies)
Discussion started by: Joviac
4 Replies

4. War Stories

Firing someone for making a mistake, is this a de-motivator?

Would you fire this guy? A man appears to have deleted his entire company with one mistaken piece of code. By accidentally telling his computer to delete everything in his servers, hosting provider Marco Marsala has seemingly removed all trace of his company and the websites that he looks... (1 Reply)
Discussion started by: jon80
1 Replies
GETITIMER(2)						      BSD System Calls Manual						      GETITIMER(2)

NAME
getitimer, setitimer -- get/set value of interval timer SYNOPSIS
#include <sys/time.h> #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 int getitimer(int which, struct itimerval *value); int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue); DESCRIPTION
The system provides each process with three interval timers, defined in <sys/time.h>. The getitimer() call returns the current value for the timer specified in which in the structure at value. The setitimer() call sets a timer to the specified value (returning the previous value of the timer if ovalue is non-nil). A timer value is defined by the itimerval structure: struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; If it_value is non-zero, it indicates the time to the next timer expiration. If it_interval is non-zero, it specifies a value to be used in reloading it_value when the timer expires. Setting it_value to 0 disables a timer. Setting it_interval to 0 causes a timer to be disabled after its next expiration (assuming it_value is non-zero). Time values smaller than the resolution of the system clock are rounded up to this resolution (typically 10 milliseconds). The ITIMER_REAL timer decrements in real time. A SIGALRM signal is delivered when this timer expires. The ITIMER_VIRTUAL timer decrements in process virtual time. It runs only when the process is executing. A SIGVTALRM signal is delivered when it expires. The ITIMER_PROF timer decrements both in process virtual time and when the system is running on behalf of the process. It is designed to be used by interpreters in statistically profiling the execution of interpreted programs. Each time the ITIMER_PROF timer expires, the SIGPROF signal is delivered. Because this signal may interrupt in-progress system calls, programs using this timer must be prepared to restart interrupted system calls. NOTES
Three macros for manipulating time values are defined in <sys/time.h>. Timerclear sets a time value to zero, timerisset tests if a time value is non-zero, and timercmp compares two time values (beware that >= and <= do not work with this macro). RETURN VALUES
If the calls succeed, a value of 0 is returned. If an error occurs, the value -1 is returned, and a more precise error code is placed in the global variable errno. ERRORS
Getitimer() and setitimer() will fail if: [EFAULT] The value parameter specified a bad address. [EINVAL] A value parameter specified a time that was too large to be handled. SEE ALSO
select(2), sigaction(2), gettimeofday(2) HISTORY
The getitimer() function call appeared in 4.2BSD. 4.2 Berkeley Distribution December 11, 1993 4.2 Berkeley Distribution
All times are GMT -4. The time now is 01:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy