Commit Graph

18748 Commits

Author SHA1 Message Date
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
maya fefc5fa8d9 Make paccept a weak symbol in preparation for using it in another function 2017-02-08 17:30:27 +00:00
christos 9aa43b8677 __empty is defined in <sys/cdefs.h> 2017-02-08 16:13:40 +00:00
riastradh adfa6ca875 Omit duplicate text. 2017-02-08 13:31:36 +00:00
kamil 0892a29a1a libpthread_dbg(3) deletion from the base distribution
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>
2017-02-08 03:44:40 +00:00
christos 4251f87df7 PR/51958: Ngie Cooper: ESRCH error description in hcreate(3) contains typo
for action
2017-02-07 22:25:25 +00:00
kamil 5acf460d25 Mark exect(3) obsolete and bind it to plain execve(2) on all platforms
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>
2017-02-07 19:29:39 +00:00
kamil c58abbea19 Document in libc's shlib_version request for exect(3) removal
This functionality has been moved long time to the kernel. Kernel exec()
emits SIGTRAP under a debugger (unless PT_SYSCALL traced).
2017-02-07 15:33:25 +00:00
abhinav 6b1f1a07e7 Add posix_madvise(2) in the NAME section. 2017-02-03 21:10:22 +00:00
abhinav 0d379b321a Insert comma between two Nm entries.
Remove Pp before Bd
2017-02-03 21:03:05 +00:00
abhinav b566e9d11b Remove comma after the last Nm entry. 2017-02-03 08:14:58 +00:00
njoly cada2c18c7 Fix a typo : pthread_mutexaddr_init -> pthread_mutexattr_init. 2017-02-02 10:48:22 +00:00
abhinav 60763e809a Add comma between two Nm entries in the NAME section. 2017-02-01 16:06:19 +00:00
abhinav d2174aa7ea Add modff and modfl in the NAME section. 2017-02-01 15:57:47 +00:00
abhinav 11aef024b5 Fix a sentence.
Correct function name in the DESCRIPTION section.
2017-02-01 15:49:02 +00:00
abhinav 5f9e091f8e Also, fix spelling of described. 2017-02-01 14:51:29 +00:00
abhinav 6cef231ea2 Fix sentence. 2017-02-01 14:46:51 +00:00
abhinav b59ab9a645 Remove comma after last Nm entry. 2017-02-01 14:42:28 +00:00
abhinav 53327cbb3e Remove comma after the last Nm entry. 2017-02-01 14:37:20 +00:00
sevan cc576e1d8e Update supporting files for components which rely on autoconf to allow systems
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.
2017-02-01 09:26:39 +00:00
roy 8dcd50a6a0 Move ESCDELAY to curses.c so all globals are close to each other.
Remove _reentrant and use ESCDELAY and TABSIZE as we're not really
reentrant.
2017-01-31 09:17:53 +00:00
roy 3c94ec04f2 Just return ERR instead of asserting if someone calls the slk routines
to affect the ripped off window before the window is actually ripped off.
2017-01-30 17:15:52 +00:00
roy 7487819a0b Check _cursesi_term is set in a few places and sprinkle some static. 2017-01-30 16:50:44 +00:00
roy 64b2ce979c If either set_escdelay(3) or set_tabsize(3) are called, set _reentrant
to ensure we use the saved value for the sceen.

This effectively makes ESCDELAY and TABSIZE read-only when either
of these functions are called.
2017-01-30 14:55:58 +00:00
abhinav c8b491e821 Fix a typo. 2017-01-29 16:52:38 +00:00
snj e6059b4b0a new lookup order will be in 7.1 before 8.0 2017-01-29 05:13:55 +00:00
wiz bb66c0074f Spelling fixes. 2017-01-27 12:52:39 +00:00
kamil 231f136ce0 Make the PIOD_READ_AUXV operation more clear
Describe how to set piod_offs.

Sponsored by <The NetBSD Foundation>
2017-01-25 17:12:56 +00:00
roy 2ebbf64e54 Document baudrate(3). 2017-01-25 12:42:05 +00:00
roy 1899e6576b And more functions .... 2017-01-25 12:21:18 +00:00
roy 9ab26a1db5 Note the substantial work by others on the curses library. 2017-01-25 12:05:26 +00:00
roy cb39f3d94a Document recently added functions in curses.3 2017-01-25 12:00:57 +00:00
roy de49f4c9e2 Reference curses_slk(3). 2017-01-25 11:44:55 +00:00
roy a2ac1ce48c Implement POSIX Curses Soft Label Key functions. 2017-01-24 17:27:30 +00:00
roy 9d818e01f4 Note an issue with our cursor movement in 1 line size window. 2017-01-24 16:45:41 +00:00
maya c7ed247615 add a wishlist for a major bump. isinff and compatibility cabs. 2017-01-20 22:10:38 +00:00
kamil c2ffce666f Fix one markup issue and add initial HISTORY section
Import HISTORY notes from FreeBSD.

Sponsored by <The NetBSD Foundation>
2017-01-15 22:18:11 +00:00
christos 1ecca95a27 fix *syslog_ss* 2017-01-15 16:41:39 +00:00
christos 213f09a410 don't include machine/param.h <sys/param.h> already does WTF? 2017-01-14 22:19:29 +00:00
christos 9d493e3dc8 remove useless include; asm.h is not useful for c files. our current assumption
is that stuff in cdefs.h is duplicated in asm.h.
2017-01-14 15:50:24 +00:00
wiz 13cf5641ee Wording, macro use. 2017-01-14 14:33:18 +00:00
kamil c2476a0996 Document PTRACE_LWP_CREATE and PTRACE_LWP_EXIT in ptrace(2)
Sponsored by <The NetBSD Foundation>
2017-01-14 07:17:38 +00:00
kamil 4e100202af Document PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)
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>
2017-01-14 00:02:40 +00:00
christos 4afb65f9d5 fix compilation 2017-01-13 18:18:20 +00:00
christos 025af9a44f allow overriding snprintf/vsnprintf 2017-01-13 14:41:27 +00:00
christos 794a9d5044 use getpagesize(3). 2017-01-13 04:18:54 +00:00
maya 68f994d51e replace old style function declaration 2017-01-12 19:02:22 +00:00
christos 585a07d820 Don't go redefining system constants, without checking if the system provides
them.
2017-01-12 18:23:04 +00:00
christos e9f6168b19 undo SSP damage from -Wsystem-headers 2017-01-12 18:16:52 +00:00
roy 5952c1b776 Use the screen argument, not _cursesi_screen. 2017-01-12 16:23:46 +00:00
roy ca57f21848 Correct terminfo variable pkey_norm to plab_norm. 2017-01-12 13:53:11 +00:00
christos 8212adb6e3 Avoid sysconf: __sysconf -> sysctlgetmibinfo -> strtoimax -> locale, etc. 2017-01-12 02:00:42 +00:00
christos 9cc0be316b A little more restructuring so that we don't need mutex stuff in syslog_ss. 2017-01-12 01:58:39 +00:00