• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bsd sockets and GCC 4.0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bsd sockets and GCC 4.0


  • Subject: Re: Bsd sockets and GCC 4.0
  • From: Jonas Maebe <email@hidden>
  • Date: Mon, 16 May 2005 23:47:55 +0200


On 16 May 2005, at 23:39, Ryan Lum wrote:

if(bind(s, (struct sockaddr *)&sa, sizeof(sa) < 0)) {

With gcc 3.3 no problems, but it is returning -1 with 4.0. I am no socket
expert, and any debugging advice would help.

Your code has been wrong for 10 years, it should be

if(bind(s, (struct sockaddr *)&sa, sizeof(sa)) < 0) {

You were passing 0 as namelen parameter (since sizeof(sa) > 0). Not sure why this would work with gcc 3 and not with 4 though.


Jonas _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Bsd sockets and GCC 4.0 (From: Ryan Lum <email@hidden>)

  • Prev by Date: Re: Bsd sockets and GCC 4.0
  • Next by Date: /AppleInternal
  • Previous by thread: Re: Bsd sockets and GCC 4.0
  • Next by thread: Fwd: Bsd sockets and GCC 4.0
  • Index(es):
    • Date
    • Thread