Commit Graph

1315 Commits

Author SHA1 Message Date
Konstantin Belousov
f1410015f0 Emit .note.GNU-stack for the syscall stubs generated by libc only on
architectures that support this .note. In particular, do not unneccessary
emit the notes on ia64 and sparc64, which ABI require non-executable stacks.

Tested by:	marcel
2011-01-25 21:06:49 +00:00
Konstantin Belousov
1567387db9 Document PT_FLAG_FORKED, PT_FOLLOW_FORK, pl_tdname and pl_child_pid.
MFC after:	2 weeks
2011-01-25 11:02:12 +00:00
Jilles Tjoelker
198c89c306 getgroups(2): Remove mention of <sys/param.h> and refer to sysconf(3).
Because {NGROUPS_MAX} may become variable, its value should be obtained
using sysconf(3). If a #define is used anyway, it should be obtained by
including <limits.h> as that is in POSIX like getgroups(2) itself is.
<sys/param.h> is not in POSIX.

MFC after:	1 week
2011-01-21 22:15:17 +00:00
Jilles Tjoelker
c3954e3936 mknod(2): The required include is <sys/stat.h>, not <unistd.h>.
This is what SUSv4 requires, and also the only thing that works if strict
standards compliance is requested or mknodat() is needed.

PR:		standards/123688
Submitted by:	gcooper
MFC after:	1 week
2011-01-16 21:59:50 +00:00
Konstantin Belousov
8863c9c75e Emit .note.GNU-stack for the syscall stubs generated by libc. 2011-01-07 14:28:54 +00:00
Rebecca Cran
e04b58b0cf Sort cross references by section.
Reported by: pluknet
2010-12-18 10:09:07 +00:00
Rebecca Cran
110ac7a3e4 Update shmget(2) with POSIX access permissions and remove non-standard SHM_R,
SHM_W and machine/param.h.
2010-12-17 21:10:08 +00:00
Luigi Rizzo
5c9d0a9ad3 This commit implements the SO_USER_COOKIE socket option, which lets
you tag a socket with an uint32_t value. The cookie can then be
used by the kernel for various purposes, e.g. setting the skipto
rule or pipe number in ipfw (this is the reason SO_USER_COOKIE has
been implemented; however there is nothing ipfw-specific in its
implementation).

The ipfw-related code that uses the optopn will be committed separately.

This change adds a field to 'struct socket', but the struct is not
part of any driver or userland-visible ABI so the change should be
harmless.

See the discussion at
http://lists.freebsd.org/pipermail/freebsd-ipfw/2009-October/004001.html

Idea and code from Paul Joe, small modifications and manpage
changes by myself.

Submitted by:	Paul Joe
MFC after:	1 week
2010-11-12 13:02:26 +00:00
Jaakko Heinonen
2feecf0bfb - Note that non-superusers are not allowed to set the SF_ARCHIVED
flag. [1]
- Note that also fchflags(2) will return EPERM for attempts to set or
  unset the SF_SNAPSHOT flag.

Submitted by:	Garrett Cooper [1]
MFC after:	1 week
2010-10-29 15:03:29 +00:00
Ulrich Spörlein
2914feeb7e mdoc: make pages render with mandoc
It's a bit more pedantic regarding .Bl list elements. This has an added
benefit of unbreaking the ipfw(8) manpage, where groff was silently
skipping one list element.
2010-10-21 12:27:13 +00:00
Rui Paulo
565424b2fd Clang related fixes:
* When calling syslog(), pass a format string.
* Define YY_NO_INPUT on nslexer.l

Submitted by:	Norberto Lopes <nlopes.ml at gmail.com>
2010-10-13 16:57:06 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Alan Cox
8f7f5a7f26 Fix exec_imgact_shell()'s handling of two error cases: (1) Previously, if
the first line of a script exceeded MAXSHELLCMDLEN characters, then
exec_imgact_shell() silently truncated the line and passed on the truncated
interpreter name or argument.  Now, exec_imgact_shell() will fail and return
ENOEXEC, which is the commonly used errno among Unix variants for this type
of error. (2) Previously, exec_imgact_shell()'s check on the length of the
interpreter's name was ineffective.  In other words, exec_imgact_shell()
could not possibly fail and return ENAMETOOLONG.  The reason being that the
length of the interpreter name had to exceed MAXSHELLCMDLEN characters in
order that ENAMETOOLONG be returned.  But, the search for the end of the
interpreter name stops after at most MAXSHELLCMDLEN - 2 characters are
scanned.  (In the end, this particular error is eventually discovered
outside of exec_imgact_shell() and ENAMETOOLONG is returned.  So, the real
effect of this second change is that the error is detected earlier, in
exec_imgact_shell().)

