clock_settime problem

Greetings,

I am trying to set the system time. I am using clock_settime and I am
passing CLOCK_REALTIME as the clock_id. I get EINVAL as the return value and
errno says “No such process”.

Is this is the correct way of setting the system time? If so, what am I
doing wrong? If not, what is?

Any help is always appreciated.

]{ristoph

]{ristoph <news2@kristoph.net> wrote:

Greetings,

I am trying to set the system time. I am using clock_settime and I am
passing CLOCK_REALTIME as the clock_id. I get EINVAL as the return value and
errno says “No such process”.

Can you post your code? Have you tried it in a small test case?
clock_settime() should only ever return 0 or -1. Do you mean you
get an errno value of EINVAL? Did you check the return value before
looking at errno?

Is this is the correct way of setting the system time?

Yes.

If so, what am I doing wrong?

Hard to tell – don’t know what you’re doing.

-David

QNX Training Services
dagibbs@qnx.com