Commit Graph

20059 Commits

Author SHA1 Message Date
christos f064f71d05 fix print-like attrs 2020-03-02 14:18:50 +00:00
christos 74707f6a8a PR/55041: Fix printf format in syslog(3) error message. 2020-03-02 14:10:24 +00:00
christos a2362fee00 Redo the sshsk_sign() stuff properly, but putting the helper in libssh.so 2020-03-01 20:59:52 +00:00
christos 30dba8ff06 Add the sign client part. 2020-03-01 14:50:43 +00:00
christos 36f537f56c This takes a provider now 2020-02-27 03:25:08 +00:00
christos 53702d90ff one more level down 2020-02-27 02:56:46 +00:00
mrg 046701c57b probably fix previous: it wants mod.mk's PARSEDIR/.., not ../..,
so it picks up the libpam/Makefile.inc.
2020-02-27 00:02:56 +00:00
christos 65b3e3c5b8 Handle pam modules that are not in this subtree. 2020-02-26 19:33:30 +00:00
rin 4ecd76e535 0x%p --> %p for non-external codes. 2020-02-24 12:20:29 +00:00
ad f340434d23 +EINVAL 2020-02-23 20:41:41 +00:00
ad d2a0ebb67a UVM locking changes, proposed on tech-kern:
- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.
2020-02-23 15:46:38 +00:00
kamil 21056e8a10 Change the previous cast from unsigned int to unsigned long
This code produces the same result and is consistent with the previous
lines. Only the least significant 16 bites (unsigned short) are meaningful.
2020-02-23 09:53:42 +00:00
kamil 6f201b686b Avoid undefined behavior in fread(3)
On the first call to fread(3), just after fopen(3) the internal buffers
are empty. This means that _r and _p (among others) are zeroed.

Passing NULL to the 2nd argument of memcpy(3) for the zero length is
undefined. Calling _p += 0 triggers LLVM UBSan (NULL pointer arithmetic).
Calling _p += 0, p += 0 and resid -= 0 has no effect.

Replace the "fp->_r = 0;" logic with a short circuit jump to __srefill()
that sets _r internally and refills the FILE buffers.

No functional change from an end user point of view, except skipping a few
dummy operations on the first call, for a FILE pointer, to fread(3).
2020-02-22 22:02:46 +00:00
kamil 6aee95b41f Avoid undefined behavior in the rand48(3) implementation
Instead of implicid promotion to signed int,
explicitly cast the arguments to unsigned int.

_rand48.c:53:27, signed integer overflow:
58989 * 58970 cannot be represented in type 'int'

_rand48.c:53:38, signed integer overflow:
-2093025904 + -1496809120 cannot be represented in type 'int'

_rand48.c:53:57, signed integer overflow:
57068 * 42787 cannot be represented in type 'int'

New and old code produce the same code as tested with:

#include <stdio.h>
#include <stdlib.h>

#define COUNT 1000 * 1000

int
main(void)
{
	FILE *fp;
        int i;

        fp = fopen("numbers.txt", "w+");
	if (!fp)
		abort();

        for(i = 0; i < COUNT; i++) {
                fprintf(fp, "%f\n", drand48());
                fprintf(fp, "%ld\n", lrand48());
                fprintf(fp, "%ld\n", mrand48());
        }

        fclose(fp);

        return 0;
}
2020-02-22 14:07:57 +00:00
pgoyette 79e45209ec Remove vestigial remnant of an earlier modification to the module
implementation.  There currently is no such thing as a module's
"alias".
2020-02-22 14:06:05 +00:00
kamil 57225a2ce5 Reorder words to fix grammar
Noted by <leot>
2020-02-22 13:20:21 +00:00
kamil 756b86e872 rand48: Document that short integers are unsigned 2020-02-22 11:56:13 +00:00
kamil 2bddf73745 Improve readability of __dorand48()
Break long lines into shorter instructions per line.

No Functional Change.
2020-02-22 11:24:47 +00:00
kamil 6ab39b6716 Avoid undefined behavior in left shift
crypt.c:772:11, left shift of 1363235140 by 1 places cannot be represented
in type 'int32_t' (aka 'int')
2020-02-22 10:29:17 +00:00
kamil 96be1c9965 Avoid undefined behavior in bit shift operations
crypt.c:839:40, left shift of negative value -1197182952
crypt.c:840:40, left shift of negative value -264997776
2020-02-22 10:22:32 +00:00
kamil e1278de2f9 Avoid NULL pointer arithmetics on environ
_env.c:260:9, pointer expression with base 0 overflowed to 0
_env.c:260:9, load of null pointer of type 'char *'
2020-02-22 10:05:12 +00:00
kamil 35ea0de335 Avoid unportable left shift construct
left shift of 9 by 28 places cannot be represented in type 'int'
2020-02-22 00:38:14 +00:00
kamil ca9a018f12 Avoid undefined behavior in *BIT macros
hash_page.c:792:2, left shift of 1 by 31 places cannot be represented in type 'int'
hash_page.c:855:2, left shift of 1 by 31 places cannot be represented in type 'int'
hash_page.c:779:3, left shift of 1 by 31 places cannot be represented in type 'int'
2020-02-21 22:04:06 +00:00
riastradh f638f19cd2 Fix kassert in lfs by initializing vp first. 2020-02-20 15:48:52 +00:00
rin e3331ab957 libpthread sets initial value of MSR for lwp's. However, appropriate
value differs b/w oea/booke/ibm4xx, and there's no way to obtain it
from userland. Therefore, this initial value should be corrected by
cpu_setmcontext().

