<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/bin/sleep, branch jd/simplify-queueing</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/bin/sleep?h=jd%2Fsimplify-queueing</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/bin/sleep?h=jd%2Fsimplify-queueing'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2020-02-25T15:46:15Z</updated>
<entry>
<title>sleep(1): style(9) and other dusting</title>
<updated>2020-02-25T15:46:15Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2020-02-25T15:46:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=cb8c274b68edb6c497032f6e02c7e7e16d0c4d21'/>
<id>urn:sha1:cb8c274b68edb6c497032f6e02c7e7e16d0c4d21</id>
<content type='text'>
- Sort includes alphabetically
- Sort prototypes alphabetically
- Sort stack variables by size
- Add missing braces to the getopt(3) loop
- Be explicit: there is *one* argument, so use argv[0], not *argv
- If nanosleep(2) somehow fails, say that "nanosleep" failed when
  we err(3)
- Remove extra parentheses from the return statement
- De-(void) the obvious fprintf(3) in usage()
- __progname -&gt; getprogname(3)
- POSIX 1003.2 has long since become POSIX.1
- Remove an ARGUSED linter comment
- stdio(3) flushing is not the only potential issue with an exit(3)
  from a signal handler.  Just note that exit(3) isn't safe and leave
  it at that.
</content>
</entry>
<entry>
<title>sleep(1): simplify argument parsing</title>
<updated>2019-07-01T00:01:34Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2019-07-01T00:01:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=b9a47a4d716ec367089b0170151a8dfc1bb9b742'/>
<id>urn:sha1:b9a47a4d716ec367089b0170151a8dfc1bb9b742</id>
<content type='text'>
 - No need for intermediate variables, just build the timespec directly
 - Use for-loops so we modify "cp" on a single line in each loop
 - Parse subseconds with one loop: less code, easier to read, etc.
 - Improve the subsecond parsing comment: make our intent really obvious

ok schwarze@
</content>
</entry>
<entry>
<title>Revert nanosleep(2) loop introduced in v1.25.</title>
<updated>2019-01-10T16:41:10Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2019-01-10T16:41:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=91cd108edb85d77fd5d4e48e97cfe41eab6741f7'/>
<id>urn:sha1:91cd108edb85d77fd5d4e48e97cfe41eab6741f7</id>
<content type='text'>
Now that nanosleep(2) handles the full input range transparently there
is no longer a 100 million second upper bound and we can remove this loop.

ok phessler@ jca@ visa@
</content>
</entry>
<entry>
<title>Print strtonum(3)-style error messages on invalid numeric input.</title>
<updated>2018-02-04T02:18:15Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2018-02-04T02:18:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=9d66e5ee31180c1f9f76b4455b44bcc11007a310'/>
<id>urn:sha1:9d66e5ee31180c1f9f76b4455b44bcc11007a310</id>
<content type='text'>
More informative than the usage message.

While here, no need to return EINVAL: just return 1 if we overflow.

ok jca@ schwarze@
</content>
</entry>
<entry>
<title>Extend range for seconds from 100 million to upper bound of time_t.</title>
<updated>2018-02-02T16:46:37Z</updated>
<author>
<name>cheloha</name>
<email>cheloha@openbsd.org</email>
</author>
<published>2018-02-02T16:46:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=fb81ce644970df72956c71d272e173ea820b5f46'/>
<id>urn:sha1:fb81ce644970df72956c71d272e173ea820b5f46</id>
<content type='text'>
Makes us compliant with POSIX.1-2008, which requires that sleep(1) support
up to 2147483647 seconds.

Bounced off of tb@ and jca@.

ok tb@ millert@ jca@
</content>
</entry>
<entry>
<title>Add, correct, and improve HISTORY sections.</title>
<updated>2016-08-16T18:51:25Z</updated>
<author>
<name>schwarze</name>
<email>schwarze@openbsd.org</email>
</author>
<published>2016-08-16T18:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=b35d111eabce6f1bccb62a83309d55ce6b27430e'/>
<id>urn:sha1:b35d111eabce6f1bccb62a83309d55ce6b27430e</id>
<content type='text'>
From Sevan Janiyan &lt;venture37 at geeklan dot co dot uk&gt;.
Verified using http://minnie.tuhs.org/.
</content>
</entry>
<entry>
<title>Don't return errno from main()</title>
<updated>2015-10-11T20:17:49Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2015-10-11T20:17:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=3c67c8fadd3f740fd13d3cf3ebc87f084a6e2ccd'/>
<id>urn:sha1:3c67c8fadd3f740fd13d3cf3ebc87f084a6e2ccd</id>
<content type='text'>
ok beck@ doug@ deraadt@ tedu@
</content>
</entry>
<entry>
<title>Change all tame callers to namechange to pledge(2).</title>
<updated>2015-10-09T01:37:06Z</updated>
<author>
<name>deraadt</name>
<email>deraadt@openbsd.org</email>
</author>
<published>2015-10-09T01:37:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=0bd1216cbfac4316d823b5f086842b66ddea2018'/>
<id>urn:sha1:0bd1216cbfac4316d823b5f086842b66ddea2018</id>
<content type='text'>
</content>
</entry>
<entry>
<title>So you'd love me to say sleep() can be tighter than tame "stdio".  OK,</title>
<updated>2015-10-03T03:10:38Z</updated>
<author>
<name>deraadt</name>
<email>deraadt@openbsd.org</email>
</author>
<published>2015-10-03T03:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=33d8e5245e0821ea3d82b4533f332f5dc6ec1e92'/>
<id>urn:sha1:33d8e5245e0821ea3d82b4533f332f5dc6ec1e92</id>
<content type='text'>
there is that pesky usage message...  We could tame "something" in the
non-usage codepath.. but pop quiz, anyone know what happens after main
returns or if exit(3) is called?  atexit completion..  our atexit is
very paranoid with structure management and uses mprotect.  So current
minimum a normal program needs is tame "malloc".

tame "stdio" done before the usage codepath splits is just as good;
tame placement before getopt provides a strong hint about program
behaviour.

I am still hoping someone comes up with a nice solution for atexit,
or a nice tame subset between "" (pure computation) and "malloc".
Ideas have been floated to expose "self", but it lacks mprotect also,
and should continue to lack it (see the ssh tame sandbox).
</content>
</entry>
<entry>
<title>sleep doesn't benefit from setting locale. we always want to parse numbers</title>
<updated>2015-09-22T15:37:06Z</updated>
<author>
<name>tedu</name>
<email>tedu@openbsd.org</email>
</author>
<published>2015-09-22T15:37:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=0cb37296597a313449d387ee70ac0dace04b598f'/>
<id>urn:sha1:0cb37296597a313449d387ee70ac0dace04b598f</id>
<content type='text'>
as our forefathers did, and it doesn't print any error messages in need of
translation.
ok stsp
</content>
</entry>
</feed>
