![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Timer | aekaramg20 | Shell Programming and Scripting | 6 | 08-21-2008 06:47 AM |
| script run timer | mark_nsx | UNIX for Dummies Questions & Answers | 2 | 10-08-2005 06:01 PM |
| Timer for VNC | foweja | UNIX for Advanced & Expert Users | 1 | 07-14-2005 07:31 AM |
| VNC Timer | foweja | Shell Programming and Scripting | 0 | 07-13-2005 09:25 AM |
| timer | k_oops9 | Shell Programming and Scripting | 3 | 11-08-2004 08:33 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Solaris Timer Implementation
I've a problem with a Solaris program implementation: My code uses a
timer procedure and when i try to execute date -a XXXX or rdate, my aplication stops. I can't use ntp and need to set the machine time. Here is my procedure. If you know how you can help me, please, do it. static void handlerDelay() { siglongjmp( env, 1 ); } int XoPortUtilDelay( unsigned int milissec ) { int houveTemporizacao = 0; int segundos; int microSeg; struct itimerval tempoSleep; void (*handlerAnterior)(); segundos = milissec / 1000; microSeg = ( milissec % 1000 ) * 1000; //!!! if( microSeg < 50000 ){ microSeg = 50000; } //!!! tempoSleep.it_value.tv_sec = segundos; tempoSleep.it_value.tv_usec = microSeg; tempoSleep.it_interval.tv_sec = 0; tempoSleep.it_interval.tv_usec = 0; handlerAnterior = signal( SIGALRM, handlerDelay ); if( handlerAnterior == SIG_ERR ){ return FALHA; } /* The first call to sigsetjmp show the point where the next siglongjmp will return. Return always 0 at first time. When siglongjmp is called (no signal handler), execution return to the call point to sigsetjmp and the returned value are the specified as second argument in siglongjmp. */ houveTemporizacao = sigsetjmp( env, 1 ); if( !houveTemporizacao ){ if( setitimer( ITIMER_REAL, &tempoSleep, NULL ) == -1 ){ return FALHA; } pause(); } signal( SIGALRM, handlerAnterior ); return SUCESSO; }//fim XoPorUtilDelay |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
According to our rules:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting. Please stop posting this thread in every forum that you can find. If you think that repeatedly breaking our rules is going to help you find an answer faster, you are very mistaken. |
|
#3
|
|||
|
|||
|
I just did It 'cause I need it immediatly
|
|||
| Google The UNIX and Linux Forums |