- Comment this in libpthread
- Add KASSERT in cpu_mcontext_validate()
2020-02-20 07:07:02 +00:00
kamil 331480e6b2 Revert "Enhance the pthread(3) + malloc(3) init model"
It is reported to hand on aarch64 with gzip.
2020-02-16 17:45:11 +00:00
kamil bcfb2645e2 Set __isthreaded before bootstrapping malloc(3)
jemalloc depends on the __isthreaded dynamic state logic.

Reported by <wiz> for mpv and by <tih> for gzip.
2020-02-16 17:14:31 +00:00
kamil 5fa609827b Enhance the pthread(3) + malloc(3) init model
Separate the pthread_atfork(3) call from pthread_tsd_init()
and move it into a distinct function.

Call inside pthread__init() late TSD initialization route, just after
"pthread_atfork(NULL, NULL, pthread__fork_callback);".

Document that malloc(3) initialization is now controlled again and called
during the first pthread_atfork(3) call.

Remove #if 0 code from pthread_mutex.c as we no longer initialize malloc
prematurely.
2020-02-15 23:59:30 +00:00
riastradh 57d4369975 Let's not write temporary files to fixed paths in /tmp, shall we?
XXX pullup
2020-02-15 22:55:22 +00:00
kamil 418e457ef1 Change types of DUP2ALIAS and DUP2FDMASK bit masks to unsigned
This is for consistency with the DUP2BIT change.
2020-02-10 23:21:42 +00:00
kamil a6c4eb28f3 Avoid unportable bit shift semantics
hijack.c:451:52, left shift of 1 by 31 places cannot be represented in type 'int
2020-02-10 09:10:58 +00:00
maxv 1273dfb58e Reference nvmmctl(8). 2020-02-09 12:19:01 +00:00
kamil f66ccdf057 Change the behavior of pthread_equal()
On error when not aborting, do not return EINVAL as it has a side effect
of being interpreted as matching threads. For invalid threads return
unmatched.

Check pthreads for NULL, before accessing pt_magic field. This avoids
faults on comparision with a NULL pointer.

This behavior is in the scope of UB, but should be easier to deal with
buggy software.
2020-02-08 17:06:03 +00:00
christos e404e1832c there is no potential overflow anymore (thanks Kamil) 2020-02-07 23:28:59 +00:00
christos 73c6a60ccf stop using sprintf and check for buffer overflow. 2020-02-07 22:13:35 +00:00
ryoon 2da2192d78 Remove trailing whiteapaces and tab 2020-02-05 14:56:04 +00:00
kamil 91719d9fbd Retire ifdef ERRORCHECK in pthread(3)
It is enabled unconditionally since 2003 and used only for rwlocks and
spinlocks.

LLVM sanitizers make assumptions that these checks are enabled always.
2020-02-05 11:05:10 +00:00
wiz d210ba75a0 Remove trailing whitespace. 2020-02-05 08:14:36 +00:00
christos 8d83da913d Mention that we don't honor the other mode bits. 2020-02-04 18:36:16 +00:00
kamil 31ebab1943 Revert previous
'git grep' breaks now.
2020-02-01 18:14:16 +00:00
kamil f93ad70739 Remove 'ifdef 0' hacks
It is no longer needed as the proper fix avoiding premature malloc()
landed the sources.
2020-02-01 15:39:56 +00:00
kamil 089c97bd22 Switch atform allocations from malloc()+free() to mmap()+munmap()
This avoid bootstrapping malloc too early when libc+libpthread are not
ready. It is called through pthread__init() -> _pthread_atfork().

This also helps LLVM Leak Sanitizer to pacify false positive reports.
2020-02-01 15:38:46 +00:00
kamil 260b3a1721 Refactor libpthread checks for invalid arguments
Switch from manual functions to pthread__error().
2020-01-31 17:52:14 +00:00
christos bbb79fe856 In the same spirit as the previous pthread_mutex_init change for jemalloc,
make pthread_mutexattr_init do always a full initialization, so that the
attribute that will be used later when we become threaded is properly
initialized.
2020-01-31 02:37:46 +00:00
joerg 782b126d2c Provide frexpl on non-long-double systems as alias to frexp. 2020-01-30 20:31:50 +00:00
kamil 12ee584ac8 Use pthread_mutexattr_t and pthread_mutex_t magic fields
Validate _PT_MUTEX_MAGIC in pthread_mutex_t and _PT_MUTEXATTR_MAGIC
in pthread_mutexattr_t accordingly.
2020-01-29 21:11:24 +00:00
ad fb0af629d1 - pthread_join(): remove temporary hack now kernel returns correct errno.
- kill(getpid(), SIGABRT)  ->  _lwp_kill(_lwp_self(), SIGABRT)
2020-01-29 17:11:57 +00:00
kamil 08c17fb31c Check thread->pt_magic with PT_MAGIC promptly 2020-01-29 16:34:09 +00:00
kamil 20668e1417 Chack thread->pt_magic with PT_MAGIC promptly
Rearrange some checks to avoid verifying pthread_t after using it.
2020-01-29 16:03:44 +00:00
kamil ac02e87024 Revert previous
Two assignments are correct.
2020-01-29 15:31:14 +00:00
kamil 0b0b4cd405 Do not set stackbase2 twice for !__MACHINE_STACK_GROWS_UP 2020-01-29 15:15:00 +00:00
kamil e06a99c91d Use pthread_condattr_t and pthread_cond_t magic fields
Validate _PT_CONDATTR_MAGIC and _PT_COND_MAGIC respectively.
2020-01-29 15:07:46 +00:00
kamil 7f6f4173b3 Use pthread_barrierattr_t and pthread_barrier_t magic fields
Set respectively _PT_BARRIER_DEAD for pthread_barrier_destroy() and
_PT_BARRIERATTR_DEAD for pthread_barrierattr_destroy().

