Commit Graph

1788 Commits

Author SHA1 Message Date
msaitoh f6e78d1295 Fix previous comment fix.
It seems that the work "yppush" was not duplicated.
It was two sentences without period. To make it clear,
add a colon and a newline. Found by rillig@.
2024-05-30 03:33:31 +00:00
christos 679926ade6 Rename dup3110 to dup3100 to match historical practice for NetBSD-11,
because we already have kevent100. Fix compat_dup3 to belong in compat_100
not compat_110.
2024-05-20 01:30:33 +00:00
christos 381b1356d0 version dup3 2024-05-19 22:25:47 +00:00
msaitoh c6dd4e7860 Remove duplicated yppush. 2024-05-12 23:57:11 +00:00
rillig e886a84233 include/bitstring.h: remove CONSTCOND comment from do-while-0 loop
Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.

sed -Ei 's,} *while *\(/\* *CONSTCOND *\*/ *0\),} while (0),' *.h
2024-05-12 10:41:23 +00:00
riastradh af6c922c55 math.h: Move declarations under appropriate namespace tests.
Not sure about _REENTRANT, but if gamma_r and lgamma_r go under that
(even if _NETBSD_SOURCE isn't defined), then lgammal_r probably
should too.
2024-05-07 15:17:35 +00:00
christos f22d611322 Sync with tzcode2024a:
Release 2024a - 2024-02-01 09:28:56 -0800

  Changes to code

    The FROM and TO columns of Rule lines can no longer be "minimum"
    or an abbreviation of "minimum", because TZif files do not support
    DST rules that extend into the indefinite past - although these
    rules were supported when TZif files had only 32-bit data, this
    stopped working when 64-bit TZif files were introduced in 1995.
    This should not be a problem for realistic data, since DST was
    first used in the 20th century.  As a transition aid, FROM columns
    like "minimum" are now diagnosed and then treated as if they were
    the year 1900; this should suffice for TZif files on old systems
    with only 32-bit time_t, and it is more compatible with bugs in
    2023c-and-earlier localtime.c.  (Problem reported by Yoshito
    Umaoka.)

    localtime and related functions no longer mishandle some
    timestamps that occur about 400 years after a switch to a time
    zone with a DST schedule.  In 2023d data this problem was visible
    for some timestamps in November 2422, November 2822, etc. in
    America/Ciudad_Juarez.  (Problem reported by Gilmore Davidson.)

    strftime %s now uses tm_gmtoff if available.  (Problem and draft
    patch reported by Dag-Erling Smørgrav.)

  Changes to build procedure

    The leap-seconds.list file is now copied from the IERS instead of
    from its downstream counterpart at NIST, as the IERS version is
    now in the public domain too and tends to be more up-to-date.
    (Thanks to Martin Burnicki for liaisoning with the IERS.)

  Changes to documentation

    The strftime man page documents which struct tm members affect
    which conversion specs, and that tzset is called.  (Problems
    reported by Robert Elz and Steve Summit.)
2024-02-17 14:54:47 +00:00
jkoshy fbaf967b8e Note that the NI_WITHSCOPEID flag is obsolete. 2024-02-16 11:13:59 +00:00
andvar 82bba4e936 fix various typos in comments. 2024-02-05 21:46:04 +00:00
kre 86010b4a4e It seems that we need prototypes for long double math functions, even
when !__HAVE_LONG_DOUBLE -- they still exist, but just aren't...

This might unbreak several more builds.
2024-01-22 14:01:50 +00:00
kre 1bb3b9e157 This set of changes seem to be sufficient to make at least the
amd64 port build again after the long double math function infusion
from yesterday.

Feel free (without consulting me, I'm just hacking about) to revert
any of this and do it a better way.

Note: this is not intended to be complete, in particular, in <math.h>
I added prototypes only for the functions that are needed for a
successful build, not all of the new ones...
2024-01-22 12:15:19 +00:00
christos e4473f945c Add missing decls 2024-01-19 18:40:35 +00:00
andvar 5e4abe6a3f fix triple s typos in comments. 2023-12-08 21:46:02 +00:00
christos 04bc78e580 Allow __ssp_inline to be overriden 2023-11-15 03:14:16 +00:00
christos 8cbc788f24 PR/57689: RVP: getcwd() not overridable with -D_FORTIFY_SOURCE 2023-11-10 23:03:25 +00:00
christos 69d0628a4c sync with tzcode 2023c 2023-09-16 18:19:30 +00:00
rillig ac66081df5 assert.h: remove custom macro definitions for lint mode
In lint mode, 'assert(cond)' expanded to nothing.  This broke code like
sqlite that assumes 'assert(cond)' expands to an expression that can be
used as operand of the comma operator, as in 'return assert(i > 0), i'.
2023-09-12 22:08:24 +00:00
rillig 662b4a85ad time.h: fix typo in comment 2023-08-19 08:54:36 +00:00
riastradh 72254be91c cdbw(3): Make cdbw_output descr parameter type less confusing.
This is a string of _up to_ 16 bytes, used with strncpy(..., 16).
Specifying `const char descr[16]', while formally equivalent to
`const char *descr' in standard C, now provokes the ire of gcc when
the caller does not provide a buffer of at least 16 bytes.
2023-08-08 10:34:08 +00:00
christos b515b5959a Add companion mempcpy to wmempcpy, bump. 2023-08-01 17:51:24 +00:00
mrg f8570f8a97 fix simple mis-matched function prototype and definitions.
most of these are like, eg

   void foo(int[2]);

with either of these

   void foo(int*) { ... }
   void foo(int[]) { ... }

in some cases (such as stat or utimes* calls found in our header files),
we now match standard definition from opengroup.

found by GCC 12.
2023-08-01 07:04:14 +00:00
christos 6a8ddfc018 new gdb needs wmempcpy, give it to it. 2023-07-31 17:38:28 +00:00
andvar eb8ea79cc8 s/configuratin/configuration/ in comment, from Brad Harder (bch) by email. 2023-05-23 10:22:42 +00:00
christos 40f1ca5508 PR/57288: Mingye Wang: <ssp/ssp.h>: Use __builtin_dynamic_object_size
for LLVM > 9 and GCC > 12, introducing _SSP_FORTIFY_LEVEL == 3
2023-03-29 13:37:10 +00:00
nia 984ee458fe scandir(3) and alphasort(3) are part of POSIX-2008, so don't require
_NETBSD_SOURCE to use them.
2022-12-28 11:51:21 +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 db13085398 correct tm_sec range to be [0-60]
The previous range introduced in time.h rev1.14 was supposed to account
for a mystical "double leap second", which ultimately never could exist
and was a mistaken interpretation from an early ISO C standard whereby
the possibility of two leap seconds within a year was erroneously
interpreted to mean that two leap seconds could occur at once.
2022-10-23 15:43:40 +00:00
nia c68ac3ce9c Remove hacky gcc2-specific alloca definition. 2022-10-05 12:09:07 +00:00
christos 5dd94c5e95 Add sincos{,f,l} from FreeBSD 2022-08-27 08:31:58 +00:00
christos 55b9c1e826 whitespace changes from tzcode2022a->tzcode2022b 2022-08-16 09:03:04 +00:00
wiz b3d52618d0 sched.h: keep __clone() visible under _NETBSD_SOURCE 2022-08-01 15:16:05 +00:00
wiz d7c5f8bdef sched.h: format comment to follow KNF
requested by thorpej@
2022-08-01 14:34:01 +00:00
wiz da31975915 sched.h: Linux documents clone and __clone as only available
when_GNU_SOURCE is defined - follow suit.

Ok martin@
2022-08-01 14:19:40 +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 09fb17927e fix various typos in comments, mainly origional->original,
extened->extended, incomming->incoming.
2022-05-28 21:14:56 +00:00
andvar 9f981eec2a s/appropiate/appropriate/ in comments and readme file. 2022-05-20 21:31:24 +00:00
gutteridge 003e1c9a2d nameser_compat.h: simplify logic to determine byte order
There's really no need for all the complex #ifdefs present and, on top
of that, it didn't even work correctly for all NetBSD architectures.
Simply use endian.h and drop the rest. (Since there is no upstream for
this code anymore, there's no concern about complicating future merges,
either. This change is also consistent with what FreeBSD and OpenBSD
did years ago.)

Addresses PR toolchain/53880 (reported by maya@, originally encountered
by me on macppc when building a package that pulls in nameser_compat.h
before nameser.h by necessity -- necessity, that is, on another OS).
2022-04-21 04:03:54 +00:00
uwe 4dd5a4c03f err.h: dead once is dead enough
Per joerg's advice keep the __dead in front position as it is where
_Noreturn would go.
2022-01-06 00:16:47 +00:00
nros 3c1a792c55 Make fdopendir visible according to POSIX.1 spec. 2021-12-30 16:20:19 +00:00
andvar 6012d766dc fix various typos in comments and log messages. 2021-12-08 20:50:01 +00:00
christos 1c05296632 Commit the userland portion of the posix_spawn_chdir project by Piyush Sachdeva 2021-11-07 14:34:30 +00:00
christos 686d735712 Expose sigaltstack, stack_t and friends to Posix Issue 5 (200809L) References:
https://man7.org/linux/man-pages/man2/sigaltstack.2.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaltstack.html
2021-11-02 20:12:25 +00:00
thorpej 02edde8aa3 Version the sigaction(2) libc wrapper. The new version uses the "siginfo"
trampoline exclusively, thus relegating "sigcontext"-style handlers (which
have not been documented for many years now) to the dustbin of the compat
library.
2021-11-01 05:53:45 +00:00
andvar 279d5541d3 fix typos in comments. 2021-10-15 22:32:28 +00:00
christos 292aad7505 Change the default for ACLs to be posix1e instead of nfsv4 to match FreeBSD.
Requested by chuq.
2021-09-18 03:05:19 +00:00
rillig f64856e518 stdio.h: remove outdated comment for vscanf
When these functions where added to stdio.h 1.72 on 2008-08-04, the
conditional included _NETBSD_SOURCE.

The additional condition was removed in stdio.h 1.99 from 2020-03-20,
but the comment was not updated.
2021-09-11 20:05:33 +00:00
rillig 0a201ba3c7 stdio.h: sync comment for struct __sFILE with reality
In stdio.h 1.1 from 1993-03-21, the struct had a member named _ub for
the ungetc buffer.  That member was repurposed in stdio.h 1.42 from
2001-12-07 in order to support wide characters.

Remove the reference to the 'WARNING above' since there is no such
warning and even when this comment was added in stdio.h 1.20 from
1998-02-02, there was none.
2021-09-11 19:05:06 +00:00
rillig fb6d4a2598 stdio.h: remove outdated comment about fpos_t
The 'fairly grotesque' from 1994-04-03 referred to the conditional
definition of the type fpos_t, using two different integer types that
both happened to be 64-bit.

When stdio was changed on 2012-01-22 to keep track of the mbstate, the
conditional type definition was removed and the comment no longer made
sense.
2021-09-11 18:38:25 +00:00
rillig 16f5958b18 stdio.h: fix typo in comment 2021-09-11 16:58:38 +00:00
rillig d27ba004df stdio.h: fix typo in comment 2021-09-11 08:34:24 +00:00