Commit Graph
1700 Commits
Author SHA1 Message Date
Alan Somers 4144cd5dfb MFC r320255
(note that part of 320255 was erroneously MFCed by 322889)

Clarify usage of aio(4) with kqueue(2)

Reviewed by:    jhb
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D11299
2017-08-28 18:40:26 +00:00
Konstantin Belousov 4000ed3557 MFC r319875:
Add ptrace(PT_GET_SC_ARGS) command to return debuggee' current syscall
arguments.
2017-07-21 18:12:35 +00:00
Enji Cooper c30f4d6448 MFC r318715,r318717,r318718,r318719,r318720,r318721:
r318715:

_umtx_op(2): fix minor manlint issues

- Sort .Xr entries in SEE ALSO section.
- Sort SEE ALSO and STANDARDS sections properly, in terms of the
  entire document.

r318717:

cap_enter(2): fix manlint issues

- Sort SEE ALSO section appropriately.
- Correct section for sysctl(9).

r318718:

rctl_add_rule(2): fix manlint warnings

- Fix commas (either missing or misused) after .Nm entries in SYNOPSIS

r318719:

open(2): fix manlint warnings

- Sort SEE ALSO .Xr entries.
- Sort sections (HISTORY comes after STANDARDS).

r318720:

ptrace(2): clean up trailing whitespace

r318721:

kill(2): add missing section for sysctl(9)
2017-07-18 18:15:28 +00:00
Konstantin Belousov 192f9d4dba MFC r320801:
Simplify language.
2017-07-11 05:33:07 +00:00
Konstantin Belousov 2110f0a42c Add MAP_GUARD and use it for stack grow area protection.
Bump __FreeBSD_version.

MFC r320317:
Implement address space guards.

MFC r320338:
Remove stale part of the comment.

MFC r320339:
Correctly handle small MAP_STACK requests.

MFC r320344:
For now, allow mprotect(2) over the guards to succeed regardless of
the requested protection.

MFC r320430:
Treat the addr argument for mmap(2) request without MAP_FIXED flag as
a hint.

MFC r320560 (by alc):
Modify vm_map_growstack() to protect itself from the possibility of the
gap entry in the vm map being smaller than the sysctl-derived stack guard
size.
2017-07-05 06:18:00 +00:00
Konstantin Belousov 0be68c4afe MFC r320314:
Remove the description of MAP_HASSEMAPHORE.

Approved by:	re (marius)
2017-06-27 10:09:00 +00:00
Konstantin Belousov cde34cd00f MFC r320313:
Fix typo.

Approved by:	re (marius)
2017-06-27 09:42:56 +00:00
John Baldwin e0fc433218 MFC 319490: Remove stale cap_rights_get(2) manpage.
The documentation moved to section 3 several years ago, but
'man cap_rights_get' pulls up cap_rights_limit(2) (which is
MLINKed to cap_rights_get.2) instead of cap_rights_get(3).

Approved by:	re (gjb)
2017-06-20 15:55:15 +00:00
Konstantin Belousov c17118ea44 MFC r320035:
Move the description of kern.kq_calloutmax sysctl into a new paragraph
for better presentation.

Approved by:	re (delphij)
2017-06-19 07:15:47 +00:00
Konstantin Belousov 543da4d086 MFC r320034:
Start a new sentence on the new line.

Approved by:	re (delphij)
2017-06-19 06:48:21 +00:00
Allan Jude 68c019041c MFC r318765:
Allow cpuset_{get,set}affinity in capabilities mode

Approved by:	re (marius)
2017-06-11 02:04:39 +00:00
Edward Tomasz Napierala 7538684aaf MFC r318816:
Don't end up manpage titles with a full stop.

Approved by:	re (marius)
2017-06-06 09:23:12 +00:00
Konstantin Belousov 65c662158f MFC r319086:
Mention that the basep argument to getdirentries(2) can be NULL.
2017-05-31 09:23:21 +00:00
Xin LI 0e55484fe5 MFC r315272, r315370
r315272:
Implement INHERIT_ZERO for minherit(2).