Validate _PT_BARRIER_MAGIC in pthread_barrier_t and _PT_BARRIERATTR_MAGIC
in pthread_barrierattr_t accordingly.
2020-01-29 14:41:57 +00:00
kamil b3401c13c3 Use the pta_magic field in pthread attribute
Set PT_ATTR_DEAD on pthread_attr_destroy().
Check pta_magic before using pthread_attr_t in a bunch of other functions.
2020-01-29 13:47:31 +00:00
kamil d48cac510b Mark destroyed pthread_mutexattr_t as dead 2020-01-29 10:55:23 +00:00
ad c6559e920a - A bit more alignment in __pthread_st especially for the rbtree node.
- Use COHERENCY_UNIT from sys/param.h.
2020-01-28 13:08:40 +00:00
ad a15e545ef6 pthread_join(): add a temporary hack to make lib/libpthread/t_detach pass.
The correct fix is to do this in kernel (I have that change, but it's part
of the wider change to index LWPs in a tree).
2020-01-28 09:23:15 +00:00
ad 60f1ad4e64 Make x86 use the C versions of bcmp() and memcmp(). 2020-01-27 22:08:08 +00:00
ad cd1754ab41 pthread_detach(), pthread_join(): go back to using _lwp_detach() and
_lwp_wait(), rather than doing it all in userspace.  There's less to go
wrong.  Doesn't seem to be a performance penalty.
2020-01-27 20:50:05 +00:00
ad e354694931 Adjustment to previous: don't call _lwp_unpark_all() with nwaiters == 0. 2020-01-25 18:30:41 +00:00
ad 047ca71b68 pthread_exit(): it looks there there is at least one path through which
a thread can exit with waiters still hanging off it (cancellation when
waiting on a condvar) so deal with all/any crappy failure like that and
make sure there are never any waiters left before exiting.  Maybe of help
for:

PR: bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2
2020-01-25 18:01:28 +00:00
ad 769155beb0 pthread__mutex_unlock_slow(): ignore the DEFERRED bit. It's only purpose
is to get the thread to go through the slow path.  If there are waiters,
process them there and then.  Should not affect well behaved apps.  Maybe
of help for:

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad
2020-01-25 17:58:28 +00:00
ad edf01486dd - Fix a race between the kernel and libpthread, where a new thread can start
life without its self->pt_lid being filled in.

- Fix an error path in _lwp_create().  If the new LID can't be copied out,
  then get rid of the new LWP (i.e. either succeed or fail, not both).

- Mark l_dopreempt and l_nopreempt volatile in struct lwp.
2020-01-25 15:41:52 +00:00
pgoyette fccfbe317e Fix name of keyword so it will worwk correctly. :) 2020-01-23 16:34:12 +00:00
mgorny ac78ffd6ff Fix using gcc's unwind.h 2020-01-22 16:07:40 +00:00
mgorny 26a48dd100 Install gcc's unwind.h instead of libexecinfo's
The prototypes in libexecinfo's unwind.h do not match those commonly
used (e.g. by gcc, clang, GNU libunwind, LLVM libunwind...), causing
C++ programs to fail to build on type mismatches (e.g. compiler-rt,
libc++abi).  Rather than providing our own header, reuse the one
included in gcc.
2020-01-22 15:10:31 +00:00
kamil e4e4859de1 Adjust the error return value of pthread_sigmask for !libpthread usage
Instead of returning -1, return errno on error.

Catch up after the fix in libpthread by Andrew Doran in 2008
in lib/libpthread/pthread_misc.c r.1.9.

It's an open question whether this function shall be used without linked
in the POSIX thread library.

Detected by Bruno Haible (GNU) and documented in gnulib in commit
"pthread_sigmask: Avoid test failure on NetBSD 8.0. " r. 4d16a83b0c1fcb6c.
2020-01-14 18:18:59 +00:00
joerg 174eb28ace Fix atfork malloc handling to include all the locks in old jemalloc. 2020-01-13 19:14:37 +00:00
joerg 2de10fd665 Fix aarch64 definition in old jemalloc
There is no platform-specific reason for avoiding TLS. The tiny
allocations should be aligned the same as small allocations for ABI
reasons.
2020-01-13 19:14:02 +00:00
ad 510021886a Rip out some very ambitious optimisations around pthread_mutex that are
don't buy much.  This stuff is hard enough to get right in the kernel let
alone userspace, and I don't trust that it's right.
2020-01-13 18:22:56 +00:00
abhinav 2d114b3c14 PR lib/54510 - when user supplied completion function is there,
don't unescape the string to be completed.
2020-01-05 07:12:05 +00:00
tih 52de8937af Summary: Remove over-simplified extraneous test
The file name matching code in libedit tries to adjust to the presence
of explicit " or ' characters in the input line, but tries too hard.
Remove a conditional that goes overboard, and causes the completion
code to fail if a quoted string is seen before the filename to be
expanded, as in

	  grep 'foo' bar<TAB>

