Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No definition of _SC_CLK_TCK

Tags:

linux

I'm working with a embedded Linux 2.6.36

I need that sequence:

ticksPerSecond=sysconf(_SC_CLK_TCK); // ticks per sec

But I got this error

semLib.c:96: error: '_SC_CLK_TCK' undeclared (first use in this function)
semLib.c:96: error: (Each undeclared identifier is reported only once
semLib.c:96: error: for each function it appears in.)

I didn't find a define of

_SC_CLK_TCK

I found out that it should be in linux/time.h. But it isn't.

like image 607
Manfred Avatar asked Dec 19 '25 03:12

Manfred


1 Answers

Try #include <unistd.h>. It includes the header with this and other definitions.

like image 131
fork0 Avatar answered Dec 20 '25 19:12

fork0