Commit Graph

20044 Commits

Author SHA1 Message Date
uwe 1765a45b05 hline, vline - don't lose attributes when using default character.
Make default (wide) and non-wide behavior match.  If the character
argument has (only) attributes set, use them with the default line
character.

In the wide case don't do the fallback in hline - it just calls
hline_set that needs to do it anyway.  Fix the latter to check the
wcwidth of the right character and avoid division by zero.
2020-07-01 02:57:01 +00:00
uwe 4eb5fad78b Oops. Fix y/x typo in the previous whline() fix for !HAVE_WCHAR. 2020-07-01 02:14:41 +00:00
uwe d9a8ae84b1 Fix indentation in the copyright.
Make it match its siblings in other files.
2020-06-30 21:27:18 +00:00
uwe 9c6a61e7ae whline - save/restore the y coordinate too.
Reaching the right side of the screen can cause a line wrap.
Forgot to apply the fix to the !HAVE_WCHAR case.
PR lib/55434
2020-06-30 21:10:13 +00:00
uwe 1eecb61d77 whline_set - save/restore the y coordinate too.
Reaching the right side of the screen can cause a line wrap.
PR lib/55434
2020-06-30 21:02:24 +00:00
wiz b633f84bf0 Remove Xr to extattr(2) which we don't have. 2020-06-28 21:37:05 +00:00
christos 3d58360bad reality check 2020-06-28 18:23:01 +00:00
rin bda9e4fdad Turn on _UC_TLSBASE for sure in the same manner as other ports.
No functional changes since that flag is turned on via getcontext(2).
2020-06-22 06:49:04 +00:00
roy f236a33b97 libterminfo: cast to uint16/32_t before conversion to preserve negativity
Otherwise the ABSENT_NUMERIC(-1) or CANCELLED_NUMERIC(-2) will be converted
incorrectly to size_t and then down to uint16/32_t.
Picked up by DIAGNOSTIC builds.

Thanks to Michael Forney for the fix for PR lib/52293.
2020-06-21 15:05:23 +00:00
wiz 143a74fba3 Remove reference to non-existing extattr(2) and fix two other xrefs. 2020-06-18 19:47:41 +00:00
wiz 1b3734281f Add RCS Id. 2020-06-18 19:46:34 +00:00
kamil aa97815be0 Include explicitly <rump/rump_syscallshotgun.h> for previous indirect users
via <rump/rump.h>.
2020-06-17 00:16:21 +00:00
christos 2f0bfbf344 Rename blacklist -> blocklist 2020-06-15 01:57:29 +00:00
ad 7a60fa0a18 Another bug. The CAS loop in pthread_cond_signal() could race against the
thread it is trying to awake.  The thread could exit the condvar and then
reinsert itself at the head of the list with a new waiter behind it.  It's
likely possible to fix this in a way that's wait-free but for now just fix
the bug.
2020-06-14 21:33:28 +00:00
ad 6088a8599a Don't need to ignore ESRCH from _lwp_park() any more. 2020-06-14 21:31:11 +00:00
riastradh 025a8ce8b7 Nix trailing whitespace. 2020-06-13 17:39:42 +00:00
kamil d8442aacf9 Fix incompatible function pointer casts 2020-06-13 16:51:59 +00:00
fox 113ec9c52a lib/libpam: Fix the possible -Werror=stringop-truncation
Replace strncpy(3) with the safer strlcpy(3) and adjust the code.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@, christos@
2020-06-12 01:20:32 +00:00
ad 30140ed218 Drop self->pt_lock before clearing TSD / malloc TSD. 2020-06-11 18:42:02 +00:00
ad 2b4d53924f Adjust memory barriers. 2020-06-11 18:41:22 +00:00
ad 62e0939e7d - Make pthread_condvar and pthread_mutex work on the stack rather than in
pthread_t, so there's less chance of bad things happening if someone calls
  (for example) pthread_cond_broadcast() from a signal handler.

- Remove all the deferred waiter handling except for the one case that really
  matters which is transferring waiters from condvar -> mutex on wakeup, and
  do that by splicing the condvar's waiters onto the mutex.

- Remove the mutex waiters bit as it's another complication that's not
  strictly needed.
