ELDK glibc fcntl(socketFd, F_SETFL, flags) causes Seg Fault

Daniel Ng daniel_ng11 at lycos.com
Thu Feb 1 17:56:43 EST 2007


Hi,

My application Seg Faults when I try to set flags for my socket fd.

First, I get the fd by calling socket():
fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);

Then I try getting the fd flags:
fcntl(fd, F_GETFL, flags)

Then I try setting the flags:
flags |= O_NONBLOCK;
fcntl( fd, F_SETFL, flags );

-I get consistent Seg Faults on the last line above.

-I also checked fd, which is a sensible value. 
I can even successfully connect() with it.

-The problem happens regardless of what value 'flags' is set to


My embedded target details-

-powerpc8272
-ELDK v4
-the application uses glibc


Any ideas why I'm getting these Seg Faults?

Cheers,
Daniel






More information about the Linuxppc-embedded mailing list