MFC:

r158812 (ache):

Reflect size_t changes in glob.h

Obtained from: NetBSD (mostly)

r159294:

 - ANSIfy.
 - Remove two unnecessary casts.

r243779 (marcel):

Protect against DoS attacks, such as being described in CVE-2010-2632.
The changes were derived from what has been committed to NetBSD, with
modifications.

This fixes FreeBSD-SA-13:02.libc for stable/6.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/6@247126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r239672 (by rrs):
  This small change takes care of a race condition
  that can occur when both sides close at the same time.
  If that occurs, without this fix the connection enters
  FIN1 on both sides and they will forever send FIN|ACK at
  each other until the connection times out. This is because
  we stopped processing the FIN|ACK and thus did not advance
  the sequence and so never ACK'd each others FIN. This
  fix adjusts it so we *do* process the FIN properly and
  the race goes away ;-)

Approved by:	emaste (co-mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/6@247136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r247334:

Correct a typo introduced in r153575, which gives inverted logic when
handling blocking semantics when seeding.

PR:		kern/143298
Submitted by:	James Juran <james juran baesystems com>
Reviewed by:	markm


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/6@247511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f