Commit Graph

21037 Commits

Author SHA1 Message Date
christos 7eace3da0c Add memfd_create(2) from GSoC 2023 by Theodore Preduta 2023-07-10 02:31:54 +00:00
rin 124e9063d8 libm: Add missing fma(3) and friends for sh3. 2023-07-09 03:57:09 +00:00
simonb 2a7583869f Make mstats() decl match prototype so this compiles with -DMSTATS. 2023-07-08 04:09:26 +00:00
riastradh 67e5e79509 select(2), poll(2): Clarify return values. 2023-07-07 01:31:25 +00:00
uwe 5c44d8113a bsdmalloc(3): fix malloc() signature 2023-07-06 01:32:52 +00:00
riastradh d5888fcbdb libbsdmalloc: Use a multiply-overflow that clang supports too.
XXX pullup-10
2023-07-05 22:13:20 +00:00
lukem 0ae90b729a mk.conf(5): document rump variables
Update mk.conf(5) with the rump variables from
- lib/librumpuser/README.compileopts
- sys/rump/README.compileopts

Add cross-references back to mk.conf(5) in those files.

Ensure that the Default: is listed last in a description,
for consistency with the convention in this file.
2023-07-05 16:40:33 +00:00
riastradh 9e6ac21a6f libbsdmalloc: Make aligned_alloc(A, S) actually align when A > S.
XXX pullup-10
2023-07-05 12:08:49 +00:00
riastradh c9e3880ca2 libbsdmalloc: Lift C11 divisibility restriction on aligned_alloc.
Restriction was lifted in C17.

XXX pullup-10
2023-07-05 10:57:44 +00:00
rillig 3cc9538e51 bsdmalloc.3: fix typos in function parameters 2023-07-05 07:13:56 +00:00
riastradh 4651d9e04b libbsdmalloc: Fix build with DEBUG.
Nix __P while here.

XXX pullup-10
2023-07-05 01:15:47 +00:00
riastradh aeee56d1a9 libc: Fix missing membar_consumer in dl_iterate_phdr.
Pairs with the existing membar_producer.

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-07-04 19:24:25 +00:00
riastradh 6c3f4940f3 libbsdmalloc: Nix K&R definitions. Bump WARNS to 3. 2023-07-04 18:40:14 +00:00
riastradh 2daa8bfe20 libbsdmalloc: New man page.
XXX pullup-10
2023-07-04 16:23:15 +00:00
riastradh 77b23e4e0e libbsdmalloc: Bump shlib minor.
New symbols, new minor.

XXX pullup-10
2023-07-04 16:22:10 +00:00
riastradh d95fa52655 libbsdmalloc: Nix trailing whitespace.
No functional change intended.

XXX pullup-10
2023-07-04 15:09:04 +00:00
riastradh d6f78684fe libbsdmalloc: Provide all allocator front ends and fork hooks.
Front ends:

- aligned_alloc
- calloc
- posix_memalign

Fork hooks:

- _malloc_prefork
- _malloc_postfork
- _malloc_postfork_child

Otherwise these will pull in the jemalloc definitions from libc,
which (a) defeats the purpose, and (b) won't work correctly with
fork and threads.

Thanks to kre@ and the thread on tech-userlevel for pointing me in
the right direction to making this actually work to override
jemalloc:

https://mail-index.netbsd.org/tech-userlevel/2023/06/30/msg013957.html

Note: libbsdmalloc doesn't set errno=ENOMEM on malloc failure, but
these front ends do (even aligned_alloc, which is from C11, which
doesn't define ENOMEM at all, but this pacifies our aligned_alloc
tests in t_posix_memalign.c).  Might want to fix that.

XXX pullup-10
2023-07-04 15:08:55 +00:00
riastradh 437cf891b2 getrandom(2): Reduce editorializing tone in man page.
XXX pullup-10
2023-07-02 13:25:52 +00:00
dholland 4d2a6699db libc/shlib_version: note that *rand48* should be punted to libcompat 2023-07-02 00:52:04 +00:00
uwe 31f1ed95bf getentropy(3): use .Sx to xref CAVEATS 2023-06-30 22:15:14 +00:00
riastradh b36d83c44f getrandom(2), getentropy(3): Rework man pages.
Make supportable promises.  Omit needless verbiage.  Give caveats
with cross-references to entropy(7).  Emphasize that security is
necessarily relative to system configuration.

