linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* getprotobyname failure
@ 2003-02-25  8:57 Yigit Can
  2003-02-26  0:58 ` Glynn Clements
  0 siblings, 1 reply; 6+ messages in thread
From: Yigit Can @ 2003-02-25  8:57 UTC (permalink / raw)
  To: linux c programming, linux kernel


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=20
but when I try to run this program on my basic kernel it gives me the =
"memory fault" error.

I'm using libc-2.2.5 on a powerpc 8xx development kit
so, i'm using the same library on the host and target machine.

my development machine has celeron  type processor
and my target board is TQM850L (has ppc_850 processor).

I've replaced my protocols and nsswitch.conf files with host machines (my
protocols file contians "tcp 6 TCP" line)
and that's made no difference.

what can I do?
 
please help,
 

 my program :
 
#include <netdb.h>
#include <stdio.h>
 
 int main(void){
 
    struct sockaddr_in addr;
    struct protoent *protocol=3DNULL;
    protocol=3Dgetprotobyname("tcp");
    printf("\n RESULT : %02x \n",protocol->p_proto);
 
    return 0;
}

Yigit CAN
Karel Electronics Corp.
yigit.can@karel.com.tr


^ permalink raw reply	[flat|nested] 6+ messages in thread
* getprotobyname failure
@ 2003-02-26 12:59 Yigit Can
  2003-02-26 13:56 ` Richard B. Johnson
  0 siblings, 1 reply; 6+ messages in thread
From: Yigit Can @ 2003-02-26 12:59 UTC (permalink / raw)
  To: kernelnewbies, linux kernel, linux config, linux c programming

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.

the "getprotobyname" function returns NULL and i don't know the reason,
becouse i have the /etc/protocols file containing "tcp 6 TCP" line

I'm using Denx embedded linux development kit with libc-2.2.5 with an cross
compiler

my development machine has celeron  type processor
and my target board is TQM850L (powerpc 850)

I've replaced my protocols and nsswitch.conf files with host machines (my
protocols file contians "tcp 6 TCP" line)
and that's made no difference.

Why the getprotobyname function returns NULL?

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;
}

Yigit CAN




^ permalink raw reply	[flat|nested] 6+ messages in thread
* getprotobyname failure
@ 2003-02-25  8:34 Yigit Can
  2003-02-25 14:24 ` Jason Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Yigit Can @ 2003-02-25  8:34 UTC (permalink / raw)
  To: linux c programming, linux config, linux kernel





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=20
but when I try to run this program on my basic kernel it gives me the =
"memory fault" error.

I'm using libc-2.2.5 on a powerpc 8xx development kit
so, i'm using the same library on the host and target machine.

my development machine has celeron  type processor
and my target board is TQM850L (has ppc_850 processor).

I've replaced my protocols and nsswitch.conf files with host machines (my
protocols file contians "tcp 6 TCP" line)
and that's made no difference.

what can I do?
 
please help,
 

 my program :
 
 #include <netdb.h>
#include <stdio.h>
 
 int main(void){
 
    struct sockaddr_in addr;
    struct protoent *protocol=3DNULL;
    protocol=3Dgetprotobyname("tcp");
    printf("\n RESULT : %02x \n",protocol->p_proto);
 
    return 0;
}

Yigit CAN
Karel Electronics Corp.
yigit.can@karel.com.tr
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-26 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-25  8:57 getprotobyname failure Yigit Can
2003-02-26  0:58 ` Glynn Clements
  -- strict thread matches above, loose matches on Subject: below --
2003-02-26 12:59 Yigit Can
2003-02-26 13:56 ` Richard B. Johnson
2003-02-25  8:34 Yigit Can
2003-02-25 14:24 ` Jason Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).