K
kris
Hi I have written a program which prints the hostid on a linux system.
The programm uses gethostid() function call which is defined in the
library file unistd.h. But my programm gets compiled without any
warnings even if I didnot include any of the header files.
can I know how does this happen i.e how does the compiler identifies
this function gethostid.
Is there any default path from where the compiler picks up the
definition from.
My application is as follows..
main()
{
long id,hostid;
printf("%ld\n",gethostid());
id = gethostid();
printf("%lu\n",id);
}
output : (I obtain the correct hostid)
I hope I would get a reply soon.
Thanks,
Krish
The programm uses gethostid() function call which is defined in the
library file unistd.h. But my programm gets compiled without any
warnings even if I didnot include any of the header files.
can I know how does this happen i.e how does the compiler identifies
this function gethostid.
Is there any default path from where the compiler picks up the
definition from.
My application is as follows..
main()
{
long id,hostid;
printf("%ld\n",gethostid());
id = gethostid();
printf("%lu\n",id);
}
output : (I obtain the correct hostid)
I hope I would get a reply soon.
Thanks,
Krish