Commit Graph

20769 Commits

Author SHA1 Message Date
riastradh 7a407fffcd pthread_atfork(3): Block signals during the call to pthread_atfork.
This doesn't affect the calls to the atfork handlers -- it only
protects access to the lists of handlers from interruption by a
signal, in case the signal handler calls fork(2).
2022-09-13 10:18:47 +00:00
rillig 6c259f3957 fix misspellings of 'available' and nearby typos 2022-09-10 12:14:17 +00:00
gutteridge 9b526a4356 posix_openpt.3: add caveats about oflags
The NetBSD implementation differs from other BSDs in that it does not
return EINVAL if invalid oflags are submitted, since it completely
ignores them. This is surprising to upstream projects that may expect
otherwise.
2022-09-06 22:54:41 +00:00
riastradh cf221fb572 reallocarr(3): Touch up xrefs. 2022-08-31 12:18:41 +00:00
riastradh a2fb076e11 reallocarr(3): Bump date. Note overflow is handled internally. 2022-08-31 12:17:14 +00:00
riastradh 249e1d8c11 reallocarr(3): Clarify semantics. 2022-08-31 12:10:05 +00:00
riastradh b9cd134278 libm: Fix some whitespace issues in recent sincos additions. 2022-08-29 01:48:34 +00:00
he 5eeabc1a3f s_rint.c: weak-alias rintl -> rint for ports without __HAVE_LONG_DOUBLE. 2022-08-28 21:24:09 +00:00
he 41f1db2c7a s_sincos.c: use correct order of __weak_alias() arguments... 2022-08-28 16:07:58 +00:00
he 9be9bcc17d s_sincos.c: use __weak_alias and not __weak_reference.
Fixes build on NetBSD/macppc, thanks to hint from riastradh@
2022-08-28 14:30:41 +00:00
uwe 195a321f00 re_format(7): Use dagger, not double dagger. Make it superscript. 2022-08-28 12:59:50 +00:00
hgutch ec184f3bfb Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).
2022-08-28 10:48:15 +00:00
christos cef006857c only alias sincos to sincosl when we don't have long doubles 2022-08-28 07:29:04 +00:00
christos 861ec30ff2 tuck in k_sincosl.h include inside __HAVE_LONG_DOUBLE 2022-08-27 17:15:52 +00:00
christos ae197994b3 Fix vax build. 2022-08-27 09:56:21 +00:00
christos 5dd94c5e95 Add sincos{,f,l} from FreeBSD 2022-08-27 08:31:58 +00:00
christos 892b77447f sync with FreeBSD; bring some more inline functions. 2022-08-24 13:51:19 +00:00
christos 4fce0f6899 add missing text. 2022-08-24 06:39:14 +00:00
christos cd9dfb0505 Fix argument name 2022-08-23 14:54:50 +00:00
christos d4169749f0 fix whitespace prefix behavior 2022-08-18 11:05:02 +00:00
christos 5346bd151a PR/56967: John Zaitseff: Reduce diff with FreeBSD, fixes various bugs. 2022-08-17 09:32:56 +00:00
christos 8c24072a8b Welcome to tzcode-2022c
Work around a bug in onetrueawk that broke commands like
'make traditional_tarballs' on FreeBSD, macOS, etc.
(Problem reported by Deborah Goldsmith.)

Add code to tzselect that uses experimental structured comments in
zone1970.tab to clarify whether Zones like Africa/Abidjan and
Europe/Istanbul cross continent or ocean boundaries.
(Inspired by a problem reported by Peter Krefting.)

Fix bug with 'zic -d /a/b/c' when /a is unwritable but the
directory /a/b already exists.

Remove zoneinfo2tdf.pl, as it was unused and triggered false
malware alarms on some email servers.
2022-08-16 11:07:40 +00:00
christos 0129e5c6c8 Welcome to 2022b:
zic has a new option '-R @N' to output explicit transitions < N.
(Need suggested by Almaz Mingaleev.)

'zic -r @N' no longer outputs bad data when N < first transition.
(Problem introduced in 2021d and reported by Peter Krefting.)

zic now checks its input for NUL bytes and unterminated lines, and
now supports input line lengths up to 2048 (not 512) bytes.

gmtime and related code now use the abbreviation "UTC" not "GMT".
POSIX is being revised to require this.