Before this change, the above would not expand any possible
completions, even if they existed, because it would choose to look for
files whose names started with " bar".
2020-01-05 00:03:27 +00:00
kamil 4677d24ff4 Document PT_LWPSTATUS and PT_LWPNEXT in ptrace(2)
Remove mentions of obsolete PT_LWPINFO.
2020-01-04 04:40:17 +00:00
msaitoh 417c7af79c s/conjuction/conjunction/ 2019-12-27 10:13:59 +00:00
msaitoh ba5c90c4a4 s/sucess/success/ in comment. 2019-12-27 09:45:26 +00:00
msaitoh a0403cde04 s/transfered/transferred/ 2019-12-27 09:41:48 +00:00
msaitoh a5effc3ce9 s/inital/initial/ 2019-12-27 09:25:57 +00:00
msaitoh 40064e2457 s/lenght/length/ 2019-12-26 04:53:11 +00:00
joerg 8e5b2c30bd Since pthread_setspecific requires locks, ensure that they are acquired
before fork and dropped in both parent and child. At least Python
depends on TSD after fork, even though it is undefined behavior in
POSIX.
2019-12-25 00:44:45 +00:00
reed 030d4fb522 Simply Subsection headers
There was a formatting issue with mandoc showing the
literal "Ss" macros. I reported this bug to mandoc since groff
didn't have same formatting. It was recommended to simplify
the formatting due to the weird feature.
Note because of this for groff I didn't use the Ux macro but spelled
out UNIX literally for these subsection headers
(since the macro reset the subsection formatting which was why
the Ss macro was repeated before to reactivate it).
2019-12-23 17:51:57 +00:00
kamil cd653c6e17 Explain in kevent(2) the semantics of EINTR
All changes contained in the changelist are applied before returning this
error.
2019-12-23 01:46:09 +00:00
kamil e6ecafaf7d Document udata type switch in struct kevent in the kqueue(2) 2019-12-22 17:01:15 +00:00
leot 4bf7b66e0f tcgetsid() is defined in <termios.h>, not <sys/types.h> or <unistd.h>. 2019-12-19 16:12:21 +00:00
joerg 7ed25834ce Bump PTHREAD__UNPARK_MAX to 128 as bandaid for locking related hangs. 2019-12-18 15:11:57 +00:00
christos 8282cab4e4 move file/lib after xz 2019-12-18 02:46:21 +00:00
uwe df1f230d9f pthread__rwlock_spin - clarify the test.
It's more pedantically correct to check RW_WRITE_LOCKED before
obtaining the thread id of the owner.  And since there must be an
owner annotate the guard NULL check as unlinkely.

No functional change intended.  Ok ad@.
2019-12-16 22:22:11 +00:00
uwe ba77a23d10 G/c unused rwlock owner macros copy-pasted from the kernel.
They were brought along with the rwlock flags but never used and never
even adapted to the new home (the struct member name is different
here).  I looked at adapting and using them, but they don't really
help readability that much and there are cases where we need to deal
with "fused" owner values anyway and so can't use them.
2019-12-16 20:45:40 +00:00
uwe 067b84db7c _DIAGASSERT that RW_FLAGMASK bits are not set in a thread pointer.
rwlock uses lower bits of a thread pointer for flags in the lock owner
field.  Assert that the pointer is properly aligned and those bits are
actually free to use.  This may not be the case when a program uses
its own allocator that can return less aligned pointers.
2019-12-15 23:13:33 +00:00
uwe 68463fd203 Drop bogus _DIAGASSERT that don't even compile. 2019-12-15 22:32:29 +00:00
joerg ae9905d569 PR 54619: Remove semaphore limit introduce as part of GSoC 2016 with
_SC_SEM_NSEMS_MAX. Report no limit for getconf(3). The ressource is
naturally limited by the backing file descriptor, so no separate limit
is necessary. Keep the accounting for debugging as it is part of the
sysctl ABI exposed by the kernel.
2019-12-15 20:25:25 +00:00
ad 5f087b6f0f Redo previous more conventionally. Requested by kre@. 2019-12-11 20:19:27 +00:00
christos 5e9cbb1173 When 'attempted_completion_function' non-NULL, with a 'single_match'
match, the expected space is not being added. Problem observed with
"chronyc" and "sqlite3" tab completion. That functionality got
moved to escape_filename() for the !attempted_completion_function
case, but the non-NULL 'attempted_completion_function' case must
also be handled. (Lonnie Abelbeck)
2019-12-10 19:42:09 +00:00
ad c470496698 Mask out always zero bits off pg->phys_addr. 2019-12-10 18:13:07 +00:00
riastradh 1ec67535be Add missing MLINK for membar_datadep_consumer(3).
Detected by the indefatigable wizd.
2019-12-07 15:13:59 +00:00
wiz ec6e765cf3 Remove trailing whitespace. 2019-12-07 12:47:07 +00:00
pgoyette ac676e6637 Note also that the load address (if provided) is also for the module's
text segment.
2019-12-06 21:45:14 +00:00
christos 95fb71b3fc Correct the man page, and say that the printf(3) format characters need
to be uintmax_t.
2019-12-06 19:31:52 +00:00
nros fe9bbf72d9 Fix manpage due to updated aligned_alloc behavior
Since aligned_alloc does not demand that size is to be multiple of alignment
anymore, don't make that claim in the man page.
2019-12-06 16:19:32 +00:00
pgoyette c5b5c0a464 Note that the size returned by modctl(2) and displayed by modstat(8) is
only for the module's text section, not for the entire size of the module.

Addresses PR kern-54737
2019-12-04 23:35:36 +00:00
christos da2b6a5521 Add cfi annotations so that gdb can unwind the stack through signal handlers. 2019-12-02 01:38:54 +00:00
nakayama b7b6f4ad9a Fix PR/54074 and PR/54093 completely.
More similar to the ld.elf_so logic, it is necessary to align with
p_align first.  Also, invert the #ifdef condition for consistency.

