Commit Graph

18700 Commits

Author SHA1 Message Date
wiz 65bf0053ed Update zlib version in pkgconfig file. 2017-03-12 20:38:30 +00:00
christos 20e5bd1924 merge 2017a 2017-03-11 18:23:14 +00:00
chs 6626e5c201 fix the mapping table. this sh3 version was originally copied from arm,
but FP_RP and FP_RM have opposite values on sh3 vs. arm.
2017-03-11 01:25:04 +00:00
maya 4644559ea4 Remove entirely redundant free right after declaration.
This block existed because the original code used bindname as a global.
2017-03-10 18:02:32 +00:00
maya 88f58dd75f Drop redundant null checks.
this doesn't increase diff to upstream, the whole block differs already.
2017-03-10 17:47:20 +00:00
maya 7ab45b5b71 Remove redundant null check before free. it is safe to free(NULL)
While here, clear up odd whitespace issue. NFC
2017-03-09 11:39:41 +00:00
maxv f8e693e577 Deprecate the pmc functions in libi386. The parameters will be updated,
and we are not interested in maintaining this anyway. Now i386's pmc
interface is opaque, which is good.
2017-03-08 16:09:27 +00:00
maxv a2375778e5 Remove i386 from libpmc; it has its own interface (sysarch), and we won't
maintain compatibility.

Verily, I cannot build a distribution now, so I'm committing this rather
blindly. This being said, it looks correct enough.
2017-03-08 15:53:00 +00:00
maya 0e7316adf4 Remove redundant null check before free()
It is guaranteed to be fine also by C99
2017-03-07 11:15:08 +00:00
pgoyette 5169db68cb Improve grammar. Pointed out by Timo Buhrmester on netbsd-docs list. 2017-03-06 09:24:09 +00:00
christos 3bea32ca4f one extra char for NUL. 2017-03-05 19:23:58 +00:00
njoly 9be71c742b Fix man page ERRORS section for (clock,pthread}_getcpuclockid to match
reality.
2017-03-05 18:42:51 +00:00
christos bd242e1e3e Grow the buffer for event search if there was not enough space.
From Gerry Swislow
2017-03-05 17:30:38 +00:00
njoly 5e0724b3f9 Fix {clock,pthread}_getcpuclockid to return an error number on
failure, to match OpenGroup specifications.
2017-03-04 11:16:33 +00:00
chs 55470246b3 fix asm operands: "ctc1" uses the register as an input, not an output. 2017-02-27 06:55:26 +00:00
chs ae1038858d have fpsetmask() change the FE0/FE1 MSR bits to precise mode if any
FP exceptions are enabled.  fix the kernel emulation of mfmsr and mtmsr
to use the correct opcodes for these instructions.  ignore PSL_FE
(the FP enable bit) in the MSR that a user program tries to set,
since it will naturally be set for FP-using processes but
we can't let the user process manage that bit.
2017-02-27 06:54:00 +00:00
chs a3f976c753 the MI lrint() code assumes that rounding is done in at most double precision
but m68k (68881) uses extended precision by default, so put the FPU in
double-precision mode temporarily here.
2017-02-27 06:49:02 +00:00
joerg 6fbd2a0be4 Switch from __ABICALLS__ to __mips_abicalls like upstream GCC does in
the generic MIPS target logic.
2017-02-25 21:16:50 +00:00
christos 3fed35c1f4 add link for accept4. 2017-02-23 15:17:17 +00:00
wiz 5de13b617d Formatting fix. 2017-02-23 08:11:09 +00:00
kamil 7250944257 Document PT_GETDBREGS and PT_SETDBRGS in ptrace(2)
Not this interface in MD part.
Explain design choices.

Sponsored by <The NetBSD Foundation>
2017-02-23 05:48:14 +00:00
scole e3edf3b621 Add fenv for ia64, imported from FreeBSD, compile tested only. 2017-02-23 02:05:30 +00:00
kamil f9b2093d06 Introduce new ptrace(2) API to allow/prevent exection of LWP
Introduce new API for debuggers to allow/prevent execution of the specified
thread.

New ptrace(2) operations:

     PT_RESUME     Allow execution of a specified thread, change its state
                   from suspended to continued.  The addr argument is unused.
                   The data argument specifies the LWP ID.

                   This call is equivalent to _lwp_continue(2) called by a
                   traced process.  This call does not change the general
                   process state from stopped to continued.

     PT_SUSPEND    Prevent execution of a specified thread, change its state
                   from continued to suspended.  The addr argument is unused.
                   The data argument specifies the requested LWP ID.

                   This call is equivalent to _lwp_suspend(2) called by a
                   traced process.  This call does not change the general
                   process state from continued to stopped.