2020-06-10 22:45:15 +00:00
thorpej abcb66ec85 Update for proplib(3) API changes. 2020-06-07 05:54:00 +00:00
ad b81fe3a293 Adjust previous. In the condvar case the wakeup might already have been
eaten.
2020-06-06 22:23:59 +00:00
thorpej a792b8435e Improvements to the problib(3) API:
==> Provide a much more complete set of setters and getters for different
    value types in the prop_array_util(3) and prop_dictionary_util(3)
    functions.

==> Overhaul the prop_data(3), prop_number(3), and prop_string(3) APIs
    to be easier to use and less awkwardly named,  Deprecate the old
    awkward names, and produce link-time warnings when they are referenced.

==> Deprecate mutable prop_data(3) and prop_string(3) objects.  The old
    APIs that support them still exist, but will now produce link-time
    warnings when used.

==> When the new prop_string(3) API is used, strings are internally
    de-duplicated as a memory footprint optimization.

==> Provide a rich set of bounds-checked gettter functions in and a
    corresponding set of convenience setters in the prop_number(3) API.

==> Add a new prop_bool_value(3) function that is equivalent to
    prop_bool_true(3), but aligned with the new "value" routines in
    prop_data(3), prop_string(3), and prop_number(3).
2020-06-06 21:25:59 +00:00
roy c3293770af terminfo(5): Numbre -> Number
Thanks to yukonbob
2020-06-05 22:08:10 +00:00
nia d06dd93f7d Remove more bogus tests for 64-bit i386 and SuperH.
These are always false.
2020-06-05 11:16:15 +00:00
nia 35c066bcd5 getaddrinfo.3: order of the struct members is wrong, correct it 2020-06-04 11:28:00 +00:00
riastradh 0b4833402a Nix trailing whitespace. NFCI. 2020-06-04 04:40:01 +00:00
joerg 558a0c7357 If _malloc_thread_cleanup is implement, call it from libpthread.
Provide the hook from modern jemalloc to avoid using TSD for the thread
destruction cleanup as it can result in reentrancy crashes if fork is
called from a thread that never called malloc as it will result in a
late malloc from the pre-fork synchronisation handler.
2020-06-04 00:45:32 +00:00
ad 051faad4aa Deal with a couple of problems with threads being awoken early due to
timeouts or cancellation where:

- The restarting thread calls _lwp_exit() before another thread gets around
  to waking it with _lwp_unpark(), leading to ESRCH (observed by joerg@).
  (I may have removed a similar check mistakenly over the weekend.)

- The restarting thread considers itself gone off the sleep queue but
  at the same time another thread is part way through waking it, and hasn't
  fully completed that operation yet by setting thread->pt_mutexwait = 0.
  I think that could have potentially lead to the list of waiters getting
  messed up given the right circumstances.
2020-06-03 22:10:24 +00:00
kamil 5d0165c29d timespec_get(3) was developed by myself
Remove FreeBSD from the authorship as it was just a pullup of small
documentation changes.
2020-06-02 19:30:29 +00:00
nia d5d305cc98 Don't suggest removing arc4random with a libc bump.
It's established enough in non-legacy code that this is a terrible idea.
Even if we add getentropy it's not a comparable API (not a userspace RNG
capable of streaming large numbers of bytes, doesn't have _uniform, etc).

"Feel free to remove that line!" - riastradh
2020-06-02 13:56:30 +00:00
joerg b90f380e16 Don't overalign _RuneStatePriv, it must share the alignment of mbstate_t
it aliased with. Assert that the alignment actually used reflects the
alignment required by existing implementation and for newly build
modules assert that it is at most the guaranteed alignment.
2020-06-02 01:30:31 +00:00
joerg 34a4ae727b Pass down errno when calling pthread__errorfunc after a system call.
Allow format arguments for that reason and use (v)snprintf_ss in
pthread_errorfunc to avoid race conditions and the like.
2020-06-02 00:29:53 +00:00
ad 06d492d198 In the interests of reliability simplify waiter handling more and redo
condvars to manage the list of waiters with atomic ops.
2020-06-01 11:44:59 +00:00
christos 58b288d88d use strlcpy() instead of strncpy() for gcc happiness 2020-05-31 23:24:23 +00:00
rin 3a564f248f Add m68k assembler version of __muldi3().
This is intended for 68060:
  - GCC does not emit __muldi3() for 68020-40, that have 32 * 32 --> 64 mulul
  - mulsl (and moveml), used in this code, are not implemented for 68010