Should fix regression for static linking binaries:
http://releng.netbsd.org/b5reports/sparc/commits-2019.11.html#2019.11.10.23.39.03
http://releng.netbsd.org/b5reports/sparc64/commits-2019.11.html#2019.11.16.04.10.33
2019-11-21 23:06:15 +00:00
christos b9ecc063aa PR/54654: Soren Tempel: Make sure el_cursor.v < el_terminal.t_size.v when
moving around.
2019-11-12 20:59:46 +00:00
joerg 76c7fc5f6b Update LLVM to 10.0.0git (01f3a59fb3e2542fce74c768718f594d0debd0da) 2019-11-11 22:44:56 +00:00
joerg 8b42e4de60 Mirror the ld.elf_so logic for handling aligning the TLS size.
Most noticable, recompute the start of the TLS area for variant I
relative to the TCB. This makes a difference when the segment size and
base alignment don't agree.
2019-11-07 22:25:21 +00:00
joerg 336e4f812b Use alignof and not size_t for platforms with non-natural base
alignments.
2019-11-05 22:22:42 +00:00
joerg a0e0f8b685 PR 54093: Align static TLS area to max_align_t. 2019-11-04 12:45:10 +00:00
isaki 5b3dd8b1b9 Use record field for recording even on
SNDCTL_DSP_STEREO, SNDCTL_DSP_SETFMT, and SNDCTL_DSP_CHANNELS.
2019-11-03 11:13:45 +00:00
tnn 3896b31418 puffs_null_node_fsync: don't leak directory handle
Directory handles returned by opendir must be closed by closedir.
Also directory(3) says we mustn't close(2) descriptors returned by dirfd(3)
2019-11-02 18:14:36 +00:00
isaki d97643b742 Use record.sample_rate for recording on SNDCTL_DSP_SPEED.
Fix PR lib/54667.
2019-11-02 11:48:23 +00:00
joerg fc0c7dc82c Always include soft-float compare and order logic in libc when using
compiler-rt.
2019-10-29 16:08:50 +00:00
joerg 7e53a6c032 Annotate a covering switch as such to avoid warnings about missing
returns.
2019-10-28 18:12:17 +00:00
maxv 3ed59424a4 should be fork(2), noticed by wiz 2019-10-28 14:20:28 +00:00
wiz d1b0fb4965 Macro tidyness. 2019-10-28 13:43:42 +00:00
maxv a5a9b7903f A few changes:
- Use smaller types in struct nvmm_capability.
 - Use smaller type for nvmm_io.port.
 - Switch exitstate to a compacted structure.
2019-10-28 08:30:49 +00:00
maxv d2ac291e7d Change the way root_owner works: consider the calling process as root_owner
not if it has root privileges, but if the /dev/nvmm device was opened with
write permissions. Introduce the undocumented nvmm_root_init() function to
achieve that.

The goal is to simplify the logic and have more granularity, eg if we want
a monitoring agent to access VMs but don't want to give this agent real
root access on the system.
2019-10-27 20:17:36 +00:00
pgoyette 0c89d4ea55 accept() is a function, not an argument! 2019-10-27 12:28:13 +00:00
maxv 93f947bbaa Add a new VCPU conf option, that allows userland to request VMEXITs after a
TPR change. This is supported on all Intel CPUs, and not-too-old AMD CPUs.

The reason for wanting this option is that certain OSes (like Win10 64bit)
manage interrupt priority in hardware via CR8 directly, and for these OSes,
the emulator may want to sync its internal TPR state on each change.

Add two new fields in cap.arch, to report the conf capabilities. Report TPR
only on Intel for now, not AMD, because I don't have a recent AMD CPU on
which to test.
2019-10-27 10:28:55 +00:00
maxv 06a4f19afb Use the new PTE naming, and define CR3_FRAME_* separately. No functional
change.
2019-10-27 08:30:05 +00:00
maxv a6418236ed Add the "nvmm" group, and make nvmm_init() public. Sent to tech-kern@ a few
days ago.
2019-10-27 07:08:15 +00:00
christos f20a32fee4 Separate the NetBSD-specific fenv functions from the standard ones.
No functional change.
2019-10-26 17:57:20 +00:00
maxv 39beb8bb08 Update the libnvmm man page:
- Sync the naming with reality.

 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.

 - Add a "VCPU Configuration" section.

 - Add a "Machine Ownership" section.
2019-10-25 09:09:24 +00:00
kamil 77a1ad5f00 Switch the iconv(3) prototype to the POSIX conformant variation
Remove const from the 2nd argument.

const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).

Keep the const form for the internal purposes inside citrus and rump.

Address the build breakage fallout in the same change.

There are no ABI changes.

Change accepted by core@.
2019-10-24 18:17:14 +00:00
maxv e6f32a5866 Three changes in libnvmm:
- Add 'mach' and 'vcpu' backpointers in the nvmm_io and nvmm_mem
   structures.

 - Rename 'nvmm_callbacks' to 'nvmm_assist_callbacks'.

 - Rename and migrate NVMM_MACH_CONF_CALLBACKS to NVMM_VCPU_CONF_CALLBACKS,
   it now becomes per-VCPU.
