clock.h

Dan Nelson dnelson at allantgroup.com
Mon Feb 28 16:08:04 GMT 2005


In the last episode (Feb 28), Kathy Quinlan said:
> I have this:
> 
> #include <machine/clock.h>
> 
> In program I use this:
> 
> DELAY(1000);
> 
> I get this:
> 
> undefined referance to 'DELAY'
> 
> when I compile the program with GCC with flags -Wall -g -o com main.c

DELAY is a kernel function.  In user processes, just use sleep() or
nanosleep().  When you directly #include <machine/*> headers from
userland, the only useable things are structure definitions and macro
constants (and even then it's recommended that you use a userland
interface instead).  You can't call any of the functions.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list