INHERIT_ZERO is an OpenBSD feature.

When a page is marked as such, it would be zeroed
upon fork().

This would be used in new arc4random(3) functions.

PR:	182610
Reviewed by:	kib (earlier version)
Differential Revision:	https://reviews.freebsd.org/D427

r315370:
The adj_free and max_free values of new_entry will be calculated and
assigned by subsequent vm_map_entry_link(), therefore, remove the
pointless copying.

Submitted by:	alc
2017-05-31 05:10:03 +00:00
Xin LI 05dd71ec86 MFC r315615:
Make space style consistent with earlier entries.
2017-05-31 05:05:32 +00:00
Glen Barber 06a8bb4808 MFC r318794, r318795:
Update the "first appeared in" version in several manual pages.

Sponsored by:	The FreeBSD Foundation
2017-05-27 00:30:51 +00:00
Stephen J. Kiernan 0559c7bedb MFC r318314
Add information to open(2) man page about the O_VERIFY flag.

PR:		219262
Reviewed by:	bjk wblock
Approved by:	sjg (mentor)
Obtained from:	Juniper Networks, Inc.
2017-05-25 18:55:10 +00:00
Brooks Davis 6095ebde14 MFC r317845-r317846
r317845:
Provide a freebsd32 implementation of sigqueue()

The previous misuse of sys_sigqueue() was sending random register or
stack garbage to 64-bit targets.  The freebsd32 implementation preserves
the sival_int member of value when signaling a 64-bit process.

Document the mixed ABI implementation of union sigval and the
incompability of sival_ptr with pointer integrity schemes.

Reviewed by:	kib, wblock
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10605

r317846:
Regen post r317845.

MFC with:	r317845
Sponsored by:	DARPA, AFRL
2017-05-12 17:40:34 +00:00
Bryan Drewery ff58cd6915 MFC r306771:
Improve grammar.
2017-05-09 18:14:45 +00:00
Eric van Gyzen 3b3087ea27 MFC r315526
Add clock_nanosleep()

Add a clock_nanosleep() syscall, as specified by POSIX.
Make nanosleep() a wrapper around it.

Attach the clock_nanosleep test from NetBSD. Adjust it for the
FreeBSD behavior of updating rmtp only when interrupted by a signal.
I believe this to be POSIX-compliant, since POSIX mentions the rmtp
parameter only in the paragraph about EINTR. This is also what
Linux does. (NetBSD updates rmtp unconditionally.)

Copy the whole nanosleep.2 man page from NetBSD because it is complete
and closely resembles the POSIX description. Edit, polish, and reword it
a bit, being sure to keep any relevant text from the FreeBSD page.

Regenerate syscall files.

Relnotes:	yes
Sponsored by:	Dell EMC
2017-05-01 01:36:54 +00:00
Eric van Gyzen 6e1fe221af MFC r315694
clock_gettime.2: add some clock IDs

Add the CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clock_id
values to the clock_gettime(2) man page.  Reformat the excessively
long paragraph (sentence!) into a tag list.

Sponsored by:	Dell EMC
2017-03-25 00:52:33 +00:00
Konstantin Belousov f6b65f1504 MFC r313690:
Consistently handle negative or wrapping offsets in the mmap(2) syscalls.

MFC r315158:
Fix two missed places where vm_object offset to index calculation
should use unsigned shift.
2017-03-19 16:01:44 +00:00
Eric van Gyzen a12bcdd3f4 MFC r314055
Make several improvements and corrections in the kenv(2) man page

Sponsored by:	Dell EMC
2017-03-10 20:06:17 +00:00
Jilles Tjoelker 761b7b4a56 MFC r313174: Clean up documentation of AF_UNIX control messages.
Document AF_UNIX control messages in unix(4) only, not split between unix(4)
and recv(2).

