Commit Graph

20066 Commits

Author SHA1 Message Date
jakllsch 453b641308 Treat aarch64eb the same as aarch64 2020-09-02 16:22:45 +00:00
rillig f76631bc42 stdio(3): fix typos in the manual page
fputc cannot read characters, it can only write them.
2020-08-29 15:25:57 +00:00
christos 93b012cb25 Allow vdprintf to work on non-blocking non-regular files (Rob Newberry) 2020-08-28 22:02:24 +00:00
kre 631837b7c6 When not compiling -DSMALL permit use of names RTMIN[+n] and RTMAX[-n]
(where n is a decimal integer in the range [0 .. SIGRTMAX-SIGRTMIN].
As usual a leading "sig" is ignored and the strings are case independent.

Some implementations do not name the real time signals, and using
labels like RTMIN+3 can be the only way they can be manipulated,
so allow that technique (we still return the RTnn names on the inverse
translation though).

Because this is used by both kill(1) and sh(1) the kill and trap
commands both gain access to the new notation (when !SMALL).
2020-08-20 22:56:56 +00:00
riastradh 25f11de3b9 mmap MAP_FAILED audit. 2020-08-20 15:54:11 +00:00
christos 9630bba2c9 make sure errno is always set when we return -1 (Anon Ymous) 2020-08-18 19:18:06 +00:00
riastradh bdad8b2721 New system call getrandom() compatible with Linux and others.
Three ways to call:

getrandom(p, n, 0)              Blocks at boot until full entropy.
                                Returns up to n bytes at p; guarantees
                                up to 256 bytes even if interrupted
                                after blocking.  getrandom(0,0,0)
                                serves as an entropy barrier: return
                                only after system has full entropy.

getrandom(p, n, GRND_INSECURE)  Never blocks.  Guarantees up to 256
                                bytes even if interrupted.  Equivalent
                                to /dev/urandom.  Safe only after
                                successful getrandom(...,0),
                                getrandom(...,GRND_RANDOM), or read
                                from /dev/random.

getrandom(p, n, GRND_RANDOM)    May block at any time.  Returns up to n
                                bytes at p, but no guarantees about how
                                many -- may return as short as 1 byte.
                                Equivalent to /dev/random.  Legacy.
                                Provided only for source compatibility
                                with Linux.

Can also use flags|GRND_NONBLOCK to fail with EWOULDBLOCK/EAGAIN
without producing any output instead of blocking.

- The combination GRND_INSECURE|GRND_NONBLOCK is the same as
  GRND_INSECURE, since GRND_INSECURE never blocks anyway.

- The combinations GRND_INSECURE|GRND_RANDOM and
  GRND_INSECURE|GRND_RANDOM|GRND_NONBLOCK are nonsensical and fail
  with EINVAL.

As proposed on tech-userlevel, tech-crypto, tech-security, and
tech-kern, and subsequently adopted by core (minus the getentropy part
of the proposal, because other operating systems and participants in
the discussion couldn't come to an agreement about getentropy and
blocking semantics):

https://mail-index.netbsd.org/tech-userlevel/2020/05/02/msg012333.html
2020-08-14 00:53:15 +00:00
uwe 172da20a8e Fix grammar. 2020-07-30 21:23:36 +00:00
christos a5cb7ebb06 this file contained the same information as extattr_namespace_to_string.3
and somewhat incorrect too.
2020-07-26 18:10:00 +00:00
christos 1abb353bae If Unwind_Backtrace is broken, ctx.n will still contain ~0, and we will
return that which poor behavior for the user, so return 0 instead.
We could document ~0 to be an error, but that would deviate from the
Linux behavior which is not desirable. Noted by Poul-Henning Kamp
2020-07-26 15:53:05 +00:00
christos 66a0459ab7 remove duplicate, noted by chuq (this was never used).
perhaps either move extattr.c from generic here, or move the man page
extattr.3 in gen?
2020-07-25 21:53:34 +00:00
msaitoh 984bb2b315 s/reseting/resetting/ 2020-07-22 01:24:39 +00:00
wiz b46ced516b Remove trailing whitespace. 2020-07-17 18:58:11 +00:00
kamil 07e8492e26 Add ppoll() a compatibility wrapper around pollts(2)
Submitted by Apurva Nandan.
2020-07-17 15:34:16 +00:00
uwe ccb2ee4b73 newwin - fix crash with negative ncols.
When support for negative nrows/ncols was added, one s/ncols/maxx/ was
missed so we ended up passing negative (i.e. huge unsigned) length
when hashing the line contents.

Reported by Naman Jain in PR lib/55484
2020-07-14 04:39:39 +00:00
christos 6953eca8c7 Fix numeric variable handling in settc (lyzliyuzhi at 163 dot com) 2020-07-10 20:34:24 +00:00
uwe 70f6ed9ef6 Pads are not to be automatically refreshed on input.
X/Open Curses says in the documentation for newpad():

  Automatic refreshes of pads (e.g., from scrolling or echoing of
  input) do not occur.

And in the documentation for get*():

  If the current or specified window is not a pad, and it has been
  moved or modified since the last refresh operation, then it will be
  refreshed before another character is read.

From Michael Forney in PR lib/55457
2020-07-06 23:33:38 +00:00
uwe f6dea36d0e mvwins*(WINDOW *win, ...) functions - call wins* on win, not stdscr.
From Naman Jain in PR lib/55460.
2020-07-06 22:46:50 +00:00
christos 65c5691e7d revert previous; utmpxname is already documented in getlastlogx.3. Should
probably be moved.
2020-07-05 01:09:48 +00:00
christos 20e726508c document utmpxname(3) 2020-07-05 01:05:50 +00:00
uwe 71a0f0ceb5 wtouchln - verify/clip input parameters
From Naman Jain in PR lib/55454
2020-07-03 23:28:51 +00:00
uwe 939fb589cb setcchar - don't lose combining marks to a typo.
We copy len wchars but set the length field to 1, instead of len.
From Naman Jain in PR lib/55443
2020-07-02 23:43:01 +00:00
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