Commit Graph

10946 Commits

Author SHA1 Message Date
sevan 4bdf4627ad setuid was in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:05:38 +00:00
sevan 9e15184fb2 seek was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:01:42 +00:00
sevan 65ee4583a2 read was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:00:25 +00:00
sevan ff3425a0e5 Open was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-01 23:57:14 +00:00
sevan b561dbbbe6 mount & umount were present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-01 23:53:45 +00:00
sevan 5ae2aa4a54 Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:52:32 +00:00
sevan da65270b52 getuid was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:46:58 +00:00
sevan 89c2482298 stat() was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
document history of fstat()
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:45:48 +00:00
sevan 2d5e133f80 fork was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:40:07 +00:00
sevan 7356612ea6 Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:37:21 +00:00
wiz fb6187f957 Remove superfluous Pp. 2019-09-01 19:36:09 +00:00
sevan f769ad4c22 Document history of exec()
Move statement on execlpe() & execvpe() to HISTORY section.
2019-09-01 19:33:45 +00:00
sevan 04473fb0e1 create was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:28:31 +00:00
sevan 60ffbc104f Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:20:45 +00:00
sevan ceb77431eb Document history of chown(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:16:43 +00:00
sevan d9e8d47bcc Document history of chmod(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:13:57 +00:00
sevan 1644fb6375 Document history of chdir(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:11:41 +00:00
uwe 9018abb765 Refer to "w+" as "mode" as that's what fopen(3) calls it. 2019-09-01 01:23:14 +00:00
kamil 1a5f018b01 Enhance the support of LLVM sanitizers
Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.
2019-08-27 22:48:53 +00:00
wiz dbba53aad8 Remove leading zero in date. 2019-08-07 19:13:49 +00:00
riastradh 772f880c3d Mark the libc fegetround weak reference unused.
Not all .c files that include gdtoaimp.h use it, which makes clang
unhappy.
2019-08-07 15:37:46 +00:00
roy 72913d43ba read(2): Document ENOBUFS 2019-08-07 01:09:49 +00:00
uwe a4a4fa9898 Minor markup tweaks. 2019-08-04 01:22:49 +00:00
riastradh 9a9a41227b Sprinkle some more const in. 2019-08-01 02:27:43 +00:00
riastradh 15feeb4916 Honour the floating-point rounding mode in floating-point formatting.
C99, Sec. 7.19.6.1 `The fprintf function', paragraph 13, p. 281:

   (Recommended practice)

   For e, E, f, F, g, and G conversions, if the number of significant
   decimal digits is at most DECIMAL_DIG, then the result should be
   correctly rounded.  If the number of significant decimal digits is
   more than DECIMAL_DIG but the source value is exactly
   representable with DECIMAL_DIG digits, then the result should be
   an exact representation with trailing zeros.  Otherwise, the
   source value is bounded by two adjacent decimal strings L < U,
   both having DECIMAL_DIG significant idgits; the value of the
   resultant decimal string D should satisfy L <= D <= U, _with the
   extra stipulation that the error should have a correct sign for
   the current rounding direction_.  [emphasis added]

The gdtoa code base already supports respecting the floating-point
rounding mode, as long as we compile it with Honor_FLT_ROUNDS
defined.  However, for this to work, fegetround must be available in
libc, which it is not currently -- the fenv logic is in libm.

Fortunately, we don't have to move all of fenv from libm to libc --
programs that do not link against libm don't have fesetround, so the
rounding mode is always the default (barring asm shenanigans that
bypass the API -- tough).  So use a weak reference to fegetround; by
default, assume FE_TONEAREST if it is not defined.
2019-08-01 02:06:31 +00:00
pgoyette 44f0185e19 Fix a couple of typos 2019-07-31 23:53:25 +00:00
mgorny 26a01c8cf9 Include pe_lwp member in 'struct ptrace_state'
Reviewed by kamil.
2019-07-30 20:18:11 +00:00
christos 0a19c9139d PR/54414: Valery Ushakov: c99 requires that wcsrtombs(3) updates the source
argument on conversion error
2019-07-28 13:52:23 +00:00
riastradh c3b035f199 Update uuidgen(2) man page to reflect reality as of five years ago. 2019-07-24 06:11:57 +00:00
mgorny 3f42a56a4c Fix thinko: syscalls -> signals 2019-07-11 03:30:01 +00:00
mgorny 5428c4a258 Improve/fix doc of PT_SETSTEP and PT_CLEARSTEP.
Reviewed by kamil.
2019-07-10 19:51:14 +00:00
mgorny d79e8eeec8 Fix typo: SIGRAP -> SIGTRAP 2019-07-10 19:03:47 +00:00
mlelstv 37d9a541e0 The correct fix for lib/51000 is not to remove the apparently dead assignment
but to add the missing usage.

From https://bitbucket.org/tnozaki/netbsd/commits/24b35fdce250
Thanks to Takehiko Nozaki
2019-07-08 06:45:01 +00:00
christos 7005738d9a Sync with 2019b:
zic's new -b option supports a way to control data bloat and to
    test for year-2038 bugs in software that reads TZif files.
    'zic -b fat' and 'zic -b slim' generate larger and smaller output;
    for example, changing from fat to slim shrinks the Europe/London
    file from 3648 to 1599 bytes, saving about 56%.  Fat and slim
    files represent the same set of timestamps and use the same TZif
    format as documented in tzfile(5) and in Internet RFC 8536.
    Fat format attempts to work around bugs or incompatibilities in
    older software, notably software that mishandles 64-bit TZif data
    or uses obsolete TZ strings like "EET-2EEST" that lack DST rules.
    Slim format is more efficient and does not work around 64-bit bugs
    or obsolete TZ strings.  Currently zic defaults to fat format
    unless you compile with -DZIC_BLOAT_DEFAULT=\"slim\"; this
    out-of-the-box default is intended to change in future releases
    as the buggy software often mishandles timestamps anyway.

    zic no longer treats a set of rules ending in 2037 specially.
    Previously, zic assumed that such a ruleset meant that future
    timestamps could not be predicted, and therefore omitted a
    POSIX-like TZ string in the TZif output.  The old behavior is no
    longer needed for current tzdata, and caused problems with newlib
    when used with older tzdata (reported by David Gauchard).

    zic no longer generates some artifact transitions.  For example,
    Europe/London no longer has a no-op transition in January 1996.
2019-07-03 15:50:16 +00:00
wiz cb2bfe58e7 Use Vt for variable types. New sentence, new line. Add a missing ')'.
Add/remove some articles or other missing words.
2019-06-26 13:31:48 +00:00
mgorny c2ad96ff63 Implement PT_GETXSTATE and PT_SETXSTATE
Introduce two new ptrace() requests: PT_GETXSTATE and PT_SETXSTATE,
that provide access to the extended (and extensible) set of FPU
registers on amd64 and i386.  At the moment, this covers AVX (YMM)
and AVX-512 (ZMM, opmask) registers.  It can be easily extended
to cover further register types without breaking backwards
compatibility.

PT_GETXSTATE issues the XSAVE instruction with all kernel-supported
extended components enabled.  The data is copied into 'struct xstate'
(which -- unlike the XSAVE area itself -- has stable format
and offsets).

PT_SETXSTATE issues the XRSTOR instruction to restore the register
values from user-provided 'struct xstate'.  The function replaces only
the specific XSAVE components that are listed in 'xs_rfbm' field,
making it possible to issue partial updates.

Both syscalls take a 'struct iovec' pointer rather than a direct
argument.  This requires the caller to explicitly specify the buffer
size.  As a result, existing code will continue to work correctly
when the structure is extended (performing partial reads/updates).
2019-06-26 12:30:12 +00:00
wiz e92fdad11f fifo -> FIFO. Sort errors. 2019-06-20 06:59:32 +00:00
kamil 177438b064 Add mkfifo{,at}(2) mode in mknod{,at}(2) as requested by POSIX
mknod with mode & S_IFIFO and dev=0 shall behave like mkfifo.

Update the documentation to reflect this state.

Add ATF tests.

This is an in-kernel implementation as typically user-space programs use
mkfifo(2) directly, however whenever there is need to bypass libc (like in
valgrind) then portable POSIX software calls the mknod syscall.

Noted on tech-kern@ by Greg Troxel.
2019-06-20 03:31:53 +00:00
uwe b84ea9c460 Small markup fixes. 2019-06-19 20:20:52 +00:00
kamil a04979c2ea Fix warning message for mknod symbol linkage
The correct reference for mknod(2) is in <sys/stat.h>
2019-06-18 14:25:04 +00:00
wiz f525fbd105 Fix typo. 2019-06-12 12:32:54 +00:00
kamil 3fa4aee840 Try to make posix_spawn(3) note in ptrace(2) less confusing 2019-06-12 12:30:42 +00:00
kamil 212f28ad56 Rephrase sentence about vfork+exec in posix_spawn(3)
Try to make it less confusing.

Requested by <joerg>
2019-06-12 12:26:24 +00:00
wiz 10cd7be093 Use Xr. 2019-06-12 10:09:26 +00:00
kamil a2bdb35ead Document that posix_spawn(3) uses a dedicated syscall
vfork+exec operations are done in one go. This is important information for
programs that wrap posix_spawn(3).
2019-06-12 00:05:48 +00:00
kamil b57d087b4c Document PTRACE_POSIX_SPAWN in man-page 2019-06-11 23:27:46 +00:00
wiz afa9490a07 Quote the name "Ed" to avoid confusion with the macro "Ed". 2019-06-11 12:49:21 +00:00
kamil 93e6f7a330 Correct outdated note that posix_spawn(3) is implemented with vfork(2)
The original FreeBSD libc code uses vfork(2), it's not the case for NetBSD
as there is a dedicated kernel syscall.
2019-06-11 12:47:34 +00:00
hannken 6f60c4f99e Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.
No functional change intended.
2019-06-04 15:07:55 +00:00
hannken 25da6a6235 Implement xdrmem_control(), used as xdr_control(xdr, XDR_GET_BYTES_AVAIL ...
and bump libc minor number.

Final goal is to remove the unmaintained XDR implementation
at external/cddl/osnet/dist/uts/common/rpc.
2019-06-04 08:44:08 +00:00
msaitoh a582b4ae9f Fix typo(s/suppport/support/) in comment. From FreeBSD. 2019-05-29 02:30:42 +00:00
christos 2f3bda949c Add GLOB_TILDE_CHECK (from GNU) 2019-05-29 01:21:33 +00:00
abhinav e1cf3640ab Fix typo: s/then/the 2019-05-26 06:18:13 +00:00
kamil 7be13601f3 Update the ptrace(2) documentation
Document that TRAP_EXEC can be returned for PT_SYSCALL.
Document truncated byte transfers.
2019-05-25 04:25:14 +00:00
wiz 220b9b32b9 Remove trailing whitespace. 2019-05-09 09:09:38 +00:00
bad a057d46c24 Clarify that strunvisx() and strnunvisx() take the same flags as unvis().
Document VIS_NOESCAPE for unvis().
Bump date.
2019-05-08 15:37:41 +00:00
christos 9beb52efed mention truncation of the result if the size in optlen is less that the
size of the option to be returned in optval.
2019-05-08 14:10:42 +00:00
wiz fd62bcefca Remove extra word. 2019-05-06 06:56:36 +00:00
christos 0e2d77f8ff document the EINVAL caused by a large nfds. 2019-05-06 00:50:26 +00:00
pgoyette 7b4757a125 s/three/multiple/
Adjust text for consistency.  There are already more than three interval
timers available, and who knows if even more might be added in the future.
2019-04-27 22:00:29 +00:00
maya 30a5aeb5c6 Unify signbitl implementations.
(Unclear why they were different, it was only the comments that
differed)

Add a comment describing why the generic version works for both 80-bit
and 128-bit double.
2019-04-26 09:03:46 +00:00
wiz 21e57c7819 Remove 'No' macros with no effect.
Add width to table.
Fix en-dashes.
2019-04-20 07:27:39 +00:00
pgoyette 099c595280 Note restrictions on return values from tzgetname() and tzgmtoff() 2019-04-18 11:20:17 +00:00
christos d5e956832a Pick up the latest matching (most recent) entry instead of the first one.
This fixes:
	env TZ=Australia/Melbourne date
printing
	Thu Apr 18 03:32:32 LMT 2019
instead of:
	Thu Apr 18 03:32:32 AEST 2019

XXX: To be strictly correct, the tzgetname() call should probably take a time
reference point in order to return the appropriate zone name for the time
given.
2019-04-17 17:37:29 +00:00
mrg 134005bc02 revert previously. we want riscv32 to have 128 bit long double...
shall fix the compiler instead.
2019-04-16 08:04:23 +00:00
mrg 9840b30120 risc32 doesn't want long double specific versions 2019-04-16 07:32:30 +00:00
maya 0f71666ae3 Cargo cult follow the other 128bit long double architecture (sparc64). 2019-04-15 18:41:06 +00:00
maya 5377f92471 Provide a definition of quiet NaN for RISC-V, and a reference to where
it comes from.
2019-04-14 19:25:27 +00:00
maya 4dfcde7b82 build the generic 128bit long double code. 2019-04-13 17:54:13 +00:00
maya 3d7906cf61 Looks like libc is too big to be able to use j. use a longer distance jump 2019-04-13 16:08:54 +00:00
abhinav 2373d24da1 Markup improvements: use Dv for kqueue filters, events and note names
ok wiz@
2019-04-12 10:57:27 +00:00
christos 3ef12899a4 The typecnt refers the to ttis array and the timecnt refers to the type array.
The types array can have 0 elements (i.e. timecnt == 0), but the ttis array
needs to have one element (typecnt >= 1). Need to revisit and take into
account the types array.
2019-04-08 18:50:52 +00:00
pgoyette 15f13ab537 Split the description for EINVAL into two pieces, one for each operation
that can generate the error.
2019-04-08 10:47:16 +00:00
christos c807c367b6 don't print ???, requested by kre@ 2019-04-07 22:31:54 +00:00
christos efd9bf2580 only need to initialize the first type. 2019-04-07 14:58:25 +00:00
christos 6dcafb68f7 Don't try to print NULL if we can't get a timezone name. First we try dst,
then we try the non-dst name and finally we just print ??? if that did not
work. This is not needed to handle the "TZ= date" case which was crashing
before because the default timezone was not consistently initialized, but
should handle any timezone now.
2019-04-07 14:51:14 +00:00
christos d340589347 Initialize the default timezone a bit more so that tzgetname(3) works. 2019-04-07 14:44:51 +00:00
christos 7a6dbc347c - Padding support from FreeBSD (GNU extensions)
- add '+' for the c-locale only.
2019-04-05 21:27:44 +00:00
christos 0fdca23e1e deal with zic that's not part of libc. 2019-04-04 22:03:23 +00:00
christos 3525c763ab ALL_STATE was bought by STATE_FARM. 2019-04-04 19:42:39 +00:00
christos 8de7229d05 Make strftime_{l,z} re-entrant and always require a non-NULL timezone to be
passed in so that we can use the current timezone in all evaluations (mktime
tzgetname). Reported by Hamilton Slye.
2019-04-04 19:27:28 +00:00
christos 1ef6fb3def explicitly promote to double. 2019-04-04 19:25:38 +00:00
christos 91e14238d8 merge 2019a
Changes to code

    zic now has an -r option to limit the time range of output data.
    For example, 'zic -r @1000000000' limits the output data to
    timestamps starting 1000000000 seconds after the Epoch.
    This helps shrink output size and can be useful for applications
    not needing the full timestamp history, such as TZDIST truncation;
    see Internet RFC 8536 section 5.1.  (Inspired by a feature request
    from Christopher Wong, helped along by bug reports from Wong and
    from Tim Parenti.)

  Changes to documentation

    Mention Internet RFC 8536 (February 2019), which documents TZif.

    tz-link.html now cites tzdata-meta
    <https://tzdata-meta.timtimeonline.com/>.
2019-04-04 18:18:31 +00:00
christos 15c525fbc5 fix compilation for non _REENTRANT 2019-03-28 15:05:03 +00:00
uwe 48efa70d76 Minor markup and wording fixes. 2019-03-21 21:13:45 +00:00
mrg 1140fdffca restore the removed "function does something horrible" description,
but leave the real description as well.
2019-03-18 02:15:21 +00:00
wiz 928749aba2 Fix typo. 2019-03-12 22:21:53 +00:00
kre df01b8ae2e PR lib/54053
When auto scaling, and the buffer is bigger than big enough
for the biggest possible number, don't try and calculate
the max value that will fit in the buffer - that calc
will overflow (guaranteed) and is useless, the value
we're formatting cannot possibly be bigger.  So simply
use the unscaled value (the raw number).

While here, also avoid returning values that are larger
than the buffer len ... while it would be nice to be able
to find out how big the buffer should be so the data will
fit, the interface doesn't really allow that (the buffer
length passed in controls the scaling - at least when
auto scaling) and the code already does "return -1" when
it detects the buffer length is too small, even before
it works out how much would have been needed.  So, rather
than returning a value > len (while truncating the result
to fit in len ... all courtesy of snprintf()) return -1
in this case as well.

Also, allow suffix==NULL (meaning "") - there's no reason
not to, and requiring users to pass in an explicit "" is
not useful.
2019-03-11 15:10:51 +00:00
christos d0175ebb38 Fix previous... We need to deal with a conditional branch. 2019-03-09 02:50:07 +00:00
christos 117899b88e We don't fit anymore thanks to jemalloc:
relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `cerror'
2019-03-09 02:33:02 +00:00
msaitoh 659e7a3c69 s/ are are / are /
s/ a a / a /
2019-03-08 08:35:58 +00:00
christos 939c050d54 Transfer all the keys that were created in the libc stub implementation
to the pthread tsd implementation when the main thread is created.
This corrects a problem where a process created keys before libpthread
was loaded (either from the libc constructor or because libpthread
was dlopened later). This fixes a problem with jemalloc which creates
keys in the constructor.
2019-03-05 01:35:52 +00:00
christos e0589ce187 bump for jemalloc 2019-03-04 19:20:12 +00:00
christos b4744953f9 Hook for jemalloc 2019-03-04 17:30:33 +00:00
maya 900a869949 s/a DARPA Internet address/an Internet address/
From OpenBSD.
2019-03-03 20:34:43 +00:00
maya 00b9d7ef65 fix typo. From Evil_Bob. 2019-02-24 11:51:05 +00:00
christos dae7fb3e37 appease string + int warning. 2019-02-18 20:27:20 +00:00
christos b0735e4145 Add some better error handling from FreeBSD, although we don't
suffer from the same issue, since we don't decrement p->next, like
FreeBSD does because we don't have multibyte support (yet). We
choose to do this so we can fail faster and more predictably.

Here's the original FreeBSD message:

When passed the invalid regular expression "a**", the error is
eventually detected and seterr() is called. It sets p->error
appropriatly and p->next and p->end to nuls which is a never used char
nuls[10] which is zeros due to .bss initialization. Unfortunatly,
p_ere_exp() and p_simp_re() both have fall through cases where they set
the error, decrement p->next and access it which means a read from what
ever .bss variable comes before nuls.

Found with regex_test:repet_multi and CHERI bounds checking.

Reviewed by:	ngie, pfg, emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10541
2019-02-07 22:22:31 +00:00
christos 2ebb8fd343 Fix OOB read from FreeBSD:
The bug is an out-of-bounds read detected with address sanitizer that
happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
equal to "GS\x00". In that case len will be equal to 4, and the
strncmp(cp->name, sp, len) call will succeed when cp->name is "GS" but the
cp->name[len] == '\0' comparison will cause the read to go out-of-bounds.

Checking the length using strlen() instead eliminates the issue.

The bug was found in LLVM with oss-fuzz:
	https://reviews.llvm.org/D39380
2019-02-07 22:13:52 +00:00
mrg 504bd058ec use adrp not adr, since the data is not pc-rel. fixes brk(2). 2019-02-05 13:02:35 +00:00
dholland ad8aa774f5 fix duplicated chunk from merge 2019-01-27 04:33:29 +00:00
dholland a5dfc9a7f2 fix another mergeo 2019-01-27 02:42:32 +00:00
dholland f4d9309d1d fix mergeo 2019-01-27 02:40:49 +00:00
pgoyette d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
christos c959ea2c0d PR/53904: Jintao Zhu: Use a mutex instead of an rwlock to assure thread safety 2019-01-24 18:01:38 +00:00
mrg 1fbe8d0596 remove diag assert - the compiler demands fp is non NULL now. 2019-01-23 00:05:47 +00:00
wiz f401b5d182 Use \- for minus. 2019-01-15 07:01:01 +00:00
uwe 3e392f0443 Fly, nasal demons, fly away... 2019-01-15 03:43:15 +00:00
riastradh f5a847d300 Use the same variable for the locale example. 2019-01-15 03:30:58 +00:00
uwe 326784a6c3 Don't talk about "the first argument" when there's only one. 2019-01-15 01:23:49 +00:00
uwe 31759755bb Fix markup pasto. 2019-01-15 01:13:49 +00:00
uwe 2a102dd013 Remove the extra cast to int in the CAVEATS example.
We removed it from EXAMPLES a few releases ago.
2019-01-15 01:11:03 +00:00
uwe 893d5ca890 Fix typo in macro flag. 2019-01-15 00:43:32 +00:00
riastradh 2712861341 Expand on correct and incorrect usage, and on compiler warnings.
Give an example program with the warning, and some example nonsense
outputs.  Also note why glibc's approach doesn't solve the problem.
2019-01-15 00:31:19 +00:00
christos f0d7eb24ef use the pico objects if we are making a PIC profiled library. 2019-01-06 18:14:10 +00:00
christos 76c767265c Release 2018i - 2018-12-30 11:05:43 -0800
Briefly:
    São Tomé and Príncipe switches from +01 to +00 on 2019-01-01.

  Changes to future timestamps

    Due to a change in government, São Tomé and Príncipe switches back
    from +01 to +00 on 2019-01-01 at 02:00.  (Thanks to Vadim
    Nasardinov and Michael Deckers.)


Release 2018h - 2018-12-23 17:59:32 -0800

  Briefly:
    Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21.
    New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move.
    Metlakatla, Alaska observes PST this winter only.
    Guess Morocco will continue to adjust clocks around Ramadan.
    Add predictions for Iran from 2038 through 2090.

  Changes to future timestamps

    Guess that Morocco will continue to fall back just before and
    spring forward just after Ramadan, the practice since 2012.
    (Thanks to Maamar Abdelkader.)  This means Morocco will observe
    negative DST during Ramadan in main and vanguard formats, and in
    rearguard format it stays in the +00 timezone and observes
    ordinary DST in all months other than Ramadan.  As before, extend
    this guesswork to the year 2037.  As a consequence, Morocco is
    scheduled to observe three DST transitions in some Gregorian years
    (e.g., 2033) due to the mismatch between the Gregorian and Islamic
    calendars.

    The table of exact transitions for Iranian DST has been extended.
    It formerly cut off before the year 2038 in a nod to 32-bit time_t.
    It now cuts off before 2091 as there is doubt about how the Persian
    calendar will treat 2091.  This change predicts DST transitions in
    2038-9, 2042-3, and 2046-7 to occur one day later than previously
    predicted.  As before, post-cutoff transitions are approximated.

  Changes to past and future timestamps

    Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to
    +05 on 2018-12-21.  This is a zone split as Qostanay (aka
    Kostanay) did not switch, so create a zone Asia/Qostanay.

    Metlakatla moved from Alaska to Pacific standard time on 2018-11-04.
    It did not change clocks that day and remains on -08 this winter.
    (Thanks to Ryan Stanley.)  It will revert to the usual Alaska
    rules next spring, so this change affects only timestamps
    from 2018-11-04 through 2019-03-10.

  Change to past timestamps

    Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00,
    not 00:00.  I transcribed the time incorrectly from Shanks.
    (Thanks to Phake Nick.)

    Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00.
    (Thanks to Phake Nick.)

    Guam observed DST irregularly from 1959 through 1977.
    (Thanks to Phake Nick.)

    Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on
    10-01 changed standard time to +08:30 (not +08).  Its transition
    back to +08 after WWII was on 1945-09-15, not the previous day.
    Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT).
    (Thanks to Phake Nick, Steve Allen, and Joseph Myers.)  Also,
    its 1952 fallback was on 11-02 (not 10-25).

    This release contains many changes to timestamps before 1946 due
    to Japanese possession or occupation of Pacific/Chuuk,
    Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro,
    Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei.
    (Thanks to Phake Nick.)

    Assume that the Spanish East Indies was like the Philippines and
    observed American time until the end of 1844.  This affects
    Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei.

  Changes to past tm_isdst flags

    For the recent Morocco change, the tm_isdst flag should be 1 from
    2018-10-27 00:00 to 2018-10-28 03:00.  (Thanks to Michael Deckers.)
    Give a URL to the official decree.  (Thanks to Matt Johnson.)
2019-01-01 03:04:56 +00:00
wiz 76792de36e Use An in AUTHORS section. 2018-12-17 08:18:06 +00:00
abhinav 3cf9f52098 Remove self reference in SEE ALSO
Add references consistent with those in md4(3) and md5(3)

Reported by kamil
2018-12-16 14:08:48 +00:00
uwe cb6634cf44 Don't leave a subordinate clause out in the cold. 2018-12-14 03:43:22 +00:00
uwe e8277867b9 Fix typo in the function comment. 2018-12-14 03:29:54 +00:00
maya 62523467d4 Remove unused macro 2018-12-13 08:45:29 +00:00
maya 3ba1def22c Remove unused macro. 2018-12-13 08:39:34 +00:00
dholland c46ad0a300 Adjust English usage in message for EAI_NONAME. 2018-12-13 04:41:41 +00:00
dholland aaa03614bc Return EAI_NODATA, not EAI_NONAME, for nonexistent hosts.
This causes e.g. "ssh nosuchname" to print "No address associated with
hostname", which is correct, rather than "hostname nor servname
provided, or not known", which is not.
2018-12-13 04:30:55 +00:00
christos dda6d8cae4 fix grammar. 2018-12-09 20:29:53 +00:00
tih 138c67b5ef Summary: Align softfloat float128 with libgcc.
While libgcc adapts its float128 data structure to the endianness of
the architecture, the softfloat code in libc didn't.  With both of
them handling the same values, softfloat must follow the toolchain.

OK: riastradh
2018-12-06 19:17:13 +00:00
kamil cae5584ffc Correct handling of minval > maxval in strtonum(3)
The original implementation in OpenBSD returns "invalid" and avoids reading
the input string. The replaced behavior was interpreting the input string
ignoring the invalid arguments.
2018-12-06 06:29:56 +00:00
kamil cfb2a8fe4d Correct the documentation of cdbr_open_mem(3)
Fix function prototype in the man-page.
Add link cdbr_open_mem(3) -> cdbr(3).
2018-12-01 02:43:43 +00:00
wiz f3f43bfe46 More macros, less whitespace. 2018-11-27 10:38:14 +00:00
kamil 80ee9b513a Fix link sha1.3 <- SHA1File.3
This SHA1File used to link to sha2(3).
2018-11-27 03:56:37 +00:00
kamil 99255a5dff Document SHA1FileChunk(3) in sha1(3)
Description taken from OpenBSD.
2018-11-27 03:29:36 +00:00
skrll 031e68cbb9 Update comments to help explain what's going on 2018-11-23 12:39:18 +00:00
skrll 5c89cda337 Fix so the setcontext call is via the PLT and libpthread can override 2018-11-23 11:38:07 +00:00
ryo 466808d25b fix condition code. x1==0 is parent. 2018-11-22 08:30:58 +00:00
skrll df8c50d73f _REG_LR should be _lwp_exit 2018-11-21 21:24:42 +00:00
skrll 81f196752c Fix some register names in comments 2018-11-21 21:04:15 +00:00
skrll 916ea5ef0d Fix a comment 2018-11-21 21:01:41 +00:00
ryo b3731ba225 fix type of argument for va_arg; don't round to 32bit. 2018-11-16 10:51:08 +00:00
riastradh 0cc7838e19 Attempt to implement fabsf by copying fabs and s/d/f/g.
Vax wizards, please vaxinate if I flubbed this!
2018-11-08 18:19:37 +00:00
riastradh 7b66ed5df0 Use the generic C fabs/fabsl on ia64 for now to unbreak the build. 2018-11-08 16:36:16 +00:00
riastradh 3e49d37969 powerpc64 needs fabsl too. (Apparently no __HAVE_LONG_DOUBLE?) 2018-11-08 16:31:46 +00:00
riastradh e84f49ed3d Try speling it rite, riasthradhdadhaa or whatever your name is. 2018-11-08 16:29:50 +00:00
msaitoh 169880b3b2 "s/ an an / an /" in comment. No functional change. 2018-11-08 06:43:52 +00:00
riastradh cdb65da578 On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.
For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm.  For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64.  Need help from an itanium
wizard!  Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
2018-11-07 22:21:42 +00:00
wiz b572c9cad3 Fix xref. 2018-11-05 09:18:55 +00:00
maya 81e6878869 Suggest to remove lfs_ stubs on a major bump.
they're deprecated, ioctl is used instead.
2018-11-05 04:08:39 +00:00
christos 2d24b2e817 - Introduce a new SO_RERROR socket option to explicitly turn on
receive overflow errors re-instating the default behavior to
  silently ignore them as before 2018-03-19.
- Introduce a new kern.sooptions sysctl to control the default
  behavior of socket options. Setting this to 0x4000 (SO_RERROR),
  turns on receive overflow error reporting for all sockets.
- Change dhcpcd to turn on SO_RERROR on all its sockets.

As discussed in tech-net.
2018-11-04 16:30:28 +00:00
christos 273e6379f5 Welcome tzcode-2018g
Changes to code

    When generating TZif files with leap seconds, zic no longer uses a
    format that trips up older 32-bit clients, fixing a bug introduced
    in 2018f.  (Reported by Daniel Fischer.)  Also, the zic workaround
    for QTBUG-53071 now also works for TZif files with leap seconds.

    The translator to rearguard format now rewrites the line
    "Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
    "Rule Japan 1948 1951 - Sep Sun>=9  1:00 0 S".
    This caters to zic before 2007 and to Oracle TZUpdater 2.2.0
    and earlier.  (Reported by Christos Zoulas.)

  Changes to documentation

    tzfile.5 has new sections on interoperability issues.
2018-10-27 22:29:24 +00:00
christos b2b04f7e8a Update to 2018f:
Changes to code

    zic now always generates TZif files where time type 0 is used for
    timestamps before the first transition.  This simplifies the
    reading of TZif files and should not affect behavior of existing
    TZif readers because the same set of time types is used; only
    their internal indexes may have changed.  This affects only the
    legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and
    EET, which previously used nonzero types for these timestamps.

    Because of the type 0 change, zic no longer outputs a dummy
    transition at time -2**59 (before the Big Bang), as clients should
    no longer need this to handle historical timestamps correctly.
    This reverts a change introduced in 2013d and shrinks most TZif
    files by a few bytes.

    zic now supports negative time-of-day in Rule and Leap lines, e.g.,
    "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition
    occurs at 18:00 on the Saturday before the last Sunday in April.
    This behavior was documented in 2018a but the code did not
    entirely match the documentation.

    localtime.c no longer requires at least one time type in TZif
    files that lack transitions or have a POSIX-style TZ string.  This
    future-proofs the code against possible future extensions to the
    format that would allow TZif files with POSIX-style TZ strings and
    without transitions or time types.

    A read-access subscript error in localtime.c has been fixed.
    It could occur only in TZif files with timecnt == 0, something that
    does not happen in practice now but could happen in future versions.

    localtime.c no longer ignores TZif POSIX-style TZ strings that
    specify only standard time.  Instead, these TZ strings now
    override the default time type for timestamps after the last
    transition (or for all time stamps if there are no transitions),
    just as DST strings specifying DST have always done.

    leapseconds.awk now outputs "#updated" and "#expires" comments,
    and supports leap seconds at the ends of months other than June
    and December.  (Inspired by suggestions from Chris Woodbury.)

  Changes to documentation

    New restrictions: A Rule name must start with a character that
    is neither an ASCII digit nor "-" nor "+", and an unquoted name
    should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~".
    The latter restriction makes room for future extensions (a
    possibility noted by Tom Lane).

    tzfile.5 now documents what time types apply before the first and
    after the last transition, if any.

    Documentation now uses the spelling "timezone" for a TZ setting
    that determines timestamp history, and "time zone" for a
    geographic region currently sharing the same standard time.

    The name "TZif" is now used for the tz binary data format.

    tz-link.htm now mentions the A0 TimeZone Migration utilities.
    (Thanks to Aldrin Martoq for the link.)
2018-10-19 23:05:35 +00:00
kamil b50859a9e1 Drop Pad functions from sha2(3)
This man-page first appeared before porting all the features to NetBSD and
actually Pad ones were never ported. Keeping it in the documentation is
misleading and actually caused bugs in handling of these functions in 3rd
party software.
2018-10-09 11:36:35 +00:00
kre d794b9b637 HACK: if calling dirname() with the results of a previous dirname()
there is no need to copy the path into the output buffer, it is already
there....

All this has to change to become compat with a forthcoming POSIX update.
2018-09-27 00:45:34 +00:00
maxv c698ced324 fix references, the things were moved into netipsec/ a while ago 2018-09-06 09:28:00 +00:00
christos 48875230b6 Allow being compiled as a tool. 2018-08-30 12:06:06 +00:00
ryo 4f574380a4 delete __{ge,lt,gt,le,eq,ne,unordt}tf2.
these should not be defined in libc.

pointed out by joerg@. thanks.
2018-08-27 16:46:13 +00:00
msaitoh fba7dcecac - SIOCGIFINDEX was added in 2013, but if_freenameindex(3) have not used it
for years. Use it to improve performance. Same as FreeBSD.
- KNF.
2018-08-22 03:12:31 +00:00
martin 7dba0fd9ed PR standards/53525: move getsubopt to stdlib.h 2018-08-15 10:49:47 +00:00
wiz 4e9665c6ea Sort SEE ALSO. 2018-08-13 06:08:48 +00:00
wiz c9911a308e Various improvements.
More markup, sort errors, fix -1.
2018-08-13 06:00:21 +00:00
ryo fae343b8b2 fix multiple definition of __{ge,lt,gt,le,eq,ne,unordt}tf2 in libc and libgcc.
this fixes the ATF call_once_static, call_once2_static, cxxruntime_static, static_destructor_static.
2018-08-11 10:06:40 +00:00
kamil c85fcdfeed Merge FreeBSD improvements to the man-page of timespec_get(3)
Keep NetBSD references instead of FreeBSD ones included in the FreeBSD
version.
2018-08-10 20:35:52 +00:00
ryo e6a0182575 need to set _UC_TLSBASE of uc_flags for _lwp_makecontext().
pointed out from skrll@. thanks.
2018-08-04 10:22:09 +00:00
kamil 93bf963a4b Restrict -fno-sanitize=function to Clang/LLVM only
The base GCC version 6,x does not support this option.
2018-08-03 14:01:21 +00:00
kamil d92938e14a Add a support to build ubsan.c in libc
Under the condition of MKLIBCSANITIZER==yes link ubsan.c into libc.

This is a clean-room reimplementation from scratch of the Undefined
Behavior runtime called micro-UBSan (or uBSan - user-UBSan).
2018-08-03 04:29:35 +00:00
kamil 7517542c29 Disable sanitization of -fsanitize=function in libc
Generated code for the checks (in at least libunwind) depends on the C++
runtime feature of RTTI.

Pass -fno-sanitize=function to LIBCSANITIZERFLAGS.
2018-08-03 02:29:35 +00:00
rjs f78bd2661d Add missing SCTP manpage. 2018-08-02 10:18:19 +00:00
rjs 97b85c8c95 Add userland support for SCTP and manpages. 2018-08-02 08:40:47 +00:00
ryo 90a07881a6 fix long double NaN definition. 2018-08-01 19:59:49 +00:00
sevan 8757822cde Remove ISO references 2018-07-31 22:28:26 +00:00
rjs 4dbc455943 Userland changes for getsockopt2(). 2018-07-31 13:04:09 +00:00
maya 726d0d156a it's C18, not C17. 2018-07-27 15:15:30 +00:00
maya b91e8b8ee6 Claim C17 (although I'm unsure), add a note about C11's requirements. 2018-07-27 14:34:44 +00:00
maya 8d702a64ca C17 conformance: aligned_alloc's size doesn't need to be a multiple of
alignment any more.

Thanks Joseph Myers for the heads up.
2018-07-27 13:08:47 +00:00
kamil 21d1b523b3 Avoid undefined behavior in ftok(3)
Do not change the signedness bit with a left shift operation.
Cast to unsigned integer to prevent this.

ftok.c:56:10, left shift of 123456789 by 24 places cannot be represented in type 'int'
ftok.c:56:10, left shift of 4160 by 24 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
2018-07-26 00:05:28 +00:00
kamil 1a4c49b997 Avoid undefined behavior in the definition of LAST_FRAG in xdr_rec.c
Do not change the signedness bit with a left shift operation.
Switch to unsigned integer to prevent this in the LAST_FRAG symbol.

xdr_rec.c:559:39, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:572:26, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:573:25, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:632:37, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:711:32, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:722:28, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
2018-07-25 23:59:08 +00:00
kamil f34d1bdd0f Avoid undefined behavior in left bit shift in jemalloc(3)
Change the type of shifted value to unsigned to prevent altering the
signedness bit.

jemalloc.c:1707:14, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1724:15, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1840:28, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
2018-07-25 20:05:35 +00:00
ryo ac20698df5 fix a bug. no need postincrement here. 2018-07-20 12:19:07 +00:00
joerg 700ad9d05d Determine dynamic binaries by presence of PT_INTERP. Static PIE has
_DYNAMIC.
2018-07-13 19:50:21 +00:00
joerg bf395f73c9 Compute relocbase correctly for static PIE. AT_BASE is not usable in
this case.
2018-07-13 19:49:47 +00:00
maxv 62c8988166 Remove the kernel PMC code. Sent yesterday on tech-kern@.
This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.
2018-07-12 10:46:40 +00:00
christos 0dba751ea2 switch to FreeBSD's memmem 2018-07-08 17:53:42 +00:00
msaitoh 8402962f31 Indent. 2018-07-04 07:38:38 +00:00
dholland bc382992a0 Describe what this actually does. Bump date. 2018-06-25 01:21:21 +00:00
dholland d8a5b30306 atomic_and/atomic_or do bitwise ops, not logical ops. 2018-06-16 08:11:32 +00:00
eadler 8ddc25ac24 libc: remove explicit cast NULL in atoi
There isn't any reason to cast NULL so just remove it. A similar change
was already made in DragonFly and FreeBSD (by me).

ok fly@
2018-06-13 09:38:32 +00:00
maya 9616ec28db Avoid left-shifting a negative number in the non-compat case, too. 2018-06-11 20:28:23 +00:00
kamil 5a889623ce Correct Undefined Behavior in libc/citrus
Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined:

# nm /usr/lib/libc.so|grep sanit
/public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Sponsored by <The NetBSD Foundation>
2018-06-11 18:03:38 +00:00
christos 64715b9aa8 We can't build those three with MKSANITIZER, they are used too early. 2018-06-09 22:41:55 +00:00
joerg 5b49b507f5 Simplify to avoid pointless null pointer arithmetic. 2018-05-23 21:21:27 +00:00
wiz 1a15da2ec7 Use .An in authors section. Remove empty section. 2018-05-23 06:08:01 +00:00
christos e4acc50303 Add cross references to the openssl man pages. 2018-05-23 02:08:40 +00:00
wiz 69f43e6644 Remove reference to itself. 2018-05-22 05:39:44 +00:00
kamil 33e8159699 Minor improvement in sigaction(2)
Note that SIGCHLD covers process continued event.

Sponsored by <The NetBSD Foundation>
2018-05-22 03:07:50 +00:00
kamil fb80b4e61b Note in vfork(2) that SIGTSTP is masked
SIGSTOP is no longer masked, but it was never documented.

Sponsored by <The NetBSD Foundation>
2018-05-19 05:39:21 +00:00
joerg 33bc134aba Avoid complicated arithmetic involving NULL. 2018-05-16 20:21:39 +00:00
christos cfc8dcb49a Merge 2018e
Changes to code

    zic now accepts subsecond precision in expressions like
    00:19:32.13, which is approximately the legal time of the
    Netherlands from 1835 to 1937.  However, because it is
    questionable whether the few recorded uses of non-integer offsets
    had subsecond precision in practice, there are no plans for tzdata
    to use this feature.  (Thanks to Steve Allen for pointing out
    the limitations of historical data in this area.)

    The code is a bit more portable to MS-Windows.  Installers can
    compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that
    reserve identifiers like 'localtime'.  (Thanks to Manuela
    Friedrich).

  Changes to documentation and commentary

    theory.html now outlines tzdb's extensions to POSIX's model for
    civil time, and has a section "POSIX features no longer needed"
    that lists POSIX API components that are now vestigial.
    (From suggestions by Steve Summit.)  It also better distinguishes
    time zones from tz regions.  (From a suggestion by Guy Harris.)

    Commentary is now more consistent about using the phrase "daylight
    saving time", to match the C name tm_isdst.  Daylight saving time
    need not occur in summer, and need not have a positive offset from
    standard time.

    Commentary about historical transitions in Uruguay has been expanded
    with links to many relevant legal documents.
    (Thanks to Tim Parenti.)

    Commentary now uses some non-ASCII characters with Unicode value
    less than U+0100, as they can be useful and should work even with
    older editors such as XEmacs.
2018-05-04 15:51:00 +00:00
wiz b4c2969caa Sort sections. Sort ERRORS. Remove trailing whitespace. 2018-05-03 05:09:48 +00:00
christos 3e4df0d384 Explain PROT_MPROTECT better, add references to mremap(2), document the
unimplemented flags, documented the alignment pre-defined constants.
2018-05-02 16:00:20 +00:00
christos 652623d133 Add EXAMPLE and ERRORS section. 2018-05-02 15:25:13 +00:00
kamil 385d9c8955 Implement PTRACE_VFORK
Add support for tracing vfork(2) events in the context of ptrace(2).

This API covers other frontends to fork1(9) like posix_spawn(2) or clone(2),
if they cause parent to wait for exec(2) or exit(2) of the child.

Changes:
 - Add new argument to sigswitch() determining whether we need to acquire
   the proc_lock or whether it's already held.
 - Refactor fork1(9) for fork(2) and vfork(2)-like events.
   Call sigswitch() from fork(1) for forking or vforking parent, instead of
   emitting kpsignal(9). We need to emit the signal and suspend the parent,
   returning to user and relock proc_lock.
 - Add missing prototype for proc_stop_done() in kern_sig.c.
 - Make sigswitch a public function accessible from other kernel code
   including <sys/signalvar.h>.
 - Remove an entry about unimplemented PTRACE_VFORK in the ptrace(2) man page.
 - Permin PTRACE_VFORK in the ptrace(2) frontend for userland.
 - Remove expected failure for unimplemented PTRACE_VFORK tests in the ATF
   ptrace(2) test-suite.
 - Relax signal routing constraints under a debugger for a vfork(2)ed child.
   This intended to protect from signaling a parent of a vfork(2)ed child that
   called PT_TRACE_ME, but wrongly misrouted other signals in vfork(2)
   use-cases.

Add XXX comments about still existing problems and future enhancements:
 - correct vfork(2) + PT_TRACE_ME handling.
 - fork1(2) handling of scenarios when a process is collected in valid but
   rare cases.

All ATF ptrace(2) fork[1-8] and vfork[1-8] tests pass.

Fix PR kern/51630 by Kamil Rytarowski (myself).

Sponsored by <The NetBSD Foundation>
2018-05-01 16:37:23 +00:00
jmcneill e9bedda7d9 Add some compat stubs for aarch64. Not providing any actual compatibility
with old binaries (there are none), but having these symbols helps GNU
configure scripts.
2018-04-29 17:47:06 +00:00