nanosleep() replacement

Darren Tucker dtucker at
Mon Mar 17 19:32:45 EST 2003

Tim Rice wrote:
> I put together a nanosleep() for systems without it.
> Please review/test before I commit.

I can confirm that this works on Solaris 8 (configured without librt,
which is where nanosleep is), however it doesn't seem to cope well with
the lower limits.  Is this an unavoidable consequence of the lesser
precision of select?

For comparison here's what I got from:
$ scp -l [limit] -o Compression=no openssh-3.5p1.tar.gz localhost:/tmp

limit	nanosleep	select/bsd-misc
1	1		30
8	8		48
64	64		66
128	129		130
256	255		255
(all kbits/sec, calculated from kbytes/sec reported by scp)

One other thought: since lots of things (including scp) use ssh as a
transport, and bandwidth limiting is more a transport layer function,
shouldn't bandwidth limiting be a function of ssh not scp?

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

More information about the openssh-unix-dev mailing list