Commit Graph

1592 Commits

Author SHA1 Message Date
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
abhinav 1c893641af Fix typo
Insert Pp after a list to add vertical space before the next paragraph
Remove Pp before Bl at two places
2017-06-12 14:59:04 +00:00
abhinav 7c1ea70c7f Grammar and punctuation fixes in few sentences
Remove Pp before Bd at couple of places
2017-06-11 17:34:54 +00:00
abhinav 8ef406c2e9 Insert missing word
Insert comma in a sentence to make the comprehension easier
Remove Pp before Bd
2017-06-11 17:01:26 +00:00
kamil da61917c5f EV_SET(2) - simplify description
Note only the information that it does not evaluate multiple times its
parameters.

Suggested by <wiz>.
2017-06-07 20:54:59 +00:00
abhinav 46dffe54d1 s/filesystem/file system/
Thanks to Thomas for pointing out that in NetBSD man pages we try to use the convention of writing it
as "file system".
2017-06-07 05:26:19 +00:00
abhinav 1a8ce3a63b Bump date for previous
Fix typo: fileystem -> filesystem
2017-06-06 20:12:54 +00:00
kamil bc0c5fd82b Update the EV_SET() description with newer implementation.
EV_SET(2) is a macro again, that wraps an inline function which is still
new in NetBSD 8.0.

Sponsored by <The NetBSD Foundation>
2017-06-06 17:01:59 +00:00
abhinav c45058c218 Fix typo: s/interrput/interrupt/ 2017-06-03 19:41:14 +00:00
kamil 5f91e65caa Document transition of EV_SET() from a macro to a static inline function
Sponsored by <The NetBSD Foundation>
2017-05-31 01:03:01 +00:00
bouyer 6e4cb2b9ab merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used
in automation and automotive fields. For example, the NMEA2000 standard
developped for marine devices uses a CAN network as the link layer.

This is an implementation of the linux socketcan API:
https://www.kernel.org/doc/Documentation/networking/can.txt
you can also see can(4).

This adds a new socket family (AF_CAN) and protocol (PF_CAN),
as well as the canconfig(8) utility, used to set timing parameter of
CAN hardware. Also inclued is a driver for the CAN controller
found in the allwinner A20 SoC (I tested it with an Olimex lime2 board,
connected with PIC18-based CAN devices).

There is also the canloop(4) pseudo-device, which allows to use
the socketcan API without CAN hardware.

At this time the CANFD part of the linux socketcan API is not implemented.
Error frames are not implemented either. But I could get the cansend and
canreceive utilities from the canutils package to build and run with minimal
changes. tcpudmp(8) can also be used to record frames, which can be
decoded with etherreal.
2017-05-27 21:02:54 +00:00
wiz 63d3c713fa file system police. 2017-05-14 12:30:37 +00:00
wiz cf1b0d459d Use Nx. 2017-05-14 12:29:10 +00:00
abhinav d531aa96de Add missing word. 2017-05-09 06:41:56 +00:00
joerg 4f77b889d0 Extend the mmap(2) interface to allow requesting protections for later
use with mprotect(2), but without enabling them immediately.

Extend the mremap(2) interface to allow duplicating mappings, i.e.
create a second range of virtual addresses references the same physical
pages. Duplicated mappings can have different effective protections.

Adjust PAX mprotect logic to disallow effective protections of W&X, but
allow one mapping W and another X protections. This obsoletes using
temporary files for purposes like JIT.

Adjust PAX logic for mmap(2) and mprotect(2) to fail if W&X is requested
and not silently drop the X protection.

Improve test cases to ensure correct operation of the changed
interfaces.
2017-05-06 21:34:51 +00:00
wiz 014a98250c Sort errors. 2017-04-23 11:38:53 +00:00
abhinav bf7f329587 Fix sentences at couple of places
s/a file/the file/
	s/a -1 is returned/-1 is returned/
2017-04-23 06:46:04 +00:00
christos 5ec33a074f Mention that the signal stack of the newly created lwp is reset to disabled. 2017-04-21 15:04:10 +00:00
abhinav bf08a0975f Use more markup for `struct timespec`
Use Xr to refer to timespec(3)
Add timespec(3) to SEE ALSO
2017-04-11 17:59:23 +00:00
abhinav 3b14f403c3 s/Sets/Set: Use style consistent with the other sentences in that list.
Add .Pp before next sentence.
2017-04-11 11:06:39 +00:00
kamil 049bc8e25e Fix typo in previous (ptrace(2)) 2017-04-08 00:58:35 +00:00
kamil d50fceb568 Document new calls and be more clear about PT_SYSCALL* in ptrace(2)
Document PT_SETSTEP and PT_CLEARSTEP in ptrace(2).

Try to explain more details of PT_SYSCALL and PT_SYSCALLEMU.

The description of PT_*STEP has been obtained from FreeBSD.

Sponsored by <The NetBSD Foundation>
2017-04-08 00:56:38 +00:00
pgoyette 158c71ad1f Fix typos and some grammar 2017-04-07 07:21:58 +00:00
kamil 2667b4dcaa Correction in ptrace(2) about operations that emit signals
PT_STEP and PT_DETACH cannot emit signals
PT_CONTINUE and PT_SYSCALL can emit signals

Pointed out by <chs>
2017-04-07 00:56:14 +00:00
abhinav 8e077e469b Fix sentence. 2017-04-02 14:27:11 +00:00
abhinav 9f9499a40c Add man page links for:
EV_SET to kqueue(2)
   getmntoptstr, getmntoptnum, freemntopts to getmntopts(3)

Reviewed by wiz@
2017-04-01 14:31:05 +00:00
abhinav 8e39d64647 Add EV_SET() to the NAME section
Use Xr instead of Fn to refer other man pages
Add some more entries to SEE ALSO

Reviewed by wiz@
2017-04-01 14:20:45 +00:00
abhinav 21edcefd45 Remov comma from the last Nm entry
Use Xr instead of Fn to refer rmdir(2)
Fix couple of sentences
2017-03-30 18:54:26 +00:00
njoly 9be71c742b Fix man page ERRORS section for (clock,pthread}_getcpuclockid to match
reality.
2017-03-05 18:42:51 +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
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
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 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
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
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
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
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
abhinav 6b1f1a07e7 Add posix_madvise(2) in the NAME section. 2017-02-03 21:10:22 +00:00
abhinav b566e9d11b Remove comma after the last Nm entry. 2017-02-03 08:14:58 +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
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
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