Commit Graph

21106 Commits

Author SHA1 Message Date
riastradh 8f27842e48 libm: New s_rintl.S for x86.
Prompted by PR lib/58054.
2024-05-05 02:50:11 +00:00
riastradh ebb5e1cc01 s_rintl.c: Reduce FreeBSD diff and fix on ld128 platforms.
EXT_FRACBITS, the number of bits in the _binary encoding_ that stores
the trailing significand field, is never 113.  In IEEE 754 binary128,
it is 112, even though there are 113 bits of precision in the set of
floating-point numbers -- the leading 1 bit is implicit in binary128.
So ld128 platforms like aarch64 and sparc64 were skipping the real
definition and just defining rintl as an alias for rint, which is
wrong.

In contrast, LDBL_MANT_DIG, the number of bits of precision in the set
of floating-point numbers (p, in IEEE 754 parlance), is 113 in IEEE 754
binary128.  This is also the constant used in FreeBSD libm anyway.  So
let's just use that instead of trying to translate it to our private
EXT_FRACBITS (not defined in FreeBSD) with a fencepos terror.  And
delete the buggy rintl=rint alias.

PR lib/58054
2024-05-04 19:21:51 +00:00
skrll 221640878d Remove magic numbers. NFCI. 2024-05-04 14:48:28 +00:00
skrll be2d38de58 makecontext: correct the type to setup register based arguments.
Use __greg_t rather than int for register based arguments. This fixes
various atf tests.
2024-05-04 12:43:36 +00:00
rillig b108f9c1fe mktemp.3: mkdtemp is no longer nonstandard
Reported by Aleksey Cheusov on tech-userlevel.
2024-05-04 05:50:49 +00:00
rillig 29027db22b parsedate.3: resolve contradictory values for 'next' 2024-05-02 18:34:01 +00:00
christos 81769fc7f9 revert previous. 2024-05-02 14:19:56 +00:00
christos b509c1ea3b next should increement by 1 not 2. 2024-05-01 19:59:07 +00:00
christos 9818b366f5 fix clang lint build. 2024-05-01 18:38:15 +00:00
uwe 2f85358c65 execve(2): brush up markup 2024-04-28 23:10:26 +00:00
rillig 3646cc3155 time.3: clarify that *tloc is always set if tloc != NULL 2024-04-28 22:57:16 +00:00
rillig d1b0f9f059 setmode.3: fix typos 2024-04-28 22:43:30 +00:00
rillig a6f58d652c execve.2: fix typo in markup 2024-04-28 22:21:21 +00:00
jdolecek abcb0737b1 it's nanosleep(2), not nanosleep(3) 2024-04-22 21:25:29 +00:00
jdolecek 2bbb505264 allow usleep(3) with useconds >= 1000000
update manpage to mention this interface is obsolete, remove
EINVAL from the ERRORS and mention EINTR instead.

PR lib/58184 by Taylor R Campbell
2024-04-22 21:02:18 +00:00
skrll fe6348de33 Remove some magic numbers by using genassym.cf 2024-04-20 14:09:40 +00:00
christos 28614955c7 PR/58136: Paul Ripke: Fix use after free. 2024-04-13 02:01:38 +00:00
christos 3bab0f2422 avoid lint warning on the vax 2024-04-11 18:41:03 +00:00
rillig 4ed1e5f144 snprintb.3: provide examples for hexadecimal character escapes
Suggested by uwe@, in reaction to the previous commit, which preferred
octal in the examples. Hexadecimal escapes are more familiar to most
programmers, and the chance of mistaking \x14 for decimal 14 is less
than the chance of mistaking octal \014 for decimal 14.
2024-04-08 21:28:35 +00:00
rillig fca116efc7 snprintb.3: clean up formatting and wording, prefer octal in examples
Using hexadecimal character escapes requires separate string literals if
the description starts with one of the letters A-F; octal character
escapes have at most 3 digits, reducing ambiguity.
2024-04-07 14:28:26 +00:00
rillig 442f4c6c59 snprintb: reject combinations of 'f' with ':' as well as 'F' with '='
These combinations would lead to garbled output.
2024-04-07 12:05:23 +00:00
christos 0c83befa2b update em-toggle-overwrite binding (Xose Vazquez Perez) 2024-04-06 13:36:11 +00:00
christos b395dc204e From Jan-Benedict Glaw:
Use `printf` instead of `echo` for precise output

`man` pages generated under NetBSD and Linux differ as the escape codes
may or may not be interpreted when going through those two chained `echo`es.
Instead just use `printf`, which produces the desired output, always.
2024-04-05 22:30:18 +00:00
christos 6b2da37d70 - Create 3 new variables:
MAKELINKLIB that follows MKLINKLIB but can be overwritten by Makefiles
  MAKESTATICLIB that follows MKSTATICLIB but can be overwritten by Makefiles
  LINKINSTALL that follows MAKELINKLIB but can be overwritten by Makefiles
  These give enough control to the module Makefiles so that they don't need
  to override the default library install rules which break the debug sets.