2019-10-23 12:02:55 +00:00
maxv f9fb7866ce Miscellaneous changes in NVMM, to address several inconsistencies and
issues in the libnvmm API.

 - Rename NVMM_CAPABILITY_VERSION to NVMM_KERN_VERSION, and check it in
   libnvmm. Introduce NVMM_USER_VERSION, for future use.

 - In libnvmm, open "/dev/nvmm" as read-only and with O_CLOEXEC. This is to
   avoid sharing the VMs with the children if the process forks. In the
   NVMM driver, force O_CLOEXEC on open().

 - Rename the following things for consistency:
       nvmm_exit*              -> nvmm_vcpu_exit*
       nvmm_event*             -> nvmm_vcpu_event*
       NVMM_EXIT_*             -> NVMM_VCPU_EXIT_*
       NVMM_EVENT_INTERRUPT_HW -> NVMM_VCPU_EVENT_INTR
       NVMM_EVENT_EXCEPTION    -> NVMM_VCPU_EVENT_EXCP
   Delete NVMM_EVENT_INTERRUPT_SW, unused already.

 - Slightly reorganize the MI/MD definitions, for internal clarity.

 - Split NVMM_VCPU_EXIT_MSR in two: NVMM_VCPU_EXIT_{RD,WR}MSR. Also provide
   separate u.rdmsr and u.wrmsr fields. This is more consistent with the
   other exit reasons.

 - Change the types of several variables:
       event.type                  enum -> u_int
       event.vector                uint64_t -> uint8_t
       exit.u.*msr.msr:            uint64_t -> uint32_t
       exit.u.io.type:             enum -> bool
       exit.u.io.seg:              int -> int8_t
       cap.arch.mxcsr_mask:        uint64_t -> uint32_t
       cap.arch.conf_cpuid_maxops: uint64_t -> uint32_t

 - Delete NVMM_VCPU_EXIT_MWAIT_COND, it is AMD-only and confusing, and we
   already intercept 'monitor' so it is never armed.

 - Introduce vmx_exit_insn() for NVMM-Intel, similar to svm_exit_insn().
   The 'npc' field wasn't getting filled properly during certain VMEXITs.

 - Introduce nvmm_vcpu_configure(). Similar to nvmm_machine_configure(),
   but as its name indicates, the configuration is per-VCPU and not per-VM.
   Migrate and rename NVMM_MACH_CONF_X86_CPUID to NVMM_VCPU_CONF_CPUID.
   This becomes per-VCPU, which makes more sense than per-VM.

 - Extend the NVMM_VCPU_CONF_CPUID conf to allow triggering VMEXITs on
   specific leaves. Until now we could only mask the leaves. An uint32_t
   is added in the structure:
	uint32_t mask:1;
	uint32_t exit:1;
	uint32_t rsvd:30;
   The two first bits select the desired behavior on the leaf. Specifying
   zero on both resets the leaf to the default behavior. The new
   NVMM_VCPU_EXIT_CPUID exit reason is added.
2019-10-23 07:01:11 +00:00
wiz a7c88536f5 Mark up argon2 description. Restore removed lines/text from previous
commit.
2019-10-21 05:16:51 +00:00
jhigh b302373f87 adding argon2 support to libcrypt. argon2 user authentication now
available via MKARGON2=yes (3 variants supported; argon2id recommended)
before using, please read argon2 paper at
https://github.com/P-H-C/phc-winner-argon2
2019-10-21 02:36:48 +00:00
maxv e1d43b1e6d Put back 'default', because llvm apparently doesn't realize that all cases
are covered in the switch.
2019-10-19 19:45:10 +00:00
maya 27d953155b Provide sysconf(_SC_RTSIG_MAX) = SIGRTMAX - SIGRTMIN
Thanks nros@ for the correct definition
2019-10-16 20:43:18 +00:00
maxv fabc9bf218 Improve nvmm_vcpu_dump(). 2019-10-14 10:43:40 +00:00
maxv c496a7b118 Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.

Part of PR/54611.
2019-10-14 10:39:24 +00:00
mrg 69f9039379 use GCC_NO_CAST_FUNCTION_TYPE. 2019-10-13 21:24:37 +00:00
maxv 416eaf02dc Fix incorrect parsing: the R/M field uses a special GPR map when the
address size is 16 bits, regardless of the actual operating mode. With
this special map there can be two registers referenced at once, and
also disp16-only.

Implement this special behavior, and add associated tests. While here
simplify a few things.

With this in place, the Windows 95 installer initializes correctly.