When tzset and related functions set vestigial static variables
like tzname, they now prefer specified timestamps to unspecified ones.
(Problem reported by Almaz Mingaleev.)

zic no longer complains "can't determine time zone abbreviation to
use just after until time" when a transition to a new standard
time occurs simultanously with the first DST fallback transition.
2022-08-16 10:56:21 +00:00
wiz 2d37c7f39b clone(2): document that _GNU_SOURCE must be defined for the prototypes 2022-08-01 14:22:32 +00:00
mlelstv d2698c432d Move libisns to /lib to allow /sbin/iscsid to work without /usr being
mounted.
2022-07-31 12:40:35 +00:00
dholland 2301d6e2c4 __quotactl(2): typo. 2022-07-31 06:21:41 +00:00
uwe 56cc39f2d1 mincore(2) - use .Rv -std 2022-07-26 00:25:45 +00:00
riastradh 134b15b0f4 mincore(2): Clarify units of len argument: bytes, not pages.
Minor tidying while here:

- Use .Fa, not .Ar, for function arguments.
- Reduce verbiage of opening sentence.
2022-07-25 22:50:42 +00:00
andvar 6c5bf42769 p2k(3): drop reference to rump_smbfs(8). 2022-07-11 19:24:56 +00:00
andvar a299e6608d fix various typos in comments. 2022-07-06 12:33:41 +00:00
rillig ed7c6fff47 bind.2: add references to specific protocol families
Referring the reader to "the manual entries in section 4" was too
unspecific to be useful, as that section contains device drivers as
well.
2022-06-28 20:24:08 +00:00
rillig f1e042b8d2 fix references in manual pages to the reference documentation 2022-06-28 20:12:52 +00:00
skrll 1120ea0d7a Decorate the HPPA signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2022-06-26 14:37:12 +00:00
skrll 44889fb922 Decode function descriptors (aka plabels) on hppa to fix backtrace.
PR/56881: hppa: backtrace_symbols() delivers bogus results for some dynloaded functions
2022-06-25 06:51:37 +00:00
martin 35a4c156a5 Use "fmadd" to implement fma(3) on ppc. 2022-06-23 16:42:50 +00:00
skrll db40f7209a Oops... fix SYMTAB_DEBUG build 2022-06-23 09:58:25 +00:00
skrll 28227ae2d9 Define and use a DPRINTF macro 2022-06-23 09:53:49 +00:00
skrll d5f19fad45 Trailing whitespace 2022-06-23 09:48:00 +00:00
he 56c7bffc6c libm: build fma(3), fmaf(3), fmal(3) on powerpc.
For now this builds the C version, for completeness, so
that e.g. lang/ocaml can be configured & built.  However,
googling reveals that powerpc does have a "fused multiply add"
instruction, ref.
https://www.ibm.com/docs/en/aix/7.1?topic=set-fmadd-fma-floating-multiply-add-instruction
so this could probably be taken advantage of for a more
optimized version.
2022-06-23 07:50:14 +00:00
skrll f927c76aaf Support ifunc on aarch64. The tests pass at least. 2022-06-21 06:52:17 +00:00
skrll 810da4c4dd Wrap long #if defined(...) || ... and sort. NFCI. 2022-06-21 06:47:37 +00:00
skrll 89e5bb04d9 Trailing whitespace 2022-06-21 06:41:39 +00:00
hannken cefc293e00 Set provider to NULL -- "pam" is not a valid security key helper library.
Now ssh-agent no longer fails key addition with

    error: Cannot add provider: RSA is not an authenticator-hosted key
2022-06-15 08:31:34 +00:00
andvar 36ad50cf2f fix typo in comment: white spae -> whitespace. 2022-06-09 14:02:30 +00:00
christos 712e653ad8 Add method to initialize errinfo so that npfctl does not print random strings. 2022-06-07 16:27:24 +00:00
skrll e59cbf3301 Save and restore %r19 the "linkage table pointer register" across the call
to __cerror so if the ptrace syscall fails we can call __cerror again with
the correct %r19 value.

Do this even though the call of __cerror doesn't go via the PLT because
__cerror calls __errno which does.

Analysis and fix from Tom Lane in

port-hppa/56864: hppa: ptrace(2) dumps core when returning an error

