PTRACE_VFORK - report vfork(2)-like operations and trace child
PTRACE_VFORK_DONE - report unblocking the parent after vfork(2)-like call
Note that PTRACE_VFORK is currently unimplemented and returns ENOTSUP.
Sponsored by <The NetBSD Foundation>
- syslog_ss.c *_ss api functions (don't use stdio, time)
- syslog.c: *syslog* non _ss api functions (use stdio, time)
- xsyslog.c> common guts.
The motivation for this is not to drag in stdio/locale/floating point/time
for every binary, since syslog_ss() is used in __stack_check_fail() for SSP.
Store ripped off lines in the SCREEN structure so we can repaint then
when the terminal is resized.
Fix mvwin(3) so it can move windows in the ripped off area.
Explain:
- execve(2) handling and behavior, SIGTRAP & TRAP_EXEC
- reference PaX MPROTECT restrictions for debuggers
- software breakpoints handling and behavior, SIGTRAP & TRAP_BKPT
- single step behavior, SIGTRAP & TRAP_TRACE
- list predefined MI symbols for help debuggers in port specific headers
- explain that PT_TRACE_ME does not send a SIGSTOP signal
Sponsored by <The NetBSD Foundation>
PT_SET_SIGINFO - fake signal information emitted to tracee
PT_GET_SIGINFO - read signal information routed to tracee
Sponsored by <The NetBSD Foundation>
The PT_GET_PROCESS_STATE call in ptrace(2) has the following usage of addr
and data:
A pointer to this structure is passed in addr. The data
argument should be set to sizeof(struct ptrace_event).
Sponsored by <The NetBSD Foundation>
-0.0 > 0 is also false. no functional change.
while this is mostly a change to be consistent in style (the rest of the
comparisons aren't done with signbit), it is also a micro-optimization.
with our default compile flags, calls to copysign are libm calls (and a
whole function call!!). this generates more efficient code.
delicacy in order to maintain continuity around it.
we have an initial case to deal with a fairly common case: getting
a real number. Avoid dealing with the branch cut in this case by
checking if the real part is negative.
later, -0.0 < 0 is not met, so instead, test for a negative number
using signbit, so negative zero is also treated as a negative number.
Fixes last part of PR lib/51427: libm issues triggered by py-numpy
ok riastradh
The former allows the ncurses (and pdcurses) macros getsyx and setsyx
to be implemented, which is needed by a surprising number of applications.
The latter is needed for Python curses support so it doesn't have to dive
into ncurses window structure.
as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.
ok riastradh
rather than [0,61]. The standard has removed mention of double leap seconds.
The standard has give the following rationale in the time.h man page:
"The range [0,60] seconds allows for positive or negative leap seconds.
The formal definition of UTC does not permit double leap seconds, so all
mention of double leap seconds has been removed, and the range shortened
from the former [0,61] seconds seen in previous versions of POSIX."
Currently the PT_DUMPCORE call requires process to be stopped, therefore it
no longer need to warn about stoped tracee to generate consistent data.
Sponsored by <The NetBSD Foundation>
The thread_type is irrelevant as all local POSIX threads are in user-space.
Keep the thread_type member in td_thread_info_st to preserve ABI
compatibility.
Later the remnants from M:N will be refactored in one go with library ABI
version bump.
Sponsored by <The NetBSD Foundation>
td_thr_info - get information on a thread
Currently a subset of td_thread_info_t is documented. This version
describes thread_addr and thread_state.
Sponsored by <The NetBSD Foundation>
Scheduler Activation types were removed in NetBSD 5.0. Old type set is not
matching the new world POSIX threads library.
Only TD_STATE_RUNNING, TD_STATE_ZOMBIE are still applicable - keep it.
Keep TD_STATE_UNKNOWN as generic unrecognized type.
Add new TD_STATE_DEAD one. The TD_STATE_DEAD type is represented by number
6 in the POSIX threads library, but for the sake of compatibility with
older software using pthread_dbg - renumber it to 7, as six was reserved
for TD_STATE_SUSPENDED.
Old removed state types are marked as reserved and unused.
Sponsored by <The NetBSD Foundation>
* Prototypes for fuse_new(3), fuse_mount(3), and fuse_unmount(3) now
matches to the original fuse interface.
* Add fuse_daemonize(3): needs to have a different prototype,
otherwise we can't use puffs_daemon(3).
* Remove fuse_setup(3) and fuse_teardown(3). These obsolete functions
has already been removed from the original interface.
* fuse_main(3) now supports the following command-line options
compatible with the original fuse:
-h, --help print help message
-V, --version print library version (currently does nothing)
-d, -o debug enable debug output (PUFFS_FLAG_OPDUMP), implies -f
-f foreground mode
-s single threaded mode (always enabled for now)
-o fsname=NAME explicitly set the name of the file system
* fuse_main(3) now daemonizes the process by default. This is for the
compatibility with the original fuse.
The pt_magic field is not the first one in the pthread_t structure.
After this fix, this code is confirmed to work and function td_thr_info()
is functional.
Sponsored by <The NetBSD Foundation>
In puffs "create" and "open" are two separate operations with
atomicity achieved by locking the parent vnode. In fuse, on the other
hand, "create" is actually a create-and-open-atomically and the open
flags (O_RDWR, O_APPEND, ...) are passed via fi.flags. So the only way
to emulate the fuse semantics is to open the file with dummy flags and
then immediately close it.
You might think that we could simply use fuse->op.mknod all the time
but no, that's not possible because most file systems nowadays expect
op.mknod to be called only for non-regular files and many don't even
support it.
Either an out-of-band channel, or an in-band sentinel value, could
indicate an error, but an out-of-band sentinel value is a silly
proposition.
Noted by uwe@.
with the trailing newline, others don't so don't make any assumptions
about it when printing. Also print the correct event number (generated),
separate the event number from the event with a tab, and visually encode
the string (don't encode tabs and spaces though).
just ...
ptrdiff_t nitems_max = PTRDIFF_MAX - WORK_AROUND_QTBUG_53071;
ptrdiff_t amax = nitems_max < SIZE_MAX ? nitems_max : SIZE_MAX;
which is just fine if you think about it a little, Unfortunately,
in our zealous effort to never leave a ggc warning unused, and to
treat all of the warnings as fatal errors, that code falls foul of the
"you must not compare an unsigned value with a signed value" warning.
nitems_max is a (signed) largish positive integer (obviously, by
inspection). If it is less than SIZE_MAX then amax is just nitems_max.
In the unlikely case that size_t has less bits than ptrdiff_t so
SIZE_MAX is smaller, amax is limited to SIZE_MAX (which in that case
is known to fit in the ptrdiff_t and to remain positive).
To pacify gcc (and the way the build system uses it), casts are
required. Unfortunately the cast that was installed here was to
convert SIZE_MAX to a ptrdiff_t. Unfortunately when ptrdiff_t has
the same number of bits (or less) as size_t (ie: the common case)
but is signed, (ptrdiff_t)SIZE_MAX is just a fancy way of writing -1.
Rearrange the casting in a way that keeps the original intent
of the code for us (it is actyaly now incorrect if size_t has less
bits than a ptrdiff_t) and keeps gcc happy, all at the same time.
What a mess.
SIZE_MAX is the max value of a size_t (and is unsigned) so when converted
to a ptrdiff_t (int) becomes -1. That's not what the code was attempting
to achieve.
This will be reported upstream to the tzcode maintainers, and we'll see
what variation appears in tzcode2016j ...
Until then, the older code always worked for us, so it will do for now.
This should fix the broken i386 build.
Do use the technical terms `overflow' and `underflow', because strtod
sets ERANGE precisely to indicate either of these two conditions, and
they are the right keywords that one might be looking for.
Note that strtod may set ERANGE even if it returns noninfinity and
nonzero -- specifically, if the result is subnormal. This part was
wrong before I `fixed' it and remained wrong after I `fixed' it
earlier this year.
For example if you do
$mkdir -p /tmp/dir1/dir2
Then:
$ls /tmp/di <TAB> auto completes to
$ls /tmp/dir1/
Hitting <TAB> again auto completes to
$ls /tmp/dir1/dir2
Whereas it should auto complete to
$ls /tmp/dir1/dir2/
Essentially, in cases like above where you have to hit <TAB> twice to get
to the match and there is only one match (because only one file/sub-directory) then
auto complete doesn't work correctly. It doesn't append a trailing slash (in case
of directory) or a space (in case of a file) to the match name.
I have tested file name completion in sh(1) and symbol completion in gdb after
this change.
Add missing __restrict keyword to the first pointer parameter.
It was already used for the second argument, should not be a functional
change and generated code should be the same.
This new form is now aligned with POSIX.
When dealing with high I/O throughput, we could run out of buffer
space if the filesystem was not consuming requests fast enough.
Here we slightly raise the buffer size, and we make it tunable
through the PERFUSE_BUFSIZE environment variable so that we can
cope with higher requirement later.
While there, document PERFUSE_OPTIONS environment variable.
..$RANDOM won't work with our /bin/sh.
unsure if this script is used, but it is wrong.
might help the spurious build failures that occasionally
show up on autobuilds.
The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.
size_t wcsnlen(const wchar_t *s, size_t maxlen);
The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.
This function is a safer version of wcslen(3):
size_t wcslen(const wchar_t *s);
Update STANDARDS section of wmemchr(3) describing wide-character functions.
These changes conforms to the C11 standard
References:
- 7.27.1/3 Components of time (struct timespec)
- 7.27.2.5 The timespec_get function
According to ISO/IEC 9899:201x (draft) <time.h> defines the timespec
structure and declares the timespec_get(3) function with TIME_UTC
definition.
According to a C++17 standard draft <ctime> offers the same interface in
the std:: namespace.
The timespec_get function modifies the timespec object pointed by ts
to hold the current calendar time in the given base. The standard notes
only the TIME_UTC base with implementation defined value, set it to 1
as zero is reserved for error handling. Once operation was successful this
function returns passed base, otherwise exits with zero.
The timespec struct was already part of the POSIX standard in <time.h>.
Enable this interface unconditionally in the header to allow to use it
in a code prior C11 and C++17 as an extension.
Review notes from <christos>
and PCI_IOC_DRVNAMEONBUS. the new ones also take a (autoconf) PCI bus
number, which allows lookups for any device on any pci bus node. use this
in pcictl which current reports the wrong values sometimes.
up next: use these in libpciaccess.
Also make the tracefile customizable. Unfortunately we can't merge any of
the hash changes because they have a different on-disk format. That does not
matter really because we've fixed most of the problems...