XXX pullup-10
2023-06-30 21:44:22 +00:00
riastradh d378359a95 vis(3): Avoid nonportable MIN in portable code. 2023-06-29 16:11:31 +00:00
msaitoh 37a23ecf39 Fix typo in comment. 2023-06-24 05:18:12 +00:00
wiz c8799c5889 libedit: fix pkg-config to really provide readline directory as intended 2023-06-21 21:44:31 +00:00
wiz c093f0b69f install pkg-config file for libedit
version number matches portable libedit
--cflags output matches portable libedit, since users probably want the
readline interface
2023-06-20 23:09:13 +00:00
riastradh ed4af7289b pam_krb5: Refuse to operate without a key to verify tickets.
New allow_kdc_spoof overrides this to restore previous behaviour
which was vulnerable to KDC spoofing, because without a host or
service key, pam_krb5 can't distinguish the legitimate KDC from a
spoofed one.

This way, having pam_krb5 enabled isn't dangerous even if you create
an empty /etc/krb5.conf to use client SSO without any host services.

Perhaps this should use krb5_verify_init_creds(3) instead, and
thereby respect the rather obscurely named krb5.conf option
verify_ap_req_nofail like the Linux pam_krb5 does, but:

- verify_ap_req_nofail is default-off (i.e., vulnerable by default),
- changing verify_ap_req_nofail to default-on would probably affect
  more things and therefore be riskier,
- allow_kdc_spoof is a much clearer way to spell the idea,
- this patch is a smaller semantic change and thus less risky, and
- a security change with compatibility issues shouldn't have a
  workaround that might introduce potentially worse security issues
  or more compatibility issues.

Perhaps this should use krb5_verify_user(3) with secure=1 instead,
for simplicity, but it's not clear how to do that without first
prompting for the password -- which we shouldn't do at all if we
later decide we won't be able to use it anyway -- and without
repeating a bunch of the logic here anyway to pick the service name.

References about verify_ap_req_nofail:
- mit-krb5 discussion about verify_ap_req_nofail:
  https://mailman.mit.edu/pipermail/krbdev/2011-January/009778.html
- Oracle has the default-secure setting in their krb5 system:
  https://docs.oracle.com/cd/E26505_01/html/E27224/setup-148.html
  https://docs.oracle.com/cd/E26505_01/html/816-5174/krb5.conf-4.html#REFMAN4krb5.conf-4
  https://docs.oracle.com/cd/E19253-01/816-4557/gihyu/
- Heimdal issue on verify_ap_req_nofail default:
  https://github.com/heimdal/heimdal/issues/1129
2023-06-20 22:17:18 +00:00
riastradh f9fe2f8c36 pam_ksu: No need for homedir access. 2023-06-20 22:17:09 +00:00
msaitoh 4e7cd69809 Fix typo. unknwon -> unknown 2023-06-19 08:40:29 +00:00
msaitoh 305f6951ac Fix typo in the document. From FreeBSD. 2023-06-19 08:24:21 +00:00
christos 85e497af98 Include the OpenSSL Makefile fragment so that build_install works on each
OpenSSL subdirectory.
2023-06-17 15:47:31 +00:00
andvar afc0aa83d8 fix typos in comments. 2023-06-16 20:01:20 +00:00
christos a3782680c6 Correct history (Brad Smith) 2023-06-11 15:28:21 +00:00
uwe 1ff3daa17a socket(2): change type flags list back to -tag
On second thought, convert the list of type flags back to -tag, but
don't make it -compact.  This way it's easier to see that it's related
to the list above.
2023-06-08 00:27:34 +00:00
uwe a9c3dfdd0a socket(2): fix macro invocation in a column 2023-06-06 23:31:01 +00:00
uwe eeed5a7d12 socket(2): use "provides" consistently in "type" descriptions 2023-06-06 23:29:16 +00:00
uwe 0c11cebb87 socket(2): use .Bl -column where appropriate 2023-06-06 23:27:15 +00:00
riastradh 9bf974fbd5 socket(2): Move prose list of socket type summaries into a table. 2023-06-06 09:14:27 +00:00
riastradh 98fb5a3b9b socket(2): Tidy up markup a bit.
Use a tag list, not a literal block with hand-formatted text, for
protocols and socket type flags.
2023-06-06 09:10:08 +00:00
lukem 230c41e44c adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}
Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of
the older style more complex expressions.
2023-06-03 21:30:20 +00:00
andvar 11688feb47 fix various typos in comments and messages. 2023-06-03 20:41:44 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
lukem f937c412f3 bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 08:52:53 +00:00
uwe 71118f0693 stat_flags(3): try to improve the descriptions
List all alternative forms recognized by string_to_flags(3).
Both "dump" and "nonodump" are the negative of "nodump".
string_to_flags does not recognize "snap".
Provide xrefs for flag descriptions where applicable.
2023-05-31 21:49:39 +00:00
christos f3bd495543 Fix some const qual (Piotr Pawel Stefaniak) 2023-05-30 11:53:40 +00:00
lukem c1aa87e38c libc: fix typo in comments: NO_SRSC -> NO_SRCS 2023-05-29 18:25:52 +00:00
riastradh 2a673dcfdb libpthread: New pthread__smt_wait to put CPU in low power for spin.
This is now distinct from pthread__smt_pause, which is for spin lock
backoff with no paired wakeup.

