![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Timer | aekaramg20 | Shell Programming and Scripting | 6 | 08-21-2008 10:47 AM |
| script run timer | mark_nsx | UNIX for Dummies Questions & Answers | 2 | 10-08-2005 10:01 PM |
| Timer for VNC | foweja | UNIX for Advanced & Expert Users | 1 | 07-14-2005 11:31 AM |
| VNC Timer | foweja | Shell Programming and Scripting | 0 | 07-13-2005 01:25 PM |
| timer | k_oops9 | Shell Programming and Scripting | 3 | 11-08-2004 11:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
|||||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|