|
Prev: How would I perform a sleep function in a driver?
Next: How to prevent /etc/resolv.conf from modification automatically by ?dhcpagent?
From: John on 1 Feb 2008 13:04 I'm getting the following compiler warning: implicit function declaration: gettimeofday. I have #include <sys/time.h> in my .c file Is there something that I am missing like anohter #include John
From: Tony Curtis on 1 Feb 2008 13:18 John wrote: > I'm getting the following compiler warning: > implicit function declaration: gettimeofday. > > I have > #include <sys/time.h> > in my .c file > > Is there something that I am missing like anohter #include That should be all you need (it's what the man page says). What OS version? What compiler, and version? Can you provide a minimal test program that demonstrates this behaviour? hth t
From: John on 1 Feb 2008 17:34 On Fri, 01 Feb 2008 13:18:41 -0500, Tony Curtis <tony_curtis32(a)yahoo.com> wrote: >John wrote: >> I'm getting the following compiler warning: >> implicit function declaration: gettimeofday. >> >> I have >> #include <sys/time.h> >> in my .c file >> >> Is there something that I am missing like anohter #include > >That should be all you need (it's what the man page says). > >What OS version? What compiler, and version? Can you provide a minimal >test program that demonstrates this behaviour? > >hth >t Solaris 10, newly installed. Don't know what cc version I have. What ever came with Solaris 10. I'm a newbie with Solaris,
From: Ian Collins on 1 Feb 2008 19:01 John wrote: > On Fri, 01 Feb 2008 13:18:41 -0500, Tony Curtis > <tony_curtis32(a)yahoo.com> wrote: > >> John wrote: >>> I'm getting the following compiler warning: >>> implicit function declaration: gettimeofday. >>> >>> I have >>> #include <sys/time.h> >>> in my .c file >>> >>> Is there something that I am missing like anohter #include >> That should be all you need (it's what the man page says). >> >> What OS version? What compiler, and version? Can you provide a minimal >> test program that demonstrates this behaviour? >> >> hth >> t > Solaris 10, newly installed. Don't know what cc version I have. What > ever came with Solaris 10. > There isn't a version of cc supplied with Solaris 10, you must have installed one. Anyway, does this compile cleanly, it should: #include <sys/time.h> int main(void) { struct timeval tp; gettimeofday( &tp , NULL ); } -- Ian Collins.
From: John on 2 Feb 2008 12:53
On Sat, 02 Feb 2008 13:01:36 +1300, Ian Collins <ian-news(a)hotmail.com> wrote: >There isn't a version of cc supplied with Solaris 10, you must have >installed one. Anyway, does this compile cleanly, it should: > >#include <sys/time.h> > >int main(void) >{ > struct timeval tp; > > gettimeofday( &tp , NULL ); >} This did compile with no problems. However, when I added -D_KERNEL, I got the compile warning: implicit function declaration: gettimeofday. Does this mean I shouldn't use gettimeofday in a kernel driver? John |