On Arm, there is a single-bit event register per CPU, and there are two
instructions to manage it:

- wfe, wait for event -- if event register is clear, enter low power
  mode and wait until event register is set; then exit low power mode
  and clear event register

- sev, signal event -- sets event register on all CPUs (other
  circumstances like interrupts also set the event register and cause
  wfe to wake)

These can be used to reduce the power consumption of spinning for a
lock, but only if they are actually paired -- if there's no sev, wfe
might hang indefinitely.  Currently only pthread_spin(3) actually
pairs them; the other lock primitives (internal lock, mutex, rwlock)
do not -- they have spin lock backoff loops, but no corresponding
wakeup to cancel a wfe.

It may be worthwhile to teach the other lock primitives to pair
wfe/sev, but that requires some performance measurement to verify
it's actually worthwhile.  So for now, we just make sure not to use
wfe when there's no sev, and keep everything else the same -- this
should fix severe performance degredation in libpthread on Arm
without hurting anything else.

No change in the generated code on amd64 and i386.  No change in the
generated code for pthread_spin.c on arm and aarch64 -- changes only
the generated code for pthread_lock.c, pthread_mutex.c, and
pthread_rwlock.c, as intended.

PR port-arm/57437

XXX pullup-10
2023-05-25 14:30:02 +00:00
riastradh 21ee6fc127 libpthread: Use __nothing, not /* nothing */, for empty macros.
No functional change intended -- just safer to do it this way in case
the macros are used in if branches or comma expressions.

PR port-arm/57437 (pthread__smt_pause/wake issue)

XXX pullup-10
2023-05-25 14:29:45 +00:00
skrll d0ff2affc8 Add the compat calls for renamed symbols so that configure scripts
can find them. sigprocmask being the most problematic.

RISC-V doesn't need the compat syscalls, but seeing them fail in
ktrace is helpful.
2023-05-19 06:50:07 +00:00
skrll 6d1cc151b5 No need for double semi-colon
Indent END the same as ENTRY.