- Remove /usr/libexec/named which duplicated /usr/lib/named
2024-04-05 01:15:59 +00:00
riastradh 561072c7c1 Temporarily make PR t_sp:sigsafe noisier.
This is an attempt to diagnose why it's flaky in the releng testbeds
but not when I run it.  This change will be backed out once we get
new testbed output.
2024-04-04 21:19:25 +00:00
riastradh 3f29093143 rumpuser(3): New RUMP_STDOUT, RUMP_STDERR environment variables.
If set, then when rump daemonizes, it opens the path in RUMP_STDOUT
and redirects fd 1 to that (which mostly gets the kernel console
output), and opens the path in RUMP_STDERR and redirects fd 2 to that
(no idea what this gets but it's probably good to record if it ever
gets anything).

This will allow tests that rely on rump_server daemons to stash the
output for diagnostics in case, e.g., the rump kernel crashes.

PR bin/58112
2024-04-04 17:27:23 +00:00
riastradh 3e7604f627 i386 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
  => val==0 is unlikely in longjmp

PR lib/57946
2024-04-04 00:46:41 +00:00
riastradh df443a3d17 amd64 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
  => Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
  => val==0 is unlikely in longjmp

PR lib/57946
2024-04-04 00:46:30 +00:00
christos b0c6c15390 remove #include <ieeefp.h> for i386 now that it is included in math_private.h 2024-04-03 18:53:41 +00:00
christos b3579e8037 need <ieeefp.h> for i386. 2024-04-03 14:54:50 +00:00
kre 0e71e5a0d1 For i386, if ft[sg]etprec() are to be used, ensure there's a
prototype for them in scope (so include <ieeefp.h>)

Might fix the i386 build.
2024-04-03 04:40:23 +00:00
christos d89d80aaff reduce diff with FreeBSD 2024-04-03 01:51:01 +00:00
rillig d5bb47fbc4 sparc/fpsetround: fix the nearby signed integer overflow as well
Same as for sparc64 a few days ago.
2024-04-02 20:42:12 +00:00
christos a7add5bb79 fix lint 2024-04-02 20:27:44 +00:00
christos 16095d554f undo accidental commit. 2024-04-02 18:40:50 +00:00
christos 8f219a4edd PR/58054: Martin Husemann: fix bug in expsign extraction and only use the
code for the floating point formats where it works (does not work for 112
bit mantisa in sparc64)
2024-04-02 18:39:51 +00:00
andvar 7f3436c3c9 s/Unfortunatley/Unfortunately/ in comment. 2024-03-30 22:05:07 +00:00
christos 046528e7dc From enh at google dot com in tech-userlevel. Don't limit writes to BUFSIZ,
change the limit to INT_MAX; improves performance dramatically. From:
https://github.com/apple-oss-distributions/Libc/commit/\
c5a3293354e22262702a3add5b2dfc9bb0b93b85\
#diff-3b844a19cfb0aab1a23f7fbc457d3bce7453513730c489a72f66ff89d6557ff3
2024-03-29 22:39:41 +00:00
rillig 7529cf7879 libm/s_logl: suppress lint warnings
Seen on sparc64.
2024-03-26 20:12:47 +00:00
christos 5a13a6eee6 fix insert key (Xose Vazquez Perez) 2024-03-26 18:02:04 +00:00
andvar 132b98a088 Fix few typos in comments. 2024-03-22 19:45:22 +00:00
andvar 4a3e2a8295 s/Cannnot/Cannot/ in error message. 2024-03-22 19:36:56 +00:00
uwe e610bdf867 sysconf(3): a few more markup fixes 2024-03-21 22:27:55 +00:00
uwe 57b3fcda6d sysconf(3): the _SC constants are .Dv 2024-03-21 22:21:40 +00:00
uwe 3b8ede1ce6 sysconf(3): NUL is not a defined variable 2024-03-21 22:17:27 +00:00
uwe afd5650391 sysconf(3): POSIX text doesn't capitalize "option". 2024-03-21 22:14:29 +00:00
wiz 42c4efb6b4 Fix NUL/NULL confusion.
One of these was reported by Mouse in PR 58058.
2024-03-21 14:48:01 +00:00
rillig aabd8f68ba sparc64/fpsetround: avoid shifting into the sign bit
Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.
2024-03-20 06:15:39 +00:00
riastradh eea7d4e0e0 strptime(3): Declare digit d as time_t.
This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code.  And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041
2024-03-18 16:15:24 +00:00
andvar a5c0af2445 Add missing "e" in few words, in comments and one log message. 2024-03-17 21:48:01 +00:00