Also, warn about LOCAL_CREDS effective uid/gid fields, since the write could
be from a setuid or setgid program (with the explicit SCM_CREDS and
LOCAL_PEERCRED, the credentials are read at such a time that it can be
assumed that the process intends for them to be used in this context).
2017-02-10 15:03:54 +00:00
John Baldwin 25125e2d31 MFC 310638:
Rename the 'flags' argument to getfsstat() to 'mode' and validate it.

This argument is not a bitmask of flags, but only accepts a single value.
Fail with EINVAL if an invalid value is passed to 'flag'.  Rename the
'flags' argument to getmntinfo(3) to 'mode' as well to match.

This is a followup to r308088.
2017-02-08 18:32:35 +00:00
Enji Cooper 7426409308 MFC r312332,r312446,r312451:
r312332:

Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
unnecessarily long relative path .PATH values with make

r312446 (by emaste):

libc: remove reference to nonexistent lib/locale directory

As far as I can tell this was introduced in r72406 and updated in several
subsequent revisions, but the lib/locale directory it referenced never
existed.

r312451:

Replace dot-dot relative pathing with SRCTOP-relative paths where possible

This reduces build output, need for recalculating paths, and makes it clearer
which paths are relative to what areas in the source tree. The change in
performance over a locally mounted UFS filesystem was negligible in my testing,
but this may more positively impact other filesystems like NFS.

LIBC_SRCTOP was left alone so Juniper (and other users) can continue to
manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as
include Makefiles with custom options.

Discussed with:	marcel, sjg
2017-02-04 17:17:38 +00:00
Mark Johnston b4430eaa54 MFC r309200:
Launder VPO_NOSYNC pages upon vnode deactivation.
2017-02-03 01:16:54 +00:00
Warren Block 46d268d112 MFC r312547: Mention sendfile(2) by popular demand.
Sponsored by:	iXsystems
2017-01-27 17:54:24 +00:00
Warren Block 3436888368 MFC 312083:
Update the shm_open.2 man page to reflect objective reality.

Sponsored by:	iXsystems
2017-01-20 17:38:12 +00:00
Edward Tomasz Napierala bf38c3feb6 MFC r308386:
Document that getfsstat(2) called with MNT_NOWAIT skips file systems
that are in the process of being unmounted.
2016-12-19 12:25:30 +00:00
Eric van Gyzen dd4c4c5a6b MFC r309460
thr_set_name(): silently truncate the given name as needed

Instead of failing with ENAMETOOLONG, which is swallowed by
pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
bytes.  This is more likely what the user wants, and saves the
caller from truncating it before the call (which was the only
recourse).

Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2)
so the user might find the documentation for this behavior.

Sponsored by:	Dell EMC
2016-12-13 23:34:07 +00:00
Jilles Tjoelker f3cacbdd31 MFC r309026: open(2): Clarify non-POSIX error when opening a symlink with
O_NOFOLLOW.

We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code
like cmp -h and xz takes advantage of this.

PR:		214633
2016-12-04 15:55:59 +00:00
Edward Tomasz Napierala 39238edcbe MFC r302624:
Add some .Xrs to getloginclass(2).
2016-11-03 14:49:26 +00:00
Dag-Erling Smørgrav 152d791f66 MFH (r306488, r306494, r306495, r306496): fix markup and cross-references 2016-10-22 00:38:47 +00:00
Jilles Tjoelker 2d340afbfd MFC r305628: intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)). 2016-10-11 21:59:22 +00:00
Konstantin Belousov 9e91e03d11 MFC r306334:
Document thr_suspend(2) and thr_wake(2).

MFC r306506:
Reword the statement.
2016-10-03 09:30:25 +00:00
Konstantin Belousov a045d87dff MFC r306505:
Add an article.
2016-10-03 09:28:06 +00:00
Konstantin Belousov 9b4944a819 MFC r306257:
Document r306081, i.e. procctl(PROC_TRAPCAP) and sysctl kern.trap_enocap.