NFCI.
2023-05-19 06:41:41 +00:00
skrll 83b9ddad41 KNF 2023-05-19 06:31:01 +00:00
andvar 7bca8c8e2e fix typos in comments. 2023-05-13 11:19:19 +00:00
christos c563a46740 fix cross references (from Anon Ymous) 2023-05-08 01:28:35 +00:00
skrll 75b842b847 RISC-V support that works on QEMU with a single hart.
Thanks for Simon Burge for plic(4).
2023-05-07 12:41:45 +00:00
uwe fadf4dba80 Fix spelling of Kurt Shoens surname.
PR misc/57389
2023-05-04 11:30:25 +00:00
uwe d13ac07234 pthread_create(3): minor markup tweaks 2023-04-29 21:37:07 +00:00
jschauma 9f411f7283 delete spurious space 2023-04-29 20:51:45 +00:00
blymn 3aed864489 Don't set the clear_to_eol variable in doupdate to NULL, this was a
leftover from previous code that makes no sense and makes worms(6)
crash randomly.  Thanks to kre@ for reporting this.
2023-04-28 07:12:39 +00:00
christos 4ee547369c pass lint. 2023-04-25 17:51:32 +00:00
christos 12863d4d79 PR/57376: Jorge Giner: readline file completion does not quote; do the same. 2023-04-24 20:02:53 +00:00
abs 384f6a9e2e Fix incorrect test for FUSE_USE_VERSION 34
(Thanks to Mark Davies for report)
2023-04-21 19:29:31 +00:00
christos ef8fd1897c Align types with readline-8.2 (wiz@) 2023-04-21 14:56:13 +00:00
mlelstv 9d5943131b Fix parsing a locale string with multiple components.
Also check for truncation of a long locale string.
2023-04-16 20:37:59 +00:00
rillig 597c9f09f2 libm: suppress lint warning about '>>' on signed integer
GCC has implementation-defined behavior for that case.
2023-04-10 19:23:02 +00:00
christos c41e469284 PR/57250: Martin Husemann: dtoa mishandles infinite doubles on 32bit big
endian machines. When long double support was added, the old code was kept
for the regular double code. This code was never used because WIDE_DOUBLE
was always defined in the Makefile. Remove that old code, and conditionalize
the WIDE_DOUBLE code based on if long doubles are different than doubles on
the specific platform.
2023-04-04 19:26:06 +00:00
skrll 85c3279dc2 Trailing whitespace 2023-04-02 07:26:17 +00:00
dholland d3728fec90 Fix lying comment. 2023-04-01 23:44:11 +00:00
rillig 5f84f05b9b libkvm: suppress lint warnings about extern declarations for now
This should be properly fixed by someone who is familiar with libkvm, as
it affects <sys/cpu_data.h> as well.
2023-04-01 09:08:11 +00:00
rillig cb5396addb libpuffs: ignore lint warning about nested extern for now
This should be properly fixed by someone familiar with puffs.
2023-03-31 04:51:32 +00:00
rillig b2baa50111 lint: warn about extern declarations outside headers
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
2023-03-28 14:44:34 +00:00
joerg a2c7f636a9 Use snprintf_ss in pthread__assertfunc and update comment in
pthread__errorfunc. snprintf can use locks in some code paths and we
only care about the restricted subset here.
2023-03-24 14:18:18 +00:00
riastradh 40028e8037 libm: Bump minor for new long double transcendental functions.
XXX Still missing: remquol, remainderl.
2023-03-23 12:38:13 +00:00
kre f1eb86a44f Add (newly added): expm1l log1pl log2l lgammal tgammal
so that the library gets the correct symbols defined in it.
2023-03-14 05:49:03 +00:00
riastradh 7739de6469 libm: Need <math.h> for __HAVE_LONG_DOUBLE.
Fixes missing definitions of lrintl, llrintl on various platforms.
2023-03-13 18:26:32 +00:00
riastradh 91f6ee0820 libm: Fill in more dummy long double transcendental functions.
This should cover everything from C99.
2023-03-13 18:18:36 +00:00
thorpej 8ff22ec6c6 Document the error code when O_REGULAR is specified and the last
path component is not a regular file.
2023-03-05 16:24:31 +00:00
riastradh 0670f81a19 mremap(2): Note MAP_REMAPDUP bug.
XXX pullup-10, unless we fix the bug first
2023-03-03 12:53:04 +00:00
riastradh 0119a38611 mremap(2): Fix example to use MAP_PRIVATE.
It is a historical accident that MAP_PRIVATE is assumed when neither
it nor MAP_SHARED is specified.

XXX pullup-9
XXX pullup-10
2023-03-01 20:08:41 +00:00
uwe af2cb705a7 mmap(2): minor markup tweaks 2023-03-01 15:11:28 +00:00
rillig 17359e5a32 hcreate.3: fix typo 2023-02-21 19:27:14 +00:00
gutteridge d6bd763cb8 intro.5: fix typo and grammar and simplify a phrase 2023-02-20 02:05:47 +00:00
andvar 2773222a6c s/chracter/character/ in documentation. 2023-02-13 23:02:27 +00:00
christos 7a0279c013 Remove unused stuff, and limit the scope of some of the used ones.
(from des@freebsd)
2023-02-04 14:34:28 +00:00
christos 3ce4aa662f Add a entry point for the complete function for FreeBSD compatibility with sh. 2023-02-03 22:01:42 +00:00
christos 0428f1e1b1 Don't clear the handle to el "sel" and set it earlier to prevent handling
a signal before the handle is set. (From: des at FreeBSD)
2023-02-03 19:47:38 +00:00
andvar 96dad784b6 fix few typos in comments. 2023-01-31 21:11:24 +00:00
simonb a411c1a557 Note that strchrnul() first appeared in glibc 2.1.1 and appeared in
FreeBSD 10 before it appeared in NetBSD 8.
2023-01-31 01:42:32 +00:00
rillig 2f7da51144 fmtmsg.3: fix typo 2023-01-22 13:38:48 +00:00
riastradh e10add6b30 inet(3): Fix typo in description of size argument.
This is the size of dst, not of src.  The size of src is determined
by the address family.

