Add new interface to add ability to get/set signal mask of a tracee.
It has been inspired by Linux PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, but
adapted for NetBSD API.
This interface is used for checkpointing software to set/restore context
of a process including signal mask like criu or just to track this property
in reverse-execution software like Record and Replay Framework (rr).
Add new ATF tests for this interface
====================================
getsigmask1:
Verify that plain PT_SET_SIGMASK can be called
getsigmask2:
Verify that PT_SET_SIGMASK reports correct mask from tracee
setsigmask1:
Verify that plain PT_SET_SIGMASK can be called with empty mask
setsigmask2:
Verify that sigmask is preserved between PT_GET_SIGMASK and
PT_SET_SIGMASK
setsigmask3:
Verify that sigmask is preserved between PT_GET_SIGMASK, process
resumed and PT_SET_SIGMASK
setsigmask4:
Verify that new sigmask is visible in tracee
Kernel ABI bump delayed as there are more interfaces to come in ptrace(2).
Sponsored by <The NetBSD Foundation>
do checking, rather just scrolls the scrolling region so we shall
follow suit. SUSv2 says what is happens when scrl is called with the
cursor outside the scrolling is undefined so we should match ncurses.
This fixes PR#51819 without forcing tin to use terminfo directly.
all later users of y first assign another value.
using ifdefs to make potential future code syncs easier, as is done
elsewhere.
suggested by coverity, CID 1300929, 1300930.
values into p,q sane. Get rid of redundant assignment. Indent
for legibility. NFC.
This doesn't create a functional difference, as all callers
test number >= 0x40000000 anyway.
To see this, note the following:
- consistently, hx is the high bits of x, lx is the low bits,
x is the float.
- & 0x7fffffff zeroes the sign bit, as does fabs.
A case where it isn't easy to see that there's no functional
change is y1, which does:
ix = hx & 0x7fffffff (zero signbit of high bits of x)
y = fabs(x) (this has a zeroed signbit but otherwise same as x)
ix >= 0x40000000
pone(y); qone(y)
qone(x) (also pone) do:
ix = hx & 0x7fffffff
ix in qone and in the calling function are the same number,
and the comparison applies for both, and ix < 0x40000000 isn't
possible.
(Also, no explosions seem to happen when I feed it random numbers)
accept4 is a syscall in Linux, FreeBSD and OpenBSD. It is used in
LLVM, zeromq, and probably others. paccept is a superset of it.
adding it to libc ensures it is used by programs and prevents the
need to define the same wrapper in every program.
libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.
Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).
Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.
Sponsored by <The NetBSD Foundation>
The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.
This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")
Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.
Discussed several times on mailing lists and in PR/51700.
Add warning to exect(3) telling about marking this function obsolete.
This function is prepared to be removed in next libc major bump.
Sponsored by <The NetBSD Foundation>
introducing since release of software to be recognised. This should hopefully
allow the builds to progress a littles further on systems such as the POWER8
which features a little endian 64-bit PowerPC CPU identified as ppc64le.
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>