Update the definition of MAXINTERP to the actual limit on the size of
the interpreter name that has been in effect since r142453 (from
2005).

In collaboration with: kib
2010-09-21 16:24:51 +00:00
Glen Barber
416d1e6f23 Bump dates in dbopen(3) and cpuset_getaffinity(2) from r212441 and
r212438, repectively.

Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-12 14:04:05 +00:00
Glen Barber
cbd5df1c04 Add EINVAL to list of possible return values for cpuset_getaffinity(2).
PR:		149978
Submitted by:	gcooper
Patch by:	gcooper
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-10 23:15:05 +00:00
David Xu
83c9e0893f Because POSIX does not allow EINTR to be returned from sigwait(),
add a wrapper for it in libc and rework the code in libthr, the
system call still can return EINTR, we keep this feature.

Discussed on: thread
Reviewed by:  jilles
2010-09-10 01:47:37 +00:00
Glen Barber
1bc1532c36 Add ECONNRESET to list of possible errors in connect(2).
PR:		148683
Submitted by:	Gennady Proskurin <gpr at mail dot ru>
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-06 21:39:54 +00:00
Konstantin Belousov
da881cad07 Use NULL instead of 0 for pointer in example.
MFC after:	3 days
2010-08-29 16:38:08 +00:00
Alan Cox
74ffb9af15 Add the MAP_PREFAULT_READ option to mmap(2).
Reviewed by:	jhb, kib
2010-08-28 16:57:07 +00:00
Rebecca Cran
e7f8dd75b3 Fix incorrect usage of 'assure' and 'insure'.
Approved by: rrs (mentor)
2010-08-28 16:32:01 +00:00
Warner Losh
2c0959ae6b Powerpc is special here. powerpc and powerpc64 use different ABIs, so
their implementations aren't in the same files.  Introduce LIBC_ARCH
and use that in preference to MACHINE_CPUARCH.  Tested by amd64 and
powerpc64 builds (thanks nathanw@)
2010-08-24 20:54:43 +00:00
Konstantin Belousov
3e3fbd3f25 Remove extra FreeBSD tag.
MFC after:	3 days
2010-08-24 13:02:22 +00:00
Konstantin Belousov
da2a0df59c Move the __stack_chk_fail_local@FBSD_1.0 compat symbol definition into
the separate .o for libc_pic.a. This prevents rtld from making the
symbol global.

Putting the stack_protector_compat.c into the public domain acknowledged
by kan.

Reviewed by:	kan
MFC after:	2 weeks
2010-08-24 12:58:54 +00:00
Warner Losh
25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Konstantin Belousov
2793b01844 Use aux vector to get values for SSP canary, pagesize, pagesizes array,
number of host CPUs and osreldate.

This eliminates the last sysctl(2) calls from the dynamically linked image
startup.

No objections from:	kan
Tested by:	marius (sparc64)
MFC after:	1 month
2010-08-17 09:13:26 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Joel Dahl
f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Joel Dahl
edfa427cf1 Spelling fixes. 2010-08-02 16:01:45 +00:00
Ulrich Spörlein
32ba16b6e6 Fix a couple of typos.
PR:		docs/148891
Submitted by:	olgeni
MFC after:	1 week
2010-07-30 11:58:18 +00:00
Edward Tomasz Napierala
d8561f0a50 Update mlockall(2) to mention that it's superuser-only syscall, just
like the mlock(2) manual page says.  Update mlock(2) to say that hitting
RLIMIT_MEMLOCK results in ENOMEM, not EAGAIN.

MFC after:	1 month
2010-07-27 20:34:37 +00:00
Konstantin Belousov
cefac16712 Document pl_siginfo and PT_FLAG_SI for PT_LWPINFO.
MFC after:	1 month
2010-07-10 14:31:44 +00:00
Pawel Jakub Dawidek
da6ee3126b Just like in case of setgroups(2), for getgroups(2) also advice including
sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS
definitions.
2010-06-26 21:44:05 +00:00
Ulrich Spörlein
ef8a3e5cf2 mdoc: remove literal tabs where they don't belong 2010-06-08 16:48:59 +00:00
Colin Percival
8fd6c56d29 Change the current working directory to be inside the jail created by
the jail(8) command. [10:04]

Fix a one-NUL-byte buffer overflow in libopie. [10:05]

Correctly sanity-check a buffer length in nfs mount. [10:06]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:04.jail
Security:	FreeBSD-SA-10:05.opie
Security:	FreeBSD-SA-10:06.nfsclient
2010-05-27 03:15:04 +00:00
Konstantin Belousov
0475ecd50a Improve the documentation for PT_LWPINFO. Note that some features are
not implemented on MIPS and ARM.