Fix markup while here: .Fa for function arguments, not .Ar which is
for command arguments.
2023-01-18 23:16:05 +00:00
simonb 1daaca1c6c KNF nit: opening brace of a function on next line. 2023-01-18 08:07:22 +00:00
uwe 3268a4e25e crypt(3): Minor markup tweaks 2023-01-17 14:27:11 +00:00
msaitoh 997fd87f7e s/charater/character/ in comment. 2023-01-17 14:13:48 +00:00
christos e42273ba0d put attributes first for c23 compliance. 2023-01-17 13:18:03 +00:00
riastradh 642ce581b2 crypt(3): Call it password hashing, not `encrypting'.
Tidy up some of the markup while here, and be consistent about
calling the neatly formatted US-ASCII string an `encoded password
hash').
2023-01-17 01:56:43 +00:00
christos 20fbed3887 Apply 9cfe9507fcc22cd4a0c4da486ea1c7f0de6b075f for C23 attribute compliance.
Requested by Jan-Benedict Glaw.
2023-01-15 18:12:37 +00:00
kre b666381035 Add errc() and verrc() to the list of functions which do not return,
but exit() instead.

This was omitted when the *c() set of functions were added in 2014.
2023-01-05 15:13:57 +00:00
nia 4afdaab748 setlocale.3: Reflect state of NetBSD locale support in the 21st century
Don't use LC_COLLATE in a real code example, since a real call to set
LC_COLLATE will fail. Mention this.

Inconsistencies noticed by khw on IRC.
2022-12-31 14:35:56 +00:00
riastradh ddb0a7e7a7 swab(3): Rewrite this to be understandable.
And make the tests work, and exercise all lengths up to 100.

Evidently the previous definition, presumably tightly optimized for
1980s-era compilers and CPUs, was too hard to understand, because it
was incorrectly tested for two decades and broken for years.

PR lib/57141

XXX pullup-8
XXX pullup-9
XXX pullup-10
2022-12-28 15:34:19 +00:00
kre aab5fac668 PR lib/57141 - never decrement len without actually performing a STEP. 2022-12-28 14:32:04 +00:00
wiz eb7b4f7765 Remove unneeded -D_OPENBSD_SOURCE 2022-12-21 17:44:15 +00:00
blymn 0d33635b3c Add more debug so a call to waddbytes can be traced to the caller. 2022-12-21 06:18:01 +00:00
blymn 9c6a0e327d Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label instead of
the default label length because wide characters may make the
actual string length longer than the slk display length.
2022-12-20 04:57:01 +00:00
christos 93664a940b Handle the case the code originally intended to handle; systems where:
SIZE_MAX < PTRDIFF_MAX
2022-12-13 19:08:42 +00:00
skrll e311a492a7 Trailing whitespace 2022-12-13 12:43:32 +00:00
blymn 7c304c7fb1 Default the character width to 1 if wcwidth fails. 2022-12-12 21:14:15 +00:00
christos fa7b09b795 Merge in 2022g:
Although tzcode still works with C89, bugs found in recent routine
    maintenance indicate that bitrot has set in and that in practice
    C89 is no longer used to build tzcode.  As it is a maintenance
    burden, support for C89 is planned to be removed soon.  Instead,
    please use compilers compatible with C99, C11, C17, or C23.

    timegm, which tzcode implemented in 1989, will finally be
    standardized 34 years later as part of C23, so timegm is now
    supported even if STD_INSPIRED is not defined.

    Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone.
    (Problem reported by Đoàn Trần Công Danh.)

    Fix bug in zic on hosts where malloc(0) yields NULL on success.
    (Problem reported by Tim McBrayer for AIX 6.1.)

    Fix zic configuration to avoid linkage failures on some platforms.
    (Problems reported by Gilmore Davidson and Igor Ivanov.)

    Work around MS-Windows nmake incompatibility with POSIX.
    (Problem reported by Manuela Friedrich.)

    Port mktime and strftime to debugging platforms where accessing
    uninitialized data has undefined behavior (strftime problem
    reported by Robert Elz).

    Check more carefully for unlikely integer overflows, preferring
    C23 <stdckdint.h> to overflow checking by hand, as the latter has
    had obscure bugs.
