Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 1998 16:47:31 +1100
From:      "John Saunders" <john.saunders@scitec.com.au>
To:        "FreeBSD current" <freebsd-current@FreeBSD.ORG>
Subject:   RE: inetd: realloc/free bug 
Message-ID:  <002f01be2725$3dab6af0$6cb611cb@saruman.scitec.com.au>
In-Reply-To: <199812110722.AAA00650@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Linux implemented the timeval stomping version of select.  It was the
> first OS to do this.  At the time they claimed that BSD 4.4 would be
> doing this and that they were going to be compatible with that, plus
> it was listed as a bug.  BSD 4.4 came out, and it didn't change this
> part of the interface.  There were boatloads of programs that were
> inexpertly ported to Linux that exhibited cpu eating problems.  Turns
> out that they weren't robust enough to deal with the timeval stomping
> interface.  In time they created a bsd_select, which was what all user
> progams used.  I think it is possible to get the "new" linux behavior,
> but I don't know how.

Actually the Linux version of select checks a bit in the personality
flag called "STICKY_TIMEOUTS". If this flag is set then the timeout
value is not overwritten. Currently only the Sun SPARC port of Linux
sets this bit, at least in Linux 2.0.36 that is. There is a version
of select in libbsd.a which basically copies the timeout to a local
variable and calls the Linux native select. So only the local copy
gets altered leaving the original passed in version intact. You need
to link against libbsd.a to get this behaviour.

Speaking of this, I wonder what FreeBSD when running Linux binaries
under emulation?

Cheers.
--   .   +-------------------------------------------------------+
 ,--_|\  | John Saunders    mailto:John.Saunders@scitec.com.au   |
/  Oz  \ | SCITEC LIMITED   Phone +61294289563  Fax +61294289933 |
\_,--\_/ | "By the time you make ends meet, they move the ends." |
      v  +-------------------------------------------------------+


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002f01be2725$3dab6af0$6cb611cb>