MFC r306366:
Editing fixes for r306257, documentation for trapcap.
2016-09-28 09:33:46 +00:00
Eric Badger 9463bb9bf4 MFC r305956: Add manpage for rctl_* system calls
Approved by:	kib (mentor)
Sponsored by:	Dell Technologies
2016-09-24 16:46:37 +00:00
Konstantin Belousov 0abcae4411 MFC r304285:
Implement userspace gettimeofday(2) with HPET timecounter.
2016-09-16 10:04:28 +00:00
Konstantin Belousov b04cab427c MFC r304928:
Do not obliterate errno value in the main thread during ptrace(2) call on x86.

MFC r304931:
Follow ABI when calling __error from the ptrace(2) wrapper.

MFC r305012:
Rewrite ptrace(2) wrappers in C.

MFC r305022:
Restore the requirement of setting errno to zero before calling ptrace(2).
2016-09-03 09:03:40 +00:00
Konstantin Belousov 9f6cd82126 MFC r305024:
Typesetting fixes.
2016-09-01 07:19:04 +00:00
Konstantin Belousov 77ff85f711 MFC r304287:
Add fdatasync(2) man page, combined with fsync(2).
2016-08-29 05:59:12 +00:00
Konstantin Belousov e69cf81fc8 MFC r304209:
The fdatasync(2) call must be cancellation point.
2016-08-29 05:37:03 +00:00
Konstantin Belousov e5918d8503 MFC r304176:
Add a trivial implementation of fdatasync(2).
2016-08-29 05:15:43 +00:00
John Baldwin 14720199b8 MFC 304476: Fix various nits in the aio operation manpages.
- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).
2016-08-22 17:52:10 +00:00
Bryan Drewery fef9f49396 MFC r304288:
Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318.
2016-08-20 00:34:19 +00:00
John Baldwin 7b5bd53168 MFC 303001: Add PTRACE_VFORK to trace vfork events.
First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when
the new child was created via vfork() rather than fork().  Second, a
new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK
event mask.  This new stop is reported after the vfork parent resumes
due to the child calling exit or exec.  Debuggers can use this stop to
reinsert breakpoints in the vfork parent process before it resumes.
2016-08-19 20:17:57 +00:00
John Baldwin f41e13d351 MFC 302900,302902,302921,303461,304009:
Add a mask of optional ptrace() events.

302900:
Add a test for user signal delivery.

This test verifies we get the correct ptrace event details when a signal
is posted to a traced process from userland.

302902:
Add a mask of optional ptrace() events.

ptrace() now stores a mask of optional events in p_ptevents.  Currently
this mask is a single integer, but it can be expanded into an array of
integers in the future.

Two new ptrace requests can be used to manipulate the event mask:
PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK
sets the current event mask.

The current set of events include:
- PTRACE_EXEC: trace calls to execve().
- PTRACE_SCE: trace system call entries.
- PTRACE_SCX: trace syscam call exits.
- PTRACE_FORK: trace forks and auto-attach to new child processes.
- PTRACE_LWP: trace LWP events.

The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have
been replaced by PTRACE_SCE and PTRACE_SCX.  PTRACE_FORK replaces
P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS.

The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for
compatibility but now simply toggle corresponding flags in the
event mask.

While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both
modify the event mask and continue the traced process.

302921:
Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.

303461:
Note that not all optional ptrace events use SIGTRAP.

New child processes attached due to PTRACE_FORK use SIGSTOP instead of
SIGTRAP.  All other ptrace events use SIGTRAP.

304009:
Remove description of P_FOLLOWFORK as this flag was removed.
2016-08-15 21:10:41 +00:00
Brooks Davis 54acfab938 MFC r303104, r303106:
Update to reflect the fact that pipe() is a wrapper around the pipe2()
system call.

Reviewed by:	jhb, wblock
Sponsored by:	DAPRA, AFRL

Change wording to use function rather than system call in the
description
as well.

Authored by:	zeising
Reviewed by:	brooks

Approved by:	re (gjb)
Sponsored by:	DAPRA, AFRL
2016-08-03 16:10:53 +00:00