The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
alternatives of exec() system function Raj Kumar Arora High Level Programming 3 01-03-2008 02:27 AM
ntop/Nmon alternatives satimis Linux 5 12-19-2007 10:25 AM
Unix Sort - Alternatives chprvkmr UNIX for Advanced & Expert Users 1 10-05-2005 11:29 AM
Alternatives to set the system date ?? ulisses0205 UNIX for Advanced & Expert Users 2 04-07-2004 05:43 AM
ASP alternatives Ricki UNIX for Dummies Questions & Answers 3 05-30-2001 06:38 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-16-2006
amitks21 amitks21 is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 2
Alternatives for CLOCK_MONOTONIC

Hi,

I need to develop timeout functionality in my code, which is not affected by system's time changes.Unfortunately I dont have CLOCK_MONOTONIC support in my OS.

Are there any alternatives?
  #2 (permalink)  
Old 11-16-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,807
What options does clock_gettime() support for your system?
  #3 (permalink)  
Old 11-17-2006
amitks21 amitks21 is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 2
it supports only CLOCK_REALTIME
though CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID are defined too in bits/time.h, but clock_gettime() gives an error "Invalid argument" for these...

------from bits/time.h-----
/* Identifier for system-wide realtime clock. */
# define CLOCK_REALTIME 0
/* High-resolution timer from the CPU. */
# define CLOCK_PROCESS_CPUTIME_ID 2
/* Thread-specific CPU-time clock. */
# define CLOCK_THREAD_CPUTIME_ID 3
-----------------------------
  #4 (permalink)  
Old 11-17-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
Just use setitimer()/getitimer().
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 06:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0