3f1f0cc730
go beyond the maximum that the callout mechanism can handle. [See the comments in tvtohz() in subr_sleep.c for the details.] When that happens the timeout is clamped to MAX_INT (ticks), and the code in nanosleep1() looped (or tried to) repeating the sleep (aka kpause()) until the requested end time for the sleep was reached. Unfortunately, the code assumed that kpause() would return 0 when it returned after the timeout expired. But it doesn't, it returns EWOULDBLOCK instead (why is incomprehensible to me, but I assume there is a reason.) [That comes from sleepq_block() which returns EWOULDBLOCK when callout_halt() indicates that the callout had fired, which is exactly what has happened when the time has elapsed.] There was already code to deal with that EWOULDBLOCK and return 0 instead of an error in that case - but it was placed after the error code was tested against 0 for the purposes of the loop. Simply move the EWOULDBLOCK->0 mapping earlier, so the code which is expecting "error == 0" to mean "nothing went wrong" actually gets to see that happen, and the loop can actually loop. (Someday the loop should probably be rewritten as a loop, instead of as a bunch of code followed by a "goto again"!) |
||
---|---|---|
bin | ||
common | ||
compat | ||
crypto | ||
dist/pf | ||
distrib | ||
doc | ||
etc | ||
external | ||
extsrc | ||
games | ||
include | ||
lib | ||
libexec | ||
regress | ||
rescue | ||
sbin | ||
share | ||
sys | ||
tests | ||
tools | ||
usr.bin | ||
usr.sbin | ||
build.sh | ||
BUILDING | ||
Makefile | ||
Makefile.inc | ||
README.md | ||
UPDATING |
NetBSD
NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.
Building
You can cross-build NetBSD from most UNIX-like operating systems. To build for amd64 (x86_64), in the src directory:
./build.sh -U -u -j4 -m amd64 -O ~/obj release
Additional build information available in the BUILDING file.
Binaries
Testing
On a running NetBSD system:
cd /usr/tests; atf-run | atf-report
Troubleshooting
- Send bugs and patches via web form.
- Subscribe to the mailing lists. The netbsd-users list is a good choice for many problems; watch current-users if you follow the bleeding edge of NetBSD-current.
- Join the community IRC channel #netbsd @ freenode.
Latest sources
To fetch the main CVS repository:
cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P src
To work in the Git mirror, which is updated every few hours from CVS:
git clone https://github.com/NetBSD/src.git