Commit Graph

6373 Commits

Author SHA1 Message Date
Edwin Groothuis
3d74e220a5 strptime(3) confused July with June with the fr_FR locale.
When parsing the month "juillet" (abbr "jul"), %B recognized it as
"juin" (abbr "jui") because the full name of the month names is
checked at the same time as the abbrevation.

The new behaviour checks the full names first before checking the
abbrevation names.

PR:		kern/141939
Submitted by:	Denis Chatelain <denis@tikuts.com>
MFC after:	1 week
2010-05-09 22:01:35 +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
Jilles Tjoelker
8949fcf0dc raise(3): Note that this sends a signal to the current thread, not process.
This is how it works (with threading libraries loaded) and what POSIX
requires.

MFC after:	1 week
2010-05-07 17:20:15 +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
Jilles Tjoelker
67c8bc1bfb sysctl(3): Update description of various kern.* variables.
Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3)
(which is a more convenient way to access some of the variables).

PR:		116480
MFC after:	1 week
2010-04-25 12:35:39 +00:00
Konstantin Belousov
431c9bf2d5 C language does not has references, it provides pointers.
Suggested by:	bde
MFC after:	2 weeks
2010-04-21 19:35:56 +00:00
Konstantin Belousov
7e36a19d51 Add standards section, improve wording, taking into account the handling
of NULL and changed type in declaration.

Suggested by:	bde
MFC after:	2 weeks
2010-04-21 16:41:02 +00:00
Konstantin Belousov
655c8a600b Free() is not allowed to modify errno, remove safety brackets around it [1].
Add small optimization, do not copy a string to the buffer that is
to be freed immediately after.

Noted by:	jh [1]
Reviewed by:	jh
MFC after:	2 weeks
2010-04-20 14:22:29 +00:00
Konstantin Belousov
9d79ec20fb Slightly modernize realpath(3).
SUSv4 requires that implementation returns EINVAL if supplied path is NULL,
and ENOENT if path is empty string [1].
Bring prototype in conformance with SUSv4, adding restrict keywords.
Allow the resolved path buffer pointer be NULL, in which case realpath(3)
allocates storage with malloc().

PR:	kern/121897 [1]
MFC after:	2 weeks
2010-04-20 10:16:44 +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
Jilles Tjoelker
702f62fb48 getcwd(3): Clarify that EACCES may or may not be checked.
POSIX permits but does not require checking access on the current and parent
directories.

Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).

Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.

PR:		standards/44425
MFC after:	2 weeks
2010-04-17 15:52:50 +00:00
Jilles Tjoelker
139ac6b239 fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen.
Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)

PR:		116074
MFC after:	1 week
2010-04-16 22:29:24 +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
Ulrich Spörlein
aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Ulrich Spörlein
e03aa09b61 mdoc: don't abuse Bo/Pc to get what looks like an interval
Be explicit and use the general bracketing form plus symbols which are
to be interpreted mathematically in this case.

Complaint by:	mdocml
Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 18:29:34 +00:00
Ulrich Spörlein
a17c1cc009 mdoc: remove .Pp where not needed
This trips up mdocml and can simply go away.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 18:29:26 +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
Marius Strobl
92cb9b0578 Add #endif missed in r206490. 2010-04-11 21:22:02 +00:00
Marius Strobl
b7e9bee71c While SPARC V9 allows tininess to be detected either before or after
rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
UltraSPARC processors defines that in all cases  tininess is detected
before rounding therefore rounding up to the smallest normalized number
should set the underflow flag. This change is needed for using SoftFloat
on sparc64 for reference purposes.

PR:		144900
Submitted by:	Peter Jeremy
2010-04-11 20:08:54 +00:00
Hajimu UMEMOTO
79bbdc60dc Use the stored length value instead of calculating it by strlen(). 2010-04-06 12:33:05 +00:00
David E. O'Brien
6a18a77221 I feel this wording of the history is more clear.
ANSIfy vasprintf() while I'm here.
2010-04-05 22:09:29 +00:00
Andriy Gapon
f3c733e82b libc/db/hash: cap auto-tuned block size with a value that actually works
This fix mostly matters after r206129 that made it possible for
st_blksize to be greater than 4K.  For this reason, this change should
be MFC-ed before r206129.
Also, it seems that all FreeBSD uitlities that use db(3) hash databases
and create new databases in files, specify their own block size value
and thus do not depend on block size autotuning.