2022-12-11 17:57:23 +00:00
uwe 710059bb9f editrc(5): Markup fixes 2022-12-06 00:59:20 +00:00
uwe 1c9bc64659 getbsize(3): Use .Ev for BLOCKSIZE 2022-12-06 00:13:17 +00:00
blymn 5a712dcba0 Revert previous change, it is not correct. 2022-12-05 21:14:25 +00:00
uwe e8b127922c getnetpath(3): Sprinkle some markup 2022-12-04 23:02:57 +00:00
uwe cfe198168b login_cap(3): Markup fixes 2022-12-04 22:51:43 +00:00
jakllsch 78eb21a033 On VAX, compile gdtoa/misc.c at -O0 to avoid incorrect machine code
resulting in some doubles printing as garbage.
2022-12-04 22:35:15 +00:00
uwe 7440a63dca fcntl(2): Fix wrong markup in a couple of places 2022-12-04 19:01:19 +00:00
skrll 1beb9ce90d Consistently use the 'mv' instrucation (which is itself an alias) instead
of the (old) alternative alias 'move'.
2022-12-04 17:04:06 +00:00
uwe 495edbf836 re_format(7): Add subsection headings for ERE and BRE
The first paragraph could use some rewording.  While BRE may be
obsolete, it's still the default for regcomp(3) and the default for
grep(1), sed(1), etc.
2022-12-04 16:52:48 +00:00
uwe eff611cf1c Bump date for the fixed RETURN VALUES in previous 2022-12-04 16:21:54 +00:00
uwe 15c5c5f472 Tweak markup in _lwp_*(2) manual pages
Use .Rv where possible.  Some manual pages claimed that the error "is
returned", but RTFS and some quick testing indicate that this is wrong.

The commit message from 2003 says that:

  Note our current implementation mis-matches [man pages] slightly
  (error codes are stuffed into errno, where they should simply be
  returned by these calls).  This will be addressed shortly.

That hasn't happened in the 20 years, so we might as well make the man
pages reflect the reality.
2022-12-04 16:17:50 +00:00
uwe 49e10846a6 lib: Mark up error names in man pages with .Er 2022-12-04 11:25:08 +00:00
uwe 27e8188424 flock(2): s/Eq/Er/ typo in the ERRORS section 2022-12-04 11:18:58 +00:00
uwe 4562d402f9 pw_init(3): Use .Ev for EDITOR 2022-12-04 11:16:39 +00:00
uwe e6fc3c59c2 Sections 2 and 3 have RETURN VALUES, not DIAGNOSTICS 2022-12-04 01:29:31 +00:00
uwe 254727163e getservent(3): Section 3 has RETURN VALUES, not DIAGNOSTICS
While here, don't claim that null pointer is zero.

We should probably just pick the wording from POSIX, but that yak is a
bit too big for me to shave at the moment.
2022-12-04 00:13:11 +00:00
jschauma 4556c7b6e8 reference /var/db/services.cdb / services_mkdb(8) 2022-12-03 23:55:52 +00:00
skrll ea00852af2 Trailing whitespace 2022-12-03 14:04:39 +00:00
skrll 7893424154 Trailing whitespace 2022-12-03 09:38:53 +00:00
christos 86e4c4a8e3 PR/57095: Yilei Yang: Change readline's replace_history_entry to not make a copy
of the string to replace since H_REPLACE already makes a copy (fixes memory leak)
2022-12-02 19:23:15 +00:00
blymn dabdb153f2 When performing a scroll, check the last line of the region is the same
on virtscr and curscr because the indexes past are supposed to be
one *past* the last matching line (they may actually match if the line is
at the bottom of the screen).  Iff they don't match reduce the scroll
region size by one so we don't scroll non-matching lines, also check
if the region is then 0 after the decrement and just return if it was.
2022-11-30 06:19:15 +00:00
skrll d2296b0783 Trailing whitespace 2022-11-30 04:35:53 +00:00
uwe f90210105d socketpair(2): Formatting nits 2022-11-29 20:50:37 +00:00
jschauma 12d9662bb2 document the only supported type protocol, document type flags
This uses language taken from OpenBSD's manual page.
2022-11-29 20:26:39 +00:00
gutteridge d671eab624 reallocarray.3: minor grammar and style tweaks 2022-11-27 20:17:20 +00:00
christos ecbe1e9db9 fix vax build 2022-11-23 18:15:43 +00:00
rin 35e09a8af5 Correct path for libm. 2022-11-22 15:41:04 +00:00
christos ae082add65 lua libm API from Phil Rulon 2022-11-21 22:01:32 +00:00
jakllsch cd0fbe0b1b Simply set HAVE_GETRANDOM to false on __APPLE__.
Addresses PR 57083.
2022-11-17 17:35:25 +00:00
christos cd2e09c9fd PR/57083: Jiaxun Yang: Fix build on MacOS/X which has <sys/random.h> but no
getrandom(3).
2022-11-16 19:38:08 +00:00
gutteridge 7eadd4d371 posix_openpt.3: add a history section 2022-11-15 22:17:53 +00:00
gutteridge 03e840b8d3 closefrom.3: add a history section 2022-11-10 00:47:01 +00:00
blymn b34dd075af Count character widths not number of bytes when calculating number
of characters to add.  Fixes an error detected by slk tests where
a label containing wide characters was not correctly printed.
2022-11-07 21:18:49 +00:00
riastradh 3ead30d6ad regerror(3): Allow null errbuf if errbuf_size is zero.
The man page says:

   If errbuf_size is 0, errbuf is ignored but the return value is still
   correct.

