ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hi i want to use a high resolution clock to support my realtime app.
I was using gettimeofday() b4, but now i want to sync time at some machines and now this timebase is no longer a stable one.
So i tried to use not CLOCK_REALTIME and found CLOCK_MONOTONIC.
Had to link librt to my app, compiles fine but :
If i call clock_gettime with clockid CLOCK_MONOTONIC on my target machine, i got a retval of -1, meaning this is not supported by the system.
Running my app with the same kernel on my developing machine, this works quite fine but on the target system (a cyrix C3-2) it just returns -1 !!
Can somebody explain me, why on my cyrix machine it does not work and on a plain P4 desktop it does (with the same (self-compiled) kernel)? Can it be a problem with glibc or really with the hardware ?
I also found out, that on the cyrix, the clock_getres for REALTIME gaves me about 10ms and on the P4 it says about 1ms .....
Does someone know other methods to get a monothonic clock with at least 1ms res ?
Btw, i'm using kernel 2.6.16-16
Last edited by nathan2225; 07-18-2006 at 10:26 AM.
Somehow all the slackware packages (i'm using slackware tgz packages) were compiled with emulated timers, not using the timers offered by the OS.
I tried a debian compiled glibc package and it suddenly worked, hurray !!