This interface is modeled after FreeBSD, however with NetBSD specific arguments
passed to ptrace(2) -- FreeBSD passes only thread id, NetBSD passes process and
thread id.

Extend PT_LWPINFO operation in ptrace(2) to report suspended threads. In the
ptrace_lwpinfo structure in pl_event next to PL_EVENT_NONE and PL_EVENT_SIGNAL
add new value PL_EVENT_SUSPENDED.

Add new errno(2) value EDEADLK that might be returned by ptrace(2). It prevents
dead-locking in a scenario of resuming a process or thread that is prevented
from execution. This fixes bug that old API was vulnerable to this scenario.

Kernel bump delayed till introduction of PT_GETDBREGS/PT_SETDBREGS soon.

Add new ATF tests:
 - resume1
   Verify that a thread can be suspended by a debugger and later
   resumed by the debugger

 - suspend1
   Verify that a thread can be suspended by a debugger and later
   resumed by a tracee

 - suspend2
   Verify that the while the only thread within a process is
   suspended, the whole process cannot be unstopped

Sponsored by <The NetBSD Foundation>
2017-02-22 23:43:43 +00:00
abhinav c56d982263 Add reference to flockfile(3) in SEE ALSO section. 2017-02-22 15:08:55 +00:00
abhinav 4acd25c1d4 Fix a sentence.
Add write(2) in SEE ALSO.
2017-02-22 14:58:33 +00:00
maya bee20f7c3c GC deprecated logic. GCC 4.8 is not in tree any more. 2017-02-22 02:58:31 +00:00
abhinav 44c9d98bb0 Use Fn for function name. 2017-02-21 19:53:20 +00:00
abhinav 74752680de Insert comma between two Nm entries.
Replace Nm with Fn to refer a function.
2017-02-21 18:47:40 +00:00
abhinav 68d0ebc2d9 Fix spelling of "parenthesis". 2017-02-21 18:22:15 +00:00
abhinav 52cc192a32 Use .Fn to refer functions instead of .Nm. 2017-02-21 18:01:38 +00:00
abhinav 9c8d63417a Fix spelling of "includes". 2017-02-21 17:56:21 +00:00
rin 36be1ec540 Fix -O0 build; <machine/bwx.h> should be included after ".arch ev56" pseudo-op. 2017-02-20 15:23:43 +00:00
roy d837f94776 Note that typeahead(3) is no longer set to infd by default. 2017-02-17 11:23:21 +00:00
roy 0d7cbb25e8 Disable typeahead being set to infd by default as this seems to cause
refresh issues in nvi.
2017-02-17 11:18:38 +00:00
ozaki-r 44d072be9e Support paccept for nc 2017-02-16 08:08:01 +00:00
christos 379a1dffb1 fix off-by-one, found by asan. 2017-02-12 22:37:49 +00:00
maya 85f888414a overlapping strcpy is UB. use memmove
from asan+ubsan
2017-02-12 17:19:00 +00:00
kamil 61aff29627 Introduce new interface in ptrace(2) - PT_GET_SIGMASK and PT_SET_SIGMASK
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>
2017-02-12 06:09:52 +00:00
roy 0a316e40f7 Warn about unprintable characters in capability strings. 2017-02-11 15:13:17 +00:00
roy 0fb82a6eaf Following a newline, strip leading whitespace from capability strings. 2017-02-11 14:57:15 +00:00
maya 39d6057df2 speed limit is 80 (missed this one) 2017-02-10 08:52:04 +00:00
maya 6ac4e27787 strncpy->strlcpy. use sizeof instead of numbers. 2017-02-10 08:50:27 +00:00
blymn 871cddc640 Remove checks for cursor being in scrolling region, ncurses doesn't
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.
2017-02-10 06:25:28 +00:00
maya fa47e9d850 ifdef out some dead code. improves code readability.
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.
2017-02-09 22:11:09 +00:00
maya d5de09b1da Appease static analyzers by making all code paths which assign
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)
2017-02-09 21:23:11 +00:00
maya d2158a65ab minor bump libc for accept4 2017-02-08 20:26:26 +00:00
maya 248eba16c5 oops, do not write the same file twice -- accidentally ran patch twice 2017-02-08 18:03:57 +00:00
maya e89d2a589b Document accept4 in accept(2) 2017-02-08 18:01:24 +00:00
christos ea89c7259a empty to nothing 2017-02-08 18:00:37 +00:00
maya 708af0751d Add accept4, a tiny wrapper around paccept.
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.
2017-02-08 17:58:41 +00:00