I changed the location of where %r19 is stored on the stack to follow the
ABI.
2022-06-06 06:32:44 +00:00
riastradh e3d96c2fb2 libpthread(3): Fix a marvellous interaction with rtld.
Patch from chs@.  Comment explaining the story by me.  This patch may
not be optimal -- maybe it would be better in pthread__init, or
better for rtld to call _lwp_unpark after _lwp_park in the contened
case -- but we've tested this version and it's annoying to reproduce,
so let's take this version and worry about testing improvements
later.
2022-05-31 14:23:39 +00:00
riastradh 2b5e567d9c libc: Reintroduce getentropy.
This was introduced two years ago when the getrandom/getentropy API
question was still open, and removed because the discussion was
ongoing.  Now getentropy is more widely adopted and soon to be in
POSIX.  So reintroduce the symbol into libc since we'll be keeping it
anyway.  Discussion of details of the semantics, as interpreted by
NetBSD, is ongoing, but the symbol needs to get in before the
netbsd-10 branch.  The draft POSIX text is
(https://www.opengroup.org/austin/docs/austin_1110.pdf):

    SYNOPSIS
        #include <unistd.h>

        int getentropy(void *buffer, size_t length);

    DESCRIPTION
        The getentropy() function shall write length bytes of data
        starting at the location pointed to by buffer. The output
        shall be unpredictable high quality random data, generated by
        a cryptographically secure pseudo-random number
        generator. The maximum permitted value for the length
        argument is given by the {GETENTROPY_MAX} symbolic constant
        defined in <limits.h>.

    RETURN VALUES
        Upon successful completion, getentropy() shall return 0;
        otherwise, -1 shall be retunred and errno set to indicate the
        error.

    ERRORS
        The getentropy() function shall fail if:

        [EINVAL]        The value of length is greater than
                        {GETENTROPY_MAX}.

        The getentropy() function may fail if:

        [ENOSYS]        The system does not provide the necessary
                        source of entropy.

    RATIONALE
        The getentropy() function is not a cancellation point.

Minor changes from the previous introduction of getentropy into libc:

- Return EINVAL, not EIO, on buflen > 256.
- Define GETENTROPY_MAX in limits.h.

The declaration of getentropy in unistd.h and definition of
GETENTROPY_MAX in limits.h are currently conditional on
_NETBSD_SOURCE.  When the next revision of POSIX is finalized, we can
expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this
can be done as a pullup without breaking existing compiled programs.
2022-05-31 13:42:58 +00:00
andvar ff23aff6ad fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
rin 780da3acaa Remove comment-outed garbage. 2022-05-30 15:18:32 +00:00
rin dd3ee07da4 Introduce libc_aligned.so for evbppc-powerpc32, which provides
strictly-aligned versions of memcmp(3), bcopy(3), memcpy(3), and
memmove(3).

This is used for 403 by ld.so.conf with machdep.no_unaligned variable.

With this library, unaligned memory accesses are significantly reduced
for 403 (from several hundreds to few tens per sec under heavy load);
only ld.elf_so (typically few times per fork) and statically-linked
binaries do such access.
2022-05-30 15:06:54 +00:00
rin 2ca271943c Obsolete hack for evbppc to replace memcmp(9), memcpy(9), and memmove(9)
with strictly-aligned versions.

Now all 32-bit powerpc ports share the same libc binary.

This change together with the preceding similar change in libkern slightly
improve performance for DHT (ibm4xx/405GP) and RB800 (MPC8533E).

See changes in bytebench scores:

- DHT	https://gist.github.com/rokuyama/301063355de9733bea515b84ef574c0a
- RB800	https://gist.github.com/rokuyama/60ad665d367d6d110b79ec44707f39ff

Improvements may be negligible, but this does not cause performance
regressions at least.

This hack was for 403, but unaligned memory access is now emulated by
kernel. This should result in serious performance regression for 403.
We will provide strictly-aligned versions by ld.so.conf.
2022-05-30 14:43:37 +00:00
martin c44afc56cf Make it compile again 2022-05-29 12:15:00 +00:00
abs 04799ba54b Avoid null SEGV if libargon passed string with too few $
Seen on netbsd-9 built xscreensaver running on a current system.
Whatever triggered this should also be fixed, but in the meantime
we can improve the behaviour from "Segmentation Fault"
2022-05-29 10:58:09 +00:00
abs e7c718145b Free strdup'd value in libargon decode_option error paths
If its worth freeing in the success path, its worth freeing in the
error path... (given we don't _exit or similar)
2022-05-29 10:51:41 +00:00
andvar 114b022676 fix various typos in comments. 2022-05-28 22:16:43 +00:00
andvar cdc507f0d2 fix various typos in comment, documentation and log messages. 2022-05-24 20:50:17 +00:00
andvar 9f4a9600be fix various typos in comments, docs and log messages. 2022-05-24 06:27:59 +00:00
andvar a657a7c44e s/beggining/beginning/ in comments. 2022-05-23 19:21:30 +00:00
andvar f42f89fd6f fix various small typos, mainly in comments. 2022-05-22 11:27:33 +00:00
charlotte bad55ec264 usbhid.3: hid_parse_usage_in_page() actually returns int 2022-05-22 05:33:46 +00:00
uwe 82b5ace373 curses_input.3: wtimeout() returns void too 2022-05-21 12:34:44 +00:00
charlotte 54e1935b39 curses_input.3: timeout() actually returns void 2022-05-21 06:22:49 +00:00
dholland 049cc88fbf fix typo in sigaction(2) 2022-05-21 01:38:14 +00:00
blymn 7b4e98e7d7 Set the last change pointer after adding a character at the bottom right
of a window.  This fixes the character missing in the LR of a window.
Thanks to uwe@ for pointing this out.
2022-05-19 07:41:26 +00:00
skrll e37a8d9317 Use RAS_{START,END}_ASM_HIDDEN 2022-05-19 07:10:15 +00:00
rillig 84c538f93b curses_input.3: fix argument type for keypad, notimeout, nodelay
There is no type named 'boolf', there's only 'bool'.
2022-05-16 20:09:13 +00:00
andvar a5c1e39951 s/wich/which in comments. 2022-05-15 20:37:50 +00:00
christos d813eb2e76 PR/56838: David A. Holland: namespace pollution in static libcrypt 2022-05-15 16:25:09 +00:00
blymn 6bb8042d10 Make clrtoeol match the ncurses behaviour where it seems to make the
rest of line foreground.  This fixes a display oddity in mutt.
2022-05-12 22:25:38 +00:00
andvar adb5d710d2 fix various typos in comments. 2022-05-11 14:58:00 +00:00
rin b2d5196452 PR lib/56395
PR toolchain/56771

Fix profiling on CPUs that do not support unaligned memory access;
Allocate objects (referenced from struct gmonparam) with proper
alignments.

For monstartup(), objects are allocated on heap. Break is not
guaranteed to be aligned at all, unlike stack pointer.

For _m_gmon_alloc(), objects are allocated on anonymous memory.
p->tos is not aligned properly in general.

This fixes quasi-random crashes for *_profile tests, at least on
SH-4 and PowerPC 403 [1]. Also, no regression is observed for
others as far as I can see.

This change does not cause any ABI breakage, as long as application
uses proper pointers; use p->tos instead of evil pointer arithmetic
like (struct tostruct *)((char *)p->froms + p->fromssize) [2].

[1] Timeout should be increased for some tests. "pic" variants
still fail as expected. Dynamically-linked binaries also crash in
rtld for SH-4, but this seems different problem...

[2] This example did not work even before, since the order of
froms[] and tos[] is reversed depending on which of monstartup() or
_m_gmon_alloc() is used for allocation.
2022-05-06 04:49:13 +00:00
blymn 080c30e83d Don't force the refresh, it doesn't really need it. 2022-05-05 22:02:17 +00:00
blymn a7d2c21606 * Don't redraw the background if the new background character is the
same as the old one.  This prevents excessive redraws in some
   applications.

 * Fix bug introduced when wbkgrndset was fixed, we cannot blindly
   replace any instance of the old background character with the new one
   because some of those characters were put there by the application
   leading to display corruption.  So flag characters as background when
   they are erased and only update the flagged characters when setting
   the background.
2022-05-03 07:25:34 +00:00
blymn dbdfee8ed1 Fix for PR 56243
clear the past EOL flags when moving the cursor - they are no longer
valid as move cannot put the cursor past the EOL.
2022-04-27 22:04:04 +00:00
blymn a63e44ac26 Fix for PR 55517.
Actually us x values to recalculate subwin columns.
2022-04-26 22:40:32 +00:00
hannken 48747c6894 Fix default quota file names, both user and group quota used the
same default name "QUOTAFILENAME, names[USRQUOTA])" resulting in
diagnostic assertion and possibly corrupted quota data.
2022-04-26 15:36:42 +00:00
christos 020fb940f4 fix date -d 12/01/2022, found by Anon Ymous 2022-04-23 13:02:04 +00:00
blymn 881239103e fix for PR 55496
* Fix bkgrndset so that it actually sets the background character in
   in line with the SUSv2 specification.

 * Add an internal function to copy a complex character

 * Make the previously static celleq function into a libcurses private
   function so that it can be called in other files.
2022-04-19 22:26:57 +00:00
rillig 388550b026 lib: remove CONSTCOND comment
Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
2022-04-19 20:32:14 +00:00
andvar f84252b461 fix various typos in comments and log messages. 2022-04-16 18:15:20 +00:00
pgoyette 4c6c48d4bc Fix build (enabled only for MKDEBUG?) 2022-04-13 19:17:09 +00:00
blymn 137544432a Fix compile breakage when wide char support is disabled. 2022-04-12 21:54:16 +00:00
andvar de0a2812df s/sould/should/ and s/shoud/should/ 2022-04-12 21:05:36 +00:00
blymn 301bf8cc44 Make the default colour pair be pair 0 which appears to match other
curses implementations.
2022-04-12 07:03:04 +00:00
tnn 3b1edbf2d8 libedit/chartype.h: portability fix for OSF/1 2022-04-11 19:37:20 +00:00
riastradh 568eb77ef2 pthread: Nix trailing whitespace. 2022-04-10 10:38:33 +00:00
andvar 75d2abaeb1 fix various typos in comments and output/log messages. 2022-04-10 09:50:44 +00:00
riastradh 4f8ce3b31d Introduce membar_acquire/release. Deprecate membar_enter/exit.
The names membar_enter/exit were unclear, and the documentation of
membar_enter has disagreed with the implementations on sparc,
powerpc, and even x86(!) for the entire time it has been in NetBSD.

The terms `acquire' and `release' are ubiquitous in the literature
today, and have been adopted in the C and C++ standards to mean
load-before-load/store and load/store-before-store, respectively,
which are exactly the orderings required by acquiring and releasing a
mutex, as well as other useful applications like decrementing a
reference count and then freeing the underlying object if it went to
zero.

Originally I proposed changing one word in the documentation for
membar_enter to make it load-before-load/store instead of
store-before-load/store, i.e., to make it an acquire barrier.  I
proposed this on the grounds that

(a) all implementations guarantee load-before-load/store,
(b) some implementations fail to guarantee store-before-load/store,
and
(c) all uses in-tree assume load-before-load/store.

I verified parts (a) and (b) (except, for (a), powerpc didn't even
guarantee load-before-load/store -- isync isn't necessarily enough;
need lwsync in general -- but it _almost_ did, and it certainly didn't
guarantee store-before-load/store).

Part (c) might not be correct, however: under the mistaken assumption
that atomic-r/m/w then membar-w/rw is equivalent to atomic-r/m/w then
membar-r/rw, I only audited the cases of membar_enter that _aren't_
immediately after an atomic-r/m/w.  All of those cases assume
load-before-load/store.  But my assumption was wrong -- there are
cases of atomic-r/m/w then membar-w/rw that would be broken by
changing to atomic-r/m/w then membar-r/rw:

https://mail-index.netbsd.org/tech-kern/2022/03/29/msg028044.html

Furthermore, the name membar_enter has been adopted in other places
like OpenBSD where it actually does follow the documentation and
guarantee store-before-load/store, even if that order is not useful.
So the name membar_enter currently lives in a bad place where it
means either of two things -- r/rw or w/rw.

With this change, we deprecate membar_enter/exit, introduce
membar_acquire/release as better names for the useful pair (r/rw and
rw/w), and make sure the implementation of membar_enter guarantees
both what was documented _and_ what was implemented, making it an
alias for membar_sync.

While here, rework all of the membar_* definitions and aliases.  The
new logic follows a rule to make it easier to audit:

	membar_X is defined as an alias for membar_Y iff membar_X is
	guaranteed by membar_Y.

The `no stronger than' relation is (the transitive closure of):

- membar_consumer (r/r) is guaranteed by membar_acquire (r/rw)
- membar_producer (w/w) is guaranteed by membar_release (rw/w)
- membar_acquire (r/rw) is guaranteed by membar_sync (rw/rw)
- membar_release (rw/w) is guaranteed by membar_sync (rw/rw)

And, for the deprecated membars:

- membar_enter (whether r/rw, w/rw, or rw/rw) is guaranteed by
  membar_sync (rw/rw)
- membar_exit (rw/w) is guaranteed by membar_release (rw/w)

(membar_exit is identical to membar_release, but the name is
deprecated.)

Finally, while here, annotate some of the instructions with their
semantics.  For powerpc, leave an essay with citations on the
unfortunate but -- as far as I can tell -- necessary decision to use
lwsync, not isync, for membar_acquire and membar_consumer.

Also add membar(3) and atomic(3) man page links.
2022-04-09 23:32:51 +00:00
christos 6e7f090990 PR/56778: Detlev Casanova: Missing rl_initialize call in rl_copy_text 2022-04-08 20:11:31 +00:00
andvar 146d03e698 s/postion/position/ 2022-04-08 10:27:04 +00:00
andvar 2fa7e14158 fix various typos, mainly in comments, but also log messages, docs, game text. 2022-04-08 10:17:52 +00:00
andvar f5ed5a581a s/psuedo/pseudo/ 2022-04-07 20:23:44 +00:00
andvar e82c4d9bb4 fix various typos, mainly in comments. 2022-04-04 19:33:44 +00:00
christos 4776dc4064 Improve wording to avoid confusion about the return value of {v,}asprintf(3) 2022-04-03 14:17:53 +00:00
gutteridge b9dd3a3166 popen.3: revert s/null-/nul-/ change, this is subject to debate 2022-03-27 00:32:15 +00:00
uwe f560b4a780 __makenew: use calloc to get zeroed memory for window contents.
PR lib/56767.
2022-03-26 16:03:02 +00:00
rillig 8d3736f16d localtime.c: fix theoretical syntax error
If NetBSD were built with -DHAVE_MALLOC_ERRNO=0, the previous code would
have resulted in a compile error due to the extra '}'.  Fix this by
copying the upstream code.

No binary change.
2022-03-25 19:34:04 +00:00
rillig c87b5bf8e3 localtime.c: reduce unnecessary diff to upstream
No binary change.
2022-03-25 19:25:23 +00:00
rillig 3110a48882 localtime.c: take indentation style from upstream
This reduces the diff to upstream.

No binary change.
2022-03-25 19:00:15 +00:00
rillig fdcb92a153 localtime.c: add back storage class 'register'
This reduces the differences to the upstream code.

No binary change.
2022-03-25 18:35:50 +00:00
christos 7c976da19e put back the 2022a changes and fix the misplaced brace. 2022-03-24 16:15:05 +00:00
andvar e394a08199 s/interger/integer/ and s/Compensatin/Compensation/ in comments. 2022-03-24 12:12:00 +00:00
gutteridge 9d5e1357c3 popen.3: minor spelling, grammar, style, and xref tweaks 2022-03-24 01:55:15 +00:00
gutteridge b4afe916c2 fork.2: add _exit(2) xref and spell "ID" consistently 2022-03-24 01:52:48 +00:00
christos 728043b76b revert changes from 2022a for now until I figure out what's wrong. 2022-03-23 14:02:05 +00:00
andvar 43aafb237c fix typos in comments. 2022-03-22 21:45:13 +00:00
christos e1e5793746 welcome to tzcode-2022a
Changes to code

    Fix bug when mktime gets confused by truncated TZif files with
    unspecified local time.  (Problem reported by Almaz Mingaleev.)

    Fix bug when 32-bit time_t code reads malformed 64-bit TZif data.
    (Problem reported by Christos Zoulas.)

    When reading a version 2 or later TZif file, the TZif reader now
    validates the version 1 header and data block only enough to skip
    over them, as recommended by RFC 8536 section 4.  Also, the TZif
    reader no longer mistakenly attempts to parse a version 1 TZIf
    file header as a TZ string.

    zdump -v now outputs "(localtime failed)" and "(gmtime failed)"
    when local time and UT cannot be determined for a timestamp.
2022-03-22 17:48:39 +00:00
dholland f47c379500 setpgid.2: Mention that both child and parent need to call it.
Absence of this standard info was noticed by riastradh@.
2022-03-16 00:50:40 +00:00
riastradh f39c6c80d5 system(3): Simplify initialization of argp. 2022-03-14 22:14:19 +00:00
riastradh fd1bd01dd5 system(3): Switch from vfork/execve to posix_spawn.
Changes by me:
- Minor style nits.
- Set errno on posix_spawn failure.
- Handle edge cases of SIGINT/SIGQUIT set to SIG_IGN by caller.


Author: Nikita Ronja Gillmann <nikita@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
2022-03-14 22:06:28 +00:00
andvar 2532bf9bb5 s/hander/handler/ and s/hader/header/ in comments and documentation. 2022-03-13 17:50:54 +00:00
kre e9fdd3c848 Avoid referencing uninit'd memory. 2022-03-13 01:44:37 +00:00
christos 3249d3dc15 reallocarr returns errno. preserve it. 2022-03-12 17:31:39 +00:00
christos d1647d9c9f Fix filename autocompletion for strings like a\)b
An escaped character should unconditionally be skipped together with the
character that does the escaping. For example, in "a\)b" only the ")b"
part was skipped but then the loop stopped at the "\" since it's one of
the characters listed in word_break. (Piotr P. Stefaniak)
2022-03-12 15:29:17 +00:00
nia 2204e87327 _env: use reallocarr 2022-03-12 08:44:38 +00:00
nia 82fb0af1fa getservent_r: use reallocarr
CVSv ----------------------------------------------------------------------
2022-03-12 08:43:11 +00:00
nia 40b1d7b456 getprotoent_r: use reallocarr 2022-03-12 08:41:38 +00:00
nia a2c387ce35 vfwprintf(3): use reallocarr 2022-03-12 08:36:52 +00:00
nia 6e2ef45a7f setmode(3): use reallocarr instead of realloc(x * y) 2022-03-12 08:32:02 +00:00
nia 639499d824 setmode(3): use reallocarr instead of malloc(x * y) 2022-03-12 08:28:30 +00:00
nia 6876a60007 hcreate(3): use reallocarr instead of malloc(x * y) 2022-03-12 08:26:01 +00:00
christos 3682df8720 Add constrain arguments 2022-02-24 00:26:26 +00:00
andvar 1daa1a7b85 fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.
2022-02-23 21:54:40 +00:00
christos a7c17a0996 PR/56695: Walter Lozano: Correct declaration of hook functions. 2022-02-19 17:45:02 +00:00
riastradh e1fbe5b794 membar_ops(3): xref bus_dma, bus_space in SEE ALSO section too 2022-02-15 22:46:53 +00:00
andvar c45fbc6e3a fix few typos in comments and log message. 2022-02-13 22:20:08 +00:00
pgoyette b88e5267f2 Fix typo 2022-02-13 16:51:56 +00:00
christos 445350982e remove dup assignments (RVP) 2022-02-13 13:32:03 +00:00
riastradh 7adb41074d libpthread: Move namespacing include to top of .c files.
Stuff like libc's namespace.h, or atomic_op_namespace.h, which does
namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint',
has to go at the top of each .c file.  If it goes in the middle, it
might be too late to affect the declarations, and result in compile
errors.

I tripped over this by including <sys/atomic.h> in mips
<machine/lock.h>.

(Maybe we should create a new pthread_namespace.h file for the
purpose, but this'll do for now.)
2022-02-12 14:59:32 +00:00
riastradh 63f70f5223 libpthread: Fix membars around rwlocks.
1. After loading self->pt_rwlocked, membar_enter() must not be
   conditional on PTHREAD__ATOMIC_IS_MEMBAR because there is no
   atomic r/m/w operation here which could imply the acquire barrier.

   (This should maybe just be a load-acquire operation, but we don't
   have atomic_load_acquire in userland at the moment -- TBD.)

2. Before storing thread->pt_rwlocked, must issue membar_exit() so
   that this is a store-release operation -- except if we had just
   done an atomic r/m/w and PTHREAD__ATOMIC_IS_MEMBAR is set, in
   which case it can be elided.

   The second membar_exit() added here might be safely hoisted out of
   the loop but I'm not sure -- needs more analysis to prove that
   would be safe.
2022-02-11 21:40:58 +00:00
rillig 6600de342a libc/getenv: remove trailing whitespace
No binary change.
2022-02-11 21:36:46 +00:00
rillig 657445084f libedit: fix typos, apply KNF to newly imported code (PR/56693)
No binary change.
2022-02-08 21:13:22 +00:00
christos 001f54a461 PR/56693: Walter Lozano: Add support for rl_delete_text and rl_set_key 2022-02-08 15:05:10 +00:00
christos ea988183cf PR/56622: Walter Lozano: Improve readline compatibility by adding
rl_readline_state support.
2022-01-31 14:44:49 +00:00
christos af918e051e Add more refreshes from Walter Lozano. The readline example in
http://www.mcld.co.uk/blog/2009/simple-gnu-readline-callback-style-example.html
still does not work, but it is better.
2022-01-29 20:52:45 +00:00
tnn 64af69d8bc librefuse: default_log_func is __printflike 2022-01-29 00:03:41 +00:00
andvar 7c674e8e6e remove double t from targeted, add missing r to arbitrary
And fix few more typos along the way in comments and man pages.
2022-01-26 11:48:53 +00:00
blymn f1942931a2 Correct (hopefully) the handling of wide characters.
* Remove the WCOL family of macros, these were "stealing" the upper bits
  of a character attribute to store the column width of a character.  No
  warning was given about this in curses.h which meant it was easy to
  accidentally reuse the bits in use by the WCOL macros (we already did).
  Add couple of 16bit ints to the character structure iff HAVE_WCHAR is
  true to hold the display width and wide char related flags (just
  continuation at the moment)
* Convert all instances of WCOL macros to just reference the column width
  in the char structure so it is not obfuscated.
* Fix cursor positioning so placing a cursor in the middle of a wide char
  actually does just that.
* Fix plod so it understands that if the cursor is going to be positioned
  in the middle of a wide char it cannot just reprint the char to get there.
* Fix plodput so it correctly counts the number of output characters for
  wide characters.
* Fix slk routines to properly size the wctomb() buffer.
2022-01-25 03:05:06 +00:00
andvar 492c086f0a s/begining/beginning/ in comments and messages. 2022-01-24 09:14:36 +00:00
rillig 5d27a0722d librefuse: fix lint warnings about void function returning a value
lib/librefuse/refuse_compat.c(155):
    error: void function fuse_unmount cannot return value [213]
lib/librefuse/refuse/v30.c(57):
    error: void function fuse_destroy_v30 cannot return value [213]
2022-01-23 21:07:28 +00:00
pho b2cb7fcce3 Use sysconf(_SC_PAGESIZE) instead of PAGE_SIZE
It broke build on platforms where PAGE_SIZE was not defined in
<machine/vmparam.h>.
2022-01-22 13:25:55 +00:00
pho ec9afb4282 lib/librefuse: Implement all sorts of compat tweaks to appease various file systems
ReFUSE now supports all the FUSE API variants from FUSE 1.1 to FUSE
3.10. Sorry for the freaking giant patch. I could not break it down
any further.
2022-01-22 08:09:39 +00:00
pho a7ce7be0fd Zero-clear the fuse_context in fuse_destroy(3) 2022-01-22 08:07:02 +00:00
pho e9501242bf Add some missing struct fields, structs, and constants that are part of the API 2022-01-22 08:06:21 +00:00
pho d61ee2ebc0 Support the FUSE option -ho
It is supposed to print a help message without the usage
line. Although it is deprecated and has been removed as of FUSE 3.0,
filesystems in the wild still use it.
2022-01-22 08:05:35 +00:00
pho fb59fa675b Implement some missing functions that are part of the API 2022-01-22 08:03:32 +00:00
pho 9733de6685 Correct the wrong prototype of fuse_daemonize(3) while retaining ABI compatibility 2022-01-22 08:02:49 +00:00
pho 8a6bfb22b5 Cosmetic changes 2022-01-22 08:01:50 +00:00
pho a045b4fd1a Change the way how FUSE_*_VERSION are handled
* FUSE_MAKE_VERSION(maj, min) now generates a 3-digits number if the
  version is higher than 3.9. This is needed to support FUSE 3.10 API.

* FUSE_{MAJOR,MINOR}_VERSION no longer have a fixed value but are
  derived from FUSE_USE_VERSION specified by the user code. This is
  needed to support more FUSE filesystems in the wild.
2022-01-22 08:01:12 +00:00