POSIX says:

   If errbuf_size is 0, regerror() shall ignore the errbuf argument,
   and return the size of the buffer needed to hold the generated
   string.

   https://pubs.opengroup.org/onlinepubs/9699919799/functions/regerror.html

from enh@google.com
2022-11-05 11:33:55 +00:00
blymn 2cc268f92c PR bin/57072
This fixes observed behviour in the PR.  Allow the cursor to be
moved one past the EOL, if postitioned here then set ISPASTEOL.
also protect out of range access if win->cury is past maxy.
2022-11-04 06:12:22 +00:00
andvar daa7d68ea3 fix various typos in comments and messages. 2022-11-02 20:38:21 +00:00
christos 9acefc396c Cleaner to use if/then/else rather than a ton of casts in the ternary operator. 2022-11-02 12:49:10 +00:00
christos 21a4b1ccc3 improvements in malloc/free handling. 2022-10-30 19:11:31 +00:00
christos 1e7378f887 Update to tzcode2022f
Changes to code

    zic now supports links to links regardless of input line order.
    For example, if Australia/Sydney is a Zone, the lines
      Link Australia/Canberra Australia/ACT
      Link Australia/Sydney Australia/Canberra
    now work correctly, even though the shell commands
      ln Australia/Canberra Australia/ACT
      ln Australia/Sydney Australia/Canberra
    would fail because the first command attempts to use a link
    Australia/Canberra that does not exist until after the second
    command is executed.  Previously, zic had unspecified behavior if
    a Link line's target was another link, and zic often misbehaved if
    a Link line's target was a later Link line.

    Fix line number in zic's diagnostic for a link to a link.

    Fix a bug that caused localtime to mishandle timestamps starting
    in the year 2438 when reading data generated by 'zic -b fat' when
    distant-future DST transitions occur at times given in standard
    time or in UT, not the usual case of local time.  This occurs when
    the corresponding .zi Rule lines specify DST transitions with TO
    columns of 'max' and AT columns that end in 's' or 'u'.  The
    number 2438 comes from the 32-bit limit in the year 2038, plus the
    400-year Gregorian cycle.  (Problem reported by Bradley White.)

    On glibc 2.34 and later, which optionally supports 64-bit time_t
    on platforms like x86 where time_t was traditionally 32 bits,
    default time_t to 64 instead of 32 bits.  This lets functions like
    localtime support timestamps after the year 2038, and fixes
    year-2038 problems in zic when accessing files dated after 2038.
    To continue to limit time_t to 32 bits on these platforms, use
    "make CFLAGS='-D_TIME_BITS=32'".

    In C code, do not enable large-file support on platforms like AIX
    and macOS that no longer need it now that tzcode does not use
    off_t or related functions like 'stat'.  Large-file support is
    still enabled by default on GNU/Linux, as it is needed for 64-bit
    time_t support.

    In C code, prefer C23 keywords to pre-C23 macros for alignof,
    bool, false, and true.  Also, use the following C23 features if
    available: __has_include, unreachable.

    zic no longer works around Qt bug 53071, as the relevant Qt
    releases have been out of support since 2019.  This change affects
    only fat TZif files, as thin files never had the workaround.

    zdump no longer modifies the environ vector when compiled on
    platforms lacking tm_zone or when compiled with -DUSE_LTZ=0.
    This avoid undefined behavior on POSIX platforms.
2022-10-29 13:55:50 +00:00
wiz dd8db24513 put reallocarray() in the public namespace
reallocarray() will be part of the next POSIX release, see
https://austingroupbugs.net/view.php?id=1218

adapt an errno value to match POSIX expectations