PR:		bin/144446
Submitted by:	Peter Jeremy <peterjeremy@acm.org>
MFC after:	5 days
2010-04-05 10:12:21 +00:00
Andriy Gapon
983419fe1e hash.3: fix a factual mistake in the man page
PR:		bin/144446
Submitted by:	Peter Jeremy <peterjeremy@acm.org>
MFC after:	3 days
2010-04-05 10:01:53 +00:00
Hajimu UMEMOTO
e622b47989 Add capability to use a db version of services. It is enabled by
specifying `db' as source of service in /etc/nsswitch.conf.

MFC after:	2 weeks
2010-04-04 08:31:03 +00:00
Hajimu UMEMOTO
dc6ab8ddb4 Reduce duplicate code.
MFC after:	2 weeks
2010-04-04 07:31:10 +00:00
Hajimu UMEMOTO
aea86367e8 Treat '+' as special only when in compat mode, and simplify
the logic bit.

MFC after:	2 weeks
2010-04-04 07:21:45 +00:00
Hajimu UMEMOTO
8390eaedcc Stop adding trailing '\n'. The servent_unpack() doesn't expect
lines terminated with '\n'.

MFC after:	2 weeks
2010-04-04 07:02:10 +00:00
Xin LI
64c12e81e2 Add prototype for libc internal interfaces. 2010-03-31 18:37:00 +00:00
Xin LI
9fd9d097aa Add prototypes for libc private interfaces.
While I'm there, apply __unused whenever appropriate.

Reviewed by:	md5(1)
2010-03-31 18:36:04 +00:00
Edward Tomasz Napierala
48463a6747 Make acl_to_text_np(3) not crash on long group or user names in NFSv4 ACLs.
PR:		amd64/145091
MFC after:	2 weeks
2010-03-28 17:29:15 +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
Pietro Cerutti
071ab531db - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.
Approved by:	cognet
MFC after:	1 week
2010-03-24 15:59:51 +00:00
John Baldwin
5711bf30da Reject attempts to create a MAP_ANON mapping with a non-zero offset.
PR:		kern/71258
Submitted by:	Alexander Best
MFC after:	2 weeks
2010-03-23 21:08:07 +00:00
Ed Schouten
070f2a9831 Let opendir() use O_DIRECTORY.
I am not removing the fstat() calls here, since we cannot yet assume
people will always run kernels that respect O_DIRECTORY.
2010-03-21 20:45:06 +00:00
Ed Schouten
0fef797f4a Actually make O_DIRECTORY work.
According to POSIX open() must return ENOTDIR when the path name does
not refer to a path name. Change vn_open() to respect this flag. This
also simplifies the Linuxolator a bit.
2010-03-21 20:43:23 +00:00
Marius Strobl
be05bc3ffb Avoid aliasing which leads to incorrect results when compiling with the
default strict aliasing rules.

PR:		144900
Submitted by:	Peter Jeremy
MFC after:	3 days
2010-03-21 13:18:08 +00:00
Marius Strobl
b28ad3ebc9 - While SPARC V9 allows tininess to be detected either before or after
rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
  UltraSPARC processors defines that in all cases tinyness is detected
  before rounding, therefore rounding up to the smallest normalised
  number should set the underflow flag.
- If an infinite result is rounded down, the result should have an
  exponent 1 less than the value for infinity.

PR:		144900
Submitted by:	Peter Jeremy
MFC after:	3 days
2010-03-20 22:32:13 +00:00
Marius Strobl
bd2ec8519e Division should take both arguments' signs into account when the
the dividend is infinity or zero and the divisor is not the same.

PR:		144900
Submitted by:	Peter Jeremy
MFC after:	3 days
2010-03-20 22:12:15 +00:00
Marius Strobl
484bacf4b9 FPU_DEBUG requires <stdio.h>.
PR:		144900
Submitted by:	Peter Jeremy
MFC after:	3 days
2010-03-20 21:27:44 +00:00
Marius Strobl
4dda9dfd81 Ensure that __fpu_ftox() both returns the high bits and res[1] contains
the low bits also in the default case.

PR:		144900
Obtained from:	OpenBSD
MFC after:	3 days
2010-03-20 21:15:56 +00:00
Marius Strobl
564b3fffdd - Remove a bogus forward declaration.
- Fix whitespace.
2010-03-20 21:04:47 +00:00
Kirk McKusick
516ad57b74 Debugging nits found while testing the new 64-bit quota code. 2010-03-16 06:12:30 +00:00
Poul-Henning Kamp
156a1661a6 Comment a fine point, so it does not get lost when people borrow code
from FreeBSD for other purposes.
2010-03-15 08:58:35 +00:00