Hello,
I have a problem with getprotobyname()
function.
I wrote a simple program that only uses
getprotobyname function
I can run this program on my development machine
but when I try to run this program on my basic
kernel it gives me the "memory fault" error.
what can I do?
please help,
my program :
#include <netdb.h>
#include <stdio.h>
int main(void){
struct sockaddr_in
addr;
struct protoent
*protocol=NULL;
protocol=getprotobyname("tcp");
printf("\n RESULT : %02x
\n",protocol->p_proto);
return 0;
}
|