In comparison with that from compiler_rt, this version saves:
  - 12% of processing time
  - 12 bytes of stack
  - 50 bytes of code size
Also, slightly faster, memory saving, and smaller than libgcc version.

By examining with evcnt(9), __muldi3() is invoked more than 1000 times per
sec by kernel, which should justify to introduce assembler version of this
function.
2020-05-31 11:43:37 +00:00
roy 877982596a terminfo: test strlcpy result against space free, not string length
riastradh@ yep, looks good.
2020-05-30 16:03:58 +00:00
rmind b899bfd96f Major NPF improvements (merge from upstream):
- Switch to the C11-style atomic primitives using atomic_loadstore(9).

- npfkern: introduce the 'state.key.interface' and 'state.key.direction'
  settings.  Users can now choose whether the connection state should be
  strictly per-interface or global at the configuration level.  Keep NAT
  logic to be always per-interface, though.

- npfkern: rewrite the G/C worker logic and make it self-tuning.

- npfkern and libnpf: multiple bug fixes; add param exporting; introduce
  more parameters.  Remove npf_nvlist_{copyin,copyout}() functions and
  refactor npfctl_load_nvlist() with others; add npfctl_run_op() to have
  a single entry point for operations.  Introduce npf_flow_t and clean up
  some code.

- npfctl: lots of fixes for the 'npfctl show' logic; make 'npfctl list'
  more informative; misc usability improvements and more user-friendly
  error messages.

- Amend and improve the manual pages.
2020-05-30 14:16:56 +00:00
christos c1167da0aa Add pathconf and lpathconf (fixes lib/librumphijack/nfs test which uses ls
which now uses lpathconf)
2020-05-27 18:55:36 +00:00
christos 14c787bcf7 Bring in 2020a 2020-05-25 14:52:48 +00:00
christos 56e4243b76 Add libuv 2020-05-24 19:29:19 +00:00
rin 6ce10d32d6 Fix fallout from NO_STATIC_MODULES -> OPENPAM_STATIC_MODULES changes;
libpam.a fails to load any modules and does not work at all.

At the moment, openpam_load.c at least must be compiled with and without
OPENPAM_STATIC_MODULES for static and shared libraries, respectively.

Therefore, use CSHLIBFLAGS again, in order to build objects for static and
shared libraries separately.

This may be ugly, but seems better for me than adding further hacks in
libpam/libpam/Makefile, which is already complicated enough...
2020-05-23 00:43:33 +00:00
riastradh 59ccc04e14 Teach libc's compat ldexp stub to raise fp exceptions.
This ldexp stub will shadow the ldexp weak alias for scalbn in libm,
which is unfortunate but hard to fix properly without chasing the
mythical libc bump beast.  With the change here, we should raise all
the same exceptions that libm's scalbn does -- overflow, underflow,
inexact-result, and (for signalling NaN only) invalid-operation.
This in turn should correct the missing overflow/underflow exceptions
of our portable C fma, and perhaps other routines.

XXX pullup
2020-05-21 05:56:31 +00:00
ad bc77394ce5 - Try to eliminate a hang in "parked" I've been seeing while stress testing.
Centralise wakeup of deferred waiters in pthread__clear_waiters() and use
  throughout libpthread.  Make fewer assumptions.  Be more conservative in
  pthread_mutex when dealing with pending waiters.

- Remove the "hint" argument everywhere since the kernel doesn't use it any
  more.
2020-05-16 22:53:37 +00:00
christos d18bf24229 bump for ACLS 2020-05-16 18:59:23 +00:00
christos 9aa2a9c323 Add ACL support for FFS. From FreeBSD. 2020-05-16 18:31:45 +00:00
thorpej 74b029050e Avoid pulling in "namespace.h" here, as it can have unintended
effects on consumers of this header.
2020-05-16 16:16:59 +00:00
joerg 7cbd7912a7 Bump libc minor version for malloc lock change 2020-05-15 14:57:33 +00:00
joerg 8409cf4a20 Hook up proper fork lock handling for malloc:
- lock all relevant mutexes just before fork
- unlock all mutexes just after fork in the parent
- full reinit non-spinlocks in the child
This is not using the normal pthread_atfork interface to ensure order of
operation, malloc is used as implementation detail too often.
2020-05-15 14:37:21 +00:00