linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Christopher Dumoulin" <cdumoulin@ics-ltd.com>
To: <linuxppc-embedded@ozlabs.org>
Subject: RE: ELDK glibc fcntl(socketFd, F_SETFL, flags) causes Seg Fault
Date: Fri, 2 Feb 2007 09:10:37 -0500	[thread overview]
Message-ID: <200702021410.l12EAY18012539@mail3.magma.ca> (raw)
In-Reply-To: <mailman.1565.1170401421.9285.linuxppc-embedded@ozlabs.org>

If that's your exact code, I notice you're not checking if the socket()
call succeeded. You may be calling fcntl with an invalid socket handle.

The first place I'd look is to make sure you've included 'Networking
Support', 'Unix domain sockets', maybe 'TCP/IP networking', and whatever
else you might need, when you configure your kernel.

---------------------------------------------------------------------
Message: 6
Date: Fri, 02 Feb 2007 08:30:18 +0100
From: Wolfgang Denk <wd@denx.de>
Subject: Re: ELDK glibc fcntl(socketFd, F_SETFL, flags) causes Seg
	Fault
To: Daniel Ng <daniel_ng11@lycos.com>
Cc: linuxppc-embedded@ozlabs.org
Message-ID: <20070202073018.C8710352B86@atlas.denx.de>
Content-Type: text/plain; charset=ISO-8859-1

In message <loom.20070201T073939-302@post.gmane.org> you wrote:
> 
> 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)

Provide some working / crashing test code, i. e. a complete C program
with declarations etc.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
There's an old story about the person who wished his computer were as
easy to use as his telephone. That wish has come  true,  since  I  no
longer know how to use my telephone.


------------------------------

_______________________________________________

       reply	other threads:[~2007-02-02 14:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1565.1170401421.9285.linuxppc-embedded@ozlabs.org>
2007-02-02 14:10 ` Christopher Dumoulin [this message]
2007-02-01  6:56 ELDK glibc fcntl(socketFd, F_SETFL, flags) causes Seg Fault Daniel Ng
2007-02-02  7:30 ` Wolfgang Denk
2007-02-05  3:11   ` Daniel Ng
2007-02-02 14:11 ` ELDK glibc fcntl(socketFd,F_SETFL, " Edward Jubenville
2007-02-02 15:03 ` ELDK glibc fcntl(socketFd, F_SETFL, " Magnus Hjorth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200702021410.l12EAY18012539@mail3.magma.ca \
    --to=cdumoulin@ics-ltd.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).