MFC after:	1 month
2010-05-24 17:23:14 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Christian Brueffer
0b35d6a71b Document FIONREAD, FIONWRITE and FIONSPACE.
Obtained from:	NetBSD
Submitted by:	emaste
MFC after:	1 week
2010-05-11 17:02:12 +00:00
Jilles Tjoelker
b88c83ff14 sigprocmask(2): pthread_sigmask(3) must be used in threaded processes.
Although libthr's pthread_sigmask() just calls sigprocmask() and this is
unlikely to change, mention this POSIX requirement on applications.

MFC after:	1 week
2010-05-07 20:46:22 +00:00
Kirk McKusick
e27ed89aef Merger of the quota64 project into head.
This joint work of Dag-Erling Smørgrav and myself updates the
FFS quota system to support both traditional 32-bit and new 64-bit
quotas (for those of you who want to put 2+Tb quotas on your users).

By default quotas are not compiled into the kernel. To include them
in your kernel configuration you need to specify:

options         QUOTA                   # Enable FFS quotas

If you are already running with the current 32-bit quotas, they
should continue to work just as they have in the past. If you
wish to convert to using 64-bit quotas, use `quotacheck -c 64';
if you wish to revert from 64-bit quotas back to 32-bit quotas,
use `quotacheck -c 32'.

There is a new library of functions to simplify the use of the
quota system, do `man quotafile' for details. If your application
is currently using the quotactl(2), it is highly recommended that
you convert your application to use the quotafile interface.
Note that existing binaries will continue to work.

Special thanks to John Kozubik of rsync.net for getting me
interested in pursuing 64-bit quota support and for funding
part of my development time on this project.
2010-05-07 00:41:12 +00:00
Jilles Tjoelker
c84cab5626 Update xrefs from 4.3BSD to modern signal functions in various man pages.
sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and
sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2).

Some legacy man pages still refer to them, that is OK.
2010-05-06 22:49:54 +00:00
Jilles Tjoelker
29b7bdea79 sigaltstack(2): document some modernizations:
* un-document 'struct sigaltstack' tag for stack_t as this is BSD-specific;
  this doesn't seem useful enough to document as such
* alternate stacks are per thread, not per process
* update error codes to what the kernel does and POSIX requires

MFC after:	1 week
2010-05-06 22:06:14 +00:00
Kirk McKusick
945f418ab8 Final update to current version of head in preparation for reintegration. 2010-05-06 17:37:23 +00:00
Konstantin Belousov
f742a317e6 Document RUSAGE_THREAD.
Reviewed by:	bde
MFC after:	1 week
2010-05-04 06:01:25 +00:00
Kirk McKusick
a4bf5fb987 Update to current version of head. 2010-04-28 05:33:59 +00:00
Jilles Tjoelker
b559746adb unlinkat(2): unlinkat(AT_REMOVEDIR) fails with ENOTEMPTY like rmdir()
for non-empty directories.

POSIX permits both ENOTEMPTY and EEXIST, but we use the clearer ENOTEMPTY,
following BSD tradition.

MFC after:	1 week
2010-04-25 13:55:52 +00:00
Konstantin Belousov
8d03319930 Revert r206649.
Simplify the presented declaration of struct sigaction, noting the
caveat in the text. Real layout of the structure and exposed
implementation namespace only obfuscates the usage.

Submitted by:	bde
MFC after:	3 days
2010-04-18 18:23:11 +00:00
Konstantin Belousov
fdfa00ba83 Still reference struct __sigaction with clarification when this form
of argument declaration is needed.

Discussed with:	bde
MFC after:	3 days
2010-04-15 08:32:50 +00:00
Konstantin Belousov
c720aa5217 Align the declaration for sa_sigaction with POSIX.
MFC after:	3 days
2010-04-13 08:56:03 +00:00
Ed Schouten
435d267423 Don't forget to bump the date in the man page. 2010-03-28 13:40:13 +00:00
Ed Schouten
510ea843ba Rename st_*timespec fields to st_*tim for POSIX 2008 compliance.
A nice thing about POSIX 2008 is that it finally standardizes a way to
obtain file access/modification/change times in sub-second precision,
namely using struct timespec, which we already have for a very long
time. Unfortunately POSIX uses different names.

This commit adds compatibility macros, so existing code should still
build properly. Also change all source code in the kernel to work
without any of the compatibility macros. This makes it all a less
ambiguous.

I am also renaming st_birthtime to st_birthtim, even though it was a
local extension anyway. It seems Cygwin also has a st_birthtim.
2010-03-28 13:13:22 +00:00