In article <[EMAIL PROTECTED]>,
Matt Dillon  <[EMAIL PROTECTED]> wrote:

>     Nobody in their right mind uses a struct sockaddr_in or any other 
>     struct sock* type of structure without zeroing it first.

That's definitely true in reality, but I'm not sure it's a desirable
situation.  It runs counter to what POSIX generally requires.  For
example, if you use sigaction() you only have to set the struct
sigaction members that are documented in the spec, even though the
structure may have additional members on some platforms.  In POSIX the
rule is generally that you don't have to set any extra members unless
an additional non-standard flag is set (e.g., in sa_flags) indicating
that the member is valid.

On the other hand (now arguing against myself), I guess by setting
sin_len = sizeof(struct sockaddr_in) one is saying that the entire
structure is valid, including sin_zero.  *Grumble* I wish they had
never put the sin_zero member in there in the first place.

John
-- 
  John Polstra
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Disappointment is a good sign of basic intelligence."  -- Ch�gyam Trungpa


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to