Part of PR/54611.
2019-10-13 17:32:15 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
nros 951054b00a Add manpage links for frexpf and frexpl.
Manpage links were missing for frexpf and frexpl even thogh they were
mentioned in the manpage for frexp.
2019-10-11 18:36:22 +00:00
kre 6b0ab5c5ab More cases to disable gcc-8 warnings only when we're using gcc>=8 2019-10-10 08:37:16 +00:00
kre 5dc161e026 Only exclude gcc-8 warnings if the gcc we're using is gcc>=8 2019-10-10 02:39:07 +00:00
kre bab7747200 Only exclude gcc-8 warnings when the gcc we're using is gcc>=8 2019-10-10 02:35:45 +00:00
christos c60bf2342e Add -Wno-error for gcc-8 warnings 2019-10-09 23:39:20 +00:00
christos 39877bf076 bump size 2019-10-09 23:23:41 +00:00
christos b15dac3ccb don't warn for strncpy wtmp fields, they are not NUL terminated. 2019-10-09 22:05:35 +00:00
christos cc33d2efa6 no error for function cast 2019-10-09 22:05:09 +00:00
christos a47ebb18b3 add +1 to strlcpy's (Patrick Welche) 2019-10-09 14:31:07 +00:00
wiz 45ba2af5df Fix xref. 2019-10-09 14:20:47 +00:00
kamil 2dc9ce6014 Document PT_STOP, update PT_KILL in the ptrace(2) man-page
Formatting by <mgorny>
2019-10-09 13:42:37 +00:00
christos cdd1ab83dc remove useless packed attributes 2019-10-08 19:38:38 +00:00
christos 39fd362275 use strlcpy (the buffer is already zeroed) 2019-10-08 19:38:27 +00:00
christos 3df2b62655 remore error(1) comment 2019-10-08 19:21:40 +00:00
christos 991f62167b Change strncpy to either memcpy (when we know the len), or strlcpy (when
we used to NUL terminate explicitly.
2019-10-08 19:17:57 +00:00
christos bfdd69f658 -Wstringop-truncation is only gcc. 2019-10-08 18:50:34 +00:00
uwe 86bd1b8280 getlogin_r: use strcpy(). We check namelen before copying the result.
gcc 8 -Wstringop-overflow is uhappy when the specified bounds depend
on the length of the source and is not smart enough to see the check
we do.  Besides we don't want the padding effect of strncpy() here.
2019-10-05 19:19:51 +00:00
uwe fdee483c8f __dberr: tweak signature to make gcc8 -Wbad-function-cast happy about
casts in __dbpanic.  Admittedly this is a bit too "cute".
2019-10-05 18:07:58 +00:00
jhigh c7ab523edc adding full scheme comparison to libcrypt:crypt and pwhash tests 2019-10-05 18:06:16 +00:00
uwe da97884ede __dbpanic: use the official DB typedef name in the casts. They were
copied from the declaration point where it's not yet available.
2019-10-05 18:01:52 +00:00
christos c8863f455b deduplicate the conversion function from statvfs -> statfs12 2019-10-04 01:28:02 +00:00
christos 573d865676 Ignore strncpy(foo, bar, sizeof(foo)) for the wtmp fields where we don't
want NUL termination. We can't use pragma's because the old gcc complains
about the new warnings it does not understand.
2019-10-04 00:03:56 +00:00
tnn 00bf802c59 annotate __dead 2019-10-03 20:29:19 +00:00
christos 5c84fc8d45 provide a default error function instead of trying to cast exit(3). 2019-10-03 18:12:44 +00:00
christos d97b323d0b Cast function pointers that take different arguments through void * 2019-10-03 18:02:05 +00:00
christos d3574aa770 - user (an alias to the login buffer should be NUL terminated so use strlcpy
- double the size of the resulting buffer so that it can fit a copy of the
  same sized buffer + more.
2019-10-03 17:56:17 +00:00
christos ae8d4ecfdb Use strlcpy to NUL terminate the name string here. The kernel already
uses strlcpy() to set values in this field. We leave the kernel's strncmp()
alone to maintain compatibility.
2019-10-03 17:10:16 +00:00
christos 194e441521 use strlcpy here; the destination string is passed to strtok_r, and if it
is not NUL terminated, bad things can happen.
2019-10-03 17:08:26 +00:00
christos 01d1183f90 Since ch gets reassigned, it is not certain that it will be & or | again,
so return an illegal token if it is not instead of telling the compiler
that this is impossible.
2019-10-03 16:37:45 +00:00
christos b490ea0c99 provide sizes so that we don't truncate accidentally. 2019-10-03 16:35:57 +00:00
rmind 04cb50ac51 libnpf/npfctl: support dynamic NAT rulesets using a name prefix. 2019-09-30 00:37:11 +00:00
mrg 21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
wiz 9d3e825cb4 Sort errors. Remove trailing whitespace. 2019-09-27 07:20:07 +00:00
christos 75a357d94d document errors returned by F_GETPATH 2019-09-26 17:13:52 +00:00
christos ed9ca5deea teach hijack about the new vfs syscalls 2019-09-25 20:19:59 +00:00
christos accd2f2682 lint is not smart enough to figure out that ilog2() is constant. 2019-09-23 18:17:03 +00:00
christos 38a0431bfa Restore binary compatibility by using the statvfs90 structure internally. 2019-09-23 12:00:57 +00:00
christos 02cdd248ec Add a new member to struct vfsstat and grow the unused members
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
2019-09-22 22:59:37 +00:00
brad 2e0a32871b Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
2019-09-22 18:45:19 +00:00
wiz 911f6cb213 Sort errors; remove two more duplicates. 2019-09-18 04:57:53 +00:00
christos 26260efb9b merge the two E2BIG entries (wiz) 2019-09-16 11:03:08 +00:00
wiz 5a2de753fb Sort errors. 2019-09-16 04:59:32 +00:00
wiz 4799815d98 Add missing word, add comma in enumeration. 2019-09-16 04:54:23 +00:00
wiz 6cc77413c5 Add missing word, fix typo, remove trailing whitespace. 2019-09-16 04:49:46 +00:00
kamil 889b81b138 Remove _INCOMPLETE_XOPEN_C063, no longer needed 2019-09-16 01:25:16 +00:00
kamil d3dd6160fd Stop passing -D_INCOMPLETE_XOPEN_C063 (obsolete define) 2019-09-16 00:00:56 +00:00
christos a5a5a01f84 Fix type and remove cast (Yuichiro NAITO/FreeBSD). 2019-09-15 21:09:11 +00:00
christos 6f91a43aa9 Document O_EXEC, and add some extra explanation for O_CREAT from FreeBSD. 2019-09-15 20:53:24 +00:00
christos 20f72bdb4e documentation for fexecve(2) 2019-09-15 16:55:00 +00:00
christos 0a76d2ed5a Add F_GETPATH, presented to tech-kern. 2019-09-15 16:25:57 +00:00
wiz 5ac2498fa8 Fix markup, and remove two superfluous Pp. 2019-09-15 07:01:13 +00:00
christos 9aeb91c2c4 fix wrong names and add markup 2019-09-15 01:03:23 +00:00
mlelstv d87f421944 Need register defines that were moved to armreg.h 2019-09-12 10:18:50 +00:00
kamil 36ec32beff Switch back _Noreturn to __dead in C11 threads
There is an ongoing discussion to unify unreturn attribute between C and
C++, making a compatible version, shared between languages. Instead of
picking C11-only approach here, switch back to __dead that wraps the
compiler extension for the same purpose.

This change makes this header more compatible with C++ and pre-C11.

Reference:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf
2019-09-10 22:34:19 +00:00
wiz 5f4f33c6a5 Remove superfluous Pp. 2019-09-09 07:46:49 +00:00
sevan fb87f380ab mprotect first appeared in SunOS 4.0
Page 25 of SunOS 4.0 Change Notes
http://chiclassiccomp.org/docs/content/computing/Sun/software/800-1731-10_SunOS4.0ChangeNotes9May88.pdf
2019-09-08 22:35:44 +00:00
sevan 7e18ab6233 Extend history 2019-09-08 17:47:33 +00:00
sevan a4cf051b9a Sort flags 2019-09-08 17:24:49 +00:00
sevan 4fef48b525 Document MAP_ANONYMOUS 2019-09-08 17:17:55 +00:00
uwe 6ba5b90bdf Use the right values for .Bl -width
Typeset "fuse" literal (default value for type) as a literal.
2019-09-08 11:34:56 +00:00
abhinav c3d00a7d30 PR lib/54510: Fix file completion inside quotes which broke in rev 1.53
While there also fix handling character appending in the file completions when
inside quotes. For example when inside a quote, if the completion is a directory then
append a '/' but don't close the quote. On the other hand when inside a quote if the
completion is a file name and it is the only match then we can close the quote.
2019-09-08 05:50:58 +00:00
wiz 2583d20169 Add missing word. More markup. 2019-09-07 19:32:11 +00:00
wiz d46d61dd74 Punctuation nit. 2019-09-07 19:30:39 +00:00
sevan 16210d39ba New sentence, new line 2019-09-07 13:17:43 +00:00
sevan 1cd8c1fa55 Document the destiny for these functions. 2019-09-07 12:40:17 +00:00
sevan 9e150b2d97 Document sbrk() history and adjust brk()'s.
via Ingo Schwarze <schwarze@OpenBSD>
2019-09-07 11:59:42 +00:00
sevan d149c91d7e Document history 2019-09-07 11:53:27 +00:00
christos 8d1f0ec42c Since we advance cp after the bounds check, we need to test for bounds
again before using it. Discovered via fuzzing, reported by enh at google, via:
    https://android-review.googlesource.com/c/platform/bionic/+/1093130
2019-09-04 12:14:09 +00:00
roy cc96515f67 curses: believe in unicorns
Hopefully this ends the bikeshed.
If you don't believe in unicorns, please #if 0 it out to preserve
the humour.
2019-09-03 13:43:34 +00:00
roy b02c2cea81 curses: Add __NetBSD_Curses_Version__
Similar to __NetBSD_Version__ from sys/param.h but has no
correlation to it or the ELF symver libcurses is built as.

If we say that v1 was everything prior to this, it makes sense to
start this from v2.
2019-09-03 10:36:17 +00:00
roy c977d4cfab curses(3): add curses_version()
Returns NetBSD-Curses %s
Where %s is the NetBSD version taken from sys/param.h

Discussed on tech-net@, only for ncurses compat.
2019-09-02 09:08:29 +00:00
sevan d284e45ce6 Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:51:48 +00:00
sevan 5856ef0738 putc & putw were in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf
putchar was in v4
https://minie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man3/putchr.3
2019-09-02 00:48:16 +00:00
sevan e7c2f0e667 log appeared in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:37:47 +00:00
sevan 045ae074b5 Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:30:58 +00:00
sevan a8ce1a4d96 exp was present in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:25:47 +00:00
sevan d051e0b21d start documenting history 2019-09-02 00:24:01 +00:00
sevan 211298066f write was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:13:09 +00:00
sevan 35c5311442 wait was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:12:11 +00:00
sevan b26b6614cd unlink was presen in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:09:14 +00:00
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 fbcb2c65d6 stty & gtty were around since v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-01 23:42:19 +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
martin 0c393ecfe5 Include libnv directly into this library 2019-08-27 14:54:17 +00:00
riastradh ab94299db0 Fix feraiseexcept.
- Don't touch the trap flags (though on all ARMv8 I know they have no
  effect anyway).

- Don't clear any existing raised exception flags; just add to them.

XXX atf test
XXX pullup-9
2019-08-25 18:59:52 +00:00
riastradh f527f35001 Fix fesetenv and feupdateenv.
- fesetenv is supposed to set the stored rounding mode (and stored trap
  settings, but they have no effect on any ARMv8 I know).

- feupdateenv is supposed to re-raise the exceptions that were raised
  in the environment when it was called.

XXX atf test
XXX pullup-9
2019-08-25 18:31:30 +00:00
rmind 0dd7abe473 libnpf fix: link the library itself to libnv; libnpf users should not be
expected to assume this dependency.
2019-08-24 13:20:52 +00:00
mrg 1db21b1df3 fix MKCXX=no:
- don't build GDB
- don't build sanitizers
- don't build GCC commands
- fix some set lists
2019-08-23 08:17:26 +00:00
brad c59f01cb01 Teach getdiskrawname and getdiskcookedname about zvols.
Reviewed by Christos
2019-08-22 20:23:43 +00:00
rmind 0e1944da36 npfkern/libnpf: Add support for the table replace/swap operation.
Contributed by Timshel Knoll-Miller.
2019-08-21 21:45:47 +00:00
christos a909d35bd1 Increment offset when adding an element to history to keep it aligned with
the last element entered (Sandy Li Changqing)
2019-08-21 11:11:48 +00:00
manu bf00e86bc9 Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.
A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.
2019-08-10 07:08:11 +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