As discussed on tech-userlevel
2022-10-28 09:43:58 +00:00
jschauma 14ecc37828 rephrase / clarify explanation of struct tm member normalization 2022-10-26 23:22:54 +00:00
andvar a5139dfcb4 fix RCSID. 2022-10-26 22:13:09 +00:00
andvar 730fdfa601 nix double n, i or g in "ing", in comments and documentation. 2022-10-26 22:09:37 +00:00
kre c24fd5a773 Fix a merge or conversion problem (probably) - a .SH BUGS
(meaningless macro in mdoc) followed by the first line of the
real BUGS section somehow ended up inserted after the first
word of the STANDARDS section.   Delete the noise.
2022-10-25 08:07:07 +00:00
blymn 4b1b7fd71d Fix for lib/57050
Perform a sanity check on the window parameter being passed and return
ERR if it is null.  This prevents buggy code crashing.
2022-10-25 06:20:01 +00:00
uwe d6f32aceab strptime(3): make the fact that %z is an extension more prominent
Mention it near the format itself, not on the next screen (with an
awkward indentation too).
2022-10-24 23:18:31 +00:00
uwe 69afa679ca ctime(3): fix unbalanced paren introduced in 1.40 2022-10-21 12:28:43 +00:00
uwe 2d856f24b1 ctime(3): add missing leading slash in a pathname 2022-10-21 12:11:29 +00:00
jschauma 1f27523029 escape mathematical minus so it doesn't get rendered as a dash 2022-10-21 03:08:29 +00:00
jschauma 61d8e1efc0 Note normalizing behavior of mktime(3) using language from FreeBSD. 2022-10-21 03:05:15 +00:00
blymn ee6c5161ec Fixes for lib/56926 amongst other things:
- plod now correctly accounts for wide characters when plodding
 - use erase line when in color mode if the terminal has the capability
 - ensure that the CA_CONTINUATION flag is applied consistently to the
   subsequent characters in a wide character.
 - fix a bunch of refresh bugs that caused inconsistent placement of
   wide characters.
2022-10-19 06:09:27 +00:00
wiz 134c7dc5fa avoid unnecessary Ns macro 2022-10-18 07:33:15 +00:00
jschauma 76a83e03a4 Note that the exit status may be truncated to the least significant 8 bits. 2022-10-18 02:31:39 +00:00
jschauma 746cfcb9c7 add missing 'the' 2022-10-17 18:41:06 +00:00
christos ec56256fb3 Add EINVAL doc from Jan Schaumann 2022-10-16 20:37:03 +00:00
christos 48575108a6 update to 2022e; no real changes 2022-10-15 18:57:37 +00:00
nia 934ddb935f libc: Use a functional example when warning about incorrect alloca usage 2022-10-08 12:56:51 +00:00
ryo 9da1e81cea fix fixPR/57046. inet_network(3) returns INADDR_NONE when network names such as /x[0-9a-f][0-9a-f]/. 2022-10-06 06:03:06 +00:00
nia c47c40fb8b libc: switch aarch64 to use softfloat functions from compiler_rt
The old definitions in qp.c being all grouped together in one file
causes problems when static linking with libgcc (i.e. cc --static-libgcc)
due to functions like __trunctfdf2 conflicting with libgcc, as seen in
PR 57021

We can also add some missing functions like __fixdfti for converting
a double to an int128_t, the lack of which is currently preventing webkit
from linking on aarch64, as seen in PR 57022

Unclear to me if libc is the right place for these functions, but
we can avoid breaking compatibility right now and maintain the status
quo while avoiding some obvious immediate problems.
nm output for libc shows no functions being removed by this change.
2022-10-05 10:28:19 +00:00
gutteridge 5568d804e3 posix_openpt.3: reflect changes from r. 1.45 of tty_ptm.c 2022-10-04 01:46:18 +00:00
gutteridge e3b627187d posix_openpt.3: reflect flag changes from r. 1.44 of tty_ptm.c
Some flags are now accepted, others are still ignored. (E.g., other
BSDs would return EINVAL if O_RDWR wasn't passed, and we now accept
O_NONBLOCK but not O_CLOEXEC.)
2022-09-28 00:35:47 +00:00
christos 22153c41fd PR/57016: Ricky Zhou: declare lastidx 2022-09-21 01:33:53 +00:00
christos 8aa8c3f154 PR/57016: Ricky Zhou: Revert to trimming the last newline instead of the
first one so that multi-line commands work again.
2022-09-20 23:41:14 +00:00
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