Commit Graph

4776 Commits

Author SHA1 Message Date
Tim J. Robbins
ea9a9a377b Add UTF-8-specific implementations of mbsnrtowcs() and wcsnrtombs().
These convert plain ASCII characters in-line, making them only slightly
slower than the single-byte ("NONE" encoding) version when processing
ASCII strings.
2004-07-27 06:29:48 +00:00
Tim J. Robbins
16018100a7 Add an nftw(3) link. 2004-07-25 11:17:54 +00:00
David Schultz
9b5f005228 Remove unused variable.
Noticed by:	Todd Miller <Todd.Miller@courtesan.com>
2004-07-23 06:01:00 +00:00
Tim J. Robbins
6740cd8374 Return the correct value when dst == NULL and conversion has stopped after
nwc dropping to zero.
2004-07-22 02:57:29 +00:00
Hajimu UMEMOTO
0def575fd7 now e.f.f.3.ip6.arpa is delegated, we no longer need to query ip6.int
Obtained from:	KAME
2004-07-21 17:26:40 +00:00
Tim J. Robbins
7d7287dc7d Read directly from the stdio buffer using the new __mbsnrtowcs() interface
instead of making repeated calls to __fgetwc().
2004-07-21 12:12:48 +00:00
Tim J. Robbins
1949a3470f Implement the GNU extensions of mbsnrtowcs() and wcsnrtombs(). These are
convenient when the source string isn't null-terminated.

Implement the other conversion functions (mbstowcs(), mbsrtowcs(), wcstombs(),
wcsrtombs()) in terms of these new functions.
2004-07-21 10:54:57 +00:00
Tim J. Robbins
2f2c1839f8 Use __wcsrtombs() and __sfvwrite() to convert and write the wide character
string instead of multiple calls to __fputwc().
2004-07-21 08:35:18 +00:00
Christian S.J. Peron
ef6dea1404 Back out previous commit. Even though statfs(2) can take a regular
file as an argument, it may still fail for the same reasons that
open(2) can.

Pointed out by:	Jilles Tjoelker
Apporived by:	bmilekic (mentor)
2004-07-20 19:30:57 +00:00
Christian S.J. Peron
5b154abc54 Remove reference to ENOTDIR in the documented errors
for statfs(2). This is false, if the pathname specified
is a regular file, then the information for the file
system that the file lives on will be returned.

Approved by:	bmilekic (mentor)
2004-07-20 18:35:33 +00:00
Tim J. Robbins
f9ceea9bf1 Call __mbrtowc() and __wcrtomb() directly instead of taking detours
through mbrtowc() and wcrtomb().
2004-07-20 08:27:27 +00:00
Andrew Gallatin
df11547f5d Fix printing of long doubles to match the size that
gcc is using.  This fixes devstat consumers (like vmstat, iostat,
systat) so they don't print crazy zillion digit numbers for
disk transfers and bandwidth.

According to gcc, long doubles are 64-bits, rather than 128 bits
like the SVR4 ABI spec wants them to be..  Note that MacOSX also treats
long doubles as 64-bits, and not 128 bits, so we are in good company.

Reviewed by: das
Approved by: grehan
2004-07-19 23:56:07 +00:00
Peter Grehan
cc73b0f03d Add signalcontext, required by KSE. 2004-07-19 12:08:03 +00:00
Peter Grehan
44d1098779 The new program counter should go into the trapframe's srr0 and
not the link register, which was lucky enough to work.
2004-07-19 12:05:07 +00:00
Tim J. Robbins
2ff3ba336e Update paths to reg*.c and regex2.h. Add a target to build regex.h. 2004-07-19 08:48:17 +00:00
Tim J. Robbins
405033831e Update for removal of cclass.h. Trim some useless targets. Invoke mkh
with "sh mkh" so it works if the script is not executable.
2004-07-19 08:41:11 +00:00
Tim J. Robbins
ec8b0411f1 Update for recent changes to struct re_guts. Disable printing the contents
of OANYOF sets for the moment.
2004-07-19 08:28:53 +00:00
Tim J. Robbins
f420a25887 Remove unused files. 2004-07-19 08:24:21 +00:00
David Schultz
479f8d2214 Make FLT_ROUNDS correctly reflect the dynamic rounding mode. 2004-07-19 08:17:25 +00:00
David Schultz
ec79bc0da9 Fix two bugs in the signbit() macro, which was implemented last year:
- It was added to libc instead of libm.  Hopefully no programs rely
  on this mistake.

- It didn't work properly on large long doubles because its argument
  was converted to type double, resulting in undefined behavior.
2004-07-19 08:16:10 +00:00
David Schultz
39bcea8689 Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.
2004-07-18 21:23:39 +00:00
Tim J. Robbins
ad3d799334 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR:	57911 (related)
2004-07-18 10:11:27 +00:00
Tim J. Robbins
613e383e81 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR:	57911
2004-07-18 06:56:40 +00:00
Tim J. Robbins
ad19b09bec Fix typo: carat -> caret. 2004-07-17 12:27:25 +00:00
Hartmut Brandt
b711f5ddea Document the MSG_DONTWAIT flag. 2004-07-16 17:15:37 +00:00
Tim J. Robbins
2508f480c2 Add a cross reference to fgetwln(3). 2004-07-16 06:07:12 +00:00
Tim J. Robbins
9531ef0fc1 Add fgetwln(), a wide character version of fgetln(). 2004-07-16 06:06:09 +00:00
Tim J. Robbins
66d56cb7b8 Rename slbexpand() to __slbexpand() and make it available outside
of fgetln.c (non-static).
2004-07-16 05:52:51 +00:00
Alfred Perlstein
85e8765b7e Clarify getfsstat(2) usage.
The getfsstat(2) function expects a buffer and a count, and returns a count.

The confusing part is that the count it takes is a byte count, while the
return value is a count of the number of structures it has filled out.

Spell this out.
2004-07-16 01:18:13 +00:00
Tim J. Robbins
ee5d8a1b0a Remove an entry from the BUGS section: we have multibyte character
support now.
2004-07-12 11:03:42 +00:00
Tim J. Robbins
e5996857ad Make regular expression matching aware of multibyte characters. The general
idea is that we perform multibyte->wide character conversion while parsing
and compiling, then convert byte sequences to wide characters when they're
needed for comparison and stepping through the string during execution.

As with tr(1), the main complication is to efficiently represent sets of
characters in bracket expressions. The old bitmap representation is replaced
by a bitmap for the first 256 characters combined with a vector of individual
wide characters, a vector of character ranges (for [A-Z] etc.), and a vector
of character classes (for [[:alpha:]] etc.).

One other point of interest is that although the Boyer-Moore algorithm had
to be disabled in the general multibyte case, it is still enabled for UTF-8
because of its self-synchronizing nature. This greatly speeds up matching
by reducing the number of multibyte conversions that need to be done.
2004-07-12 07:35:59 +00:00
Tim J. Robbins
67aff1896c Add a new error code, REG_ILLSEQ, to indicate that a regular expression
contains an illegal multibyte character sequence.
2004-07-12 06:07:26 +00:00
Marcel Moolenaar
b41e0f0f56 Document the new PT_LWPINFO request. In fact, the request is so new
it hasn't even been implemented yet. I just wanted to be the first
to try a new approach to development ;-)
2004-07-12 04:43:58 +00:00
Tim J. Robbins
80f363668e Remove incomplete support for multi-character collating elements. Remove
unused character category calculations.
2004-07-11 05:58:31 +00:00
Marcel Moolenaar
f5eda2f1cb Unbreak alpha: On alpha a long double is the same as a double and
consequently the exponent is only 11 bits. Testing whether the
exponent equals 32767 in that case only effects to compiler warnings
and thus build breakage.
2004-07-10 15:52:26 +00:00
Tim J. Robbins
550473de5b Add fast paths for conversion of plain ASCII characters. 2004-07-09 15:46:06 +00:00
Tim J. Robbins
fcc5191787 Slightly reorganize and simplify. 2004-07-09 15:12:10 +00:00
David Schultz
ad93428d7a Bump document date for recent changes.
Prodded by:	ru
2004-07-09 06:37:44 +00:00
David Schultz
3bdf026534 Document these functions as being in libm, not libc. Some of them
*are* in libc for historical reasons, but programmers should not rely
on that fact.

Also remove a BUGS section that is not relevant here.
2004-07-09 03:33:00 +00:00
David Schultz
240dbabfa8 Implement the classification macros isfinite(), isinf(), isnan(), and
isnormal() the hard way, rather than relying on fpclassify().  This is
a lose in the sense that we need a total of 12 functions, but it is
necessary for binary compatibility because we have never bumped libm's
major version number.  In particular, isinf(), isnan(), and isnanf()
were BSD libc functions before they were C99 macros, so we can't
reimplement them in terms of fpclassify() without adding a dependency
on libc.so.5.  I have tried to arrange things so that programs that
could be compiled in FreeBSD 4.X will generate the same external
references when compiled in 5.X.  At the same time, the new macros
should remain C99-compliant.

The isinf() and isnan() functions remain in libc for historical
reasons; however, I have moved the functions that implement the macros
isfinite() and isnormal() to libm where they belong.  Moreover,
half a dozen MD versions of isinf() and isnan() have been replaced
with MI versions that work equally well.

Prodded by:	kris
2004-07-09 03:32:40 +00:00
Garrett Wollman
5b1eaa7bb6 Eliminate some magic numbers and correct description of _PC_NO_TRUNC.
Slight emendation to _PC_CHOWN_RESTRICTED, which is in a very similar
boat.
2004-07-08 20:27:38 +00:00
Tim J. Robbins
ee446de0b1 Add a function to iterate over all characters in a particular character
class. This is necessary in order to implement tr(1) efficiently in
multibyte locales, since the brute force method of finding all characters
in a class is infeasible with a 32-bit (or wider) wchar_t.
2004-07-08 06:43:37 +00:00
Alfred Perlstein
83f46f9e33 there's no such define as KERN_NAME_MAX, change to _POSIX_NAME_MAX. 2004-07-07 20:47:42 +00:00
Ruslan Ermilov
5792ef0983 Markup nits. 2004-07-07 20:15:31 +00:00
Ruslan Ermilov
1c5f1e7afd Fixed markup. 2004-07-07 20:11:35 +00:00
Ruslan Ermilov
2410103c1d mdoc(7) fixes. 2004-07-07 19:57:16 +00:00
Hiten Pandya
af73aa7cce Move the return value information about the getenv(3) library function
under the RETURN VALUES section so it is consistent with others.

Cleanup the return value text for getenv(3) a little while I am here.

PR:     	docs/58033
MFC after:	3 days
2004-07-06 23:21:36 +00:00
Andrey A. Chernov
42aeacc4d4 Keep it sync with OpenBSD:
An optional argument cannot start with '-', even if permutation is
disabled.

Obtained from: OpenBSD getopt_long.c v1.17
2004-07-06 13:58:45 +00:00
Tim J. Robbins
65b2e19ef7 Document incorrect handling of multibyte characters. 2004-07-06 09:20:51 +00:00
David Schultz
b03b864ac9 Add implementations of ftw(3) and nftw(3) and the corresponding header
ftw.h.  This is the implementation written by Joel Baker
<fenton@debian.org> for inclusion in NetBSD, but with several
bugfixes.

Obtained from:	Debian
2004-07-05 23:13:16 +00:00
David Schultz
c8f7bbe36b Documentation for ftw(3) and nftw(3).
Obtained from:	OpenBSD
2004-07-05 23:12:11 +00:00
Ruslan Ermilov
51f98e585b Fix the NAME section making whatis(1) happy in particular. 2004-07-05 17:12:53 +00:00
Ruslan Ermilov
1af1ea79a8 Markup fixes. 2004-07-05 07:21:55 +00:00
Ruslan Ermilov
b9384efc1c Markup nits. 2004-07-05 06:39:03 +00:00
Ruslan Ermilov
1c85060a13 Sort SEE ALSO references (in dictionary order, ignoring case). 2004-07-04 20:55:50 +00:00
Colin Percival
0a31135d11 Add commentary explaining why we return EBADF upon attempts to fflush() a
read-only file.

Discussed on:	-current
2004-07-04 20:17:00 +00:00
Stefan Farfeleder
5908d366fb Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.
2004-07-04 16:11:03 +00:00
Ruslan Ermilov
a817e9e674 Fixed markup. 2004-07-03 23:14:34 +00:00
Ruslan Ermilov
30950a21e1 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
Ruslan Ermilov
1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
David Xu
39ba326d65 Follow previous change in makecontext. Use %esi to store next ucp
pointer, here we keep orignal %ebp, so we can see where signal handler
comes in and interrupt normal code.
2004-07-02 23:20:05 +00:00
Ruslan Ermilov
d37ea99837 Removed trailing whitespace. 2004-07-02 19:07:33 +00:00
Ruslan Ermilov
26b6c45a92 Markup tidying. 2004-07-02 16:45:56 +00:00
David Xu
a5a5d84784 Use %esi to store next ucp pointer. Mark end of stack by
setting %ebp to zero, this avoids new gdb to dump a weird
backtrace.
2004-07-02 14:19:44 +00:00
Ruslan Ermilov
33992dc0ed Markup, grammar, and spelling fixes. 2004-06-30 20:09:10 +00:00
Ruslan Ermilov
bd486f888e Fixed a typo. 2004-06-30 19:32:41 +00:00
Tim J. Robbins
b7114d4a9c Fix typo: WRDE_DOOFS -> WRDE_DOOFFS.
Noticed by:	Stoned Elipot
2004-06-30 13:55:08 +00:00
Roman Kurakin
f01a74582c s/SS_CANTSENDMORE/SBS_CANTSENDMORE/ 2004-06-24 10:53:44 +00:00
Tim J. Robbins
ddc1eded85 Prefix the names of members of _RuneLocale and its sub-structures
with ``__'' to avoid polluting the namespace. This doesn't change the
documented rune interface at all, but breaks applications that accessed
_RuneLocale directly.
2004-06-23 07:01:44 +00:00
Bruce M Simpson
cb450d2233 Be specific about which socket properties are inherited from the original
socket upon accept(2).

PR:	docs/54995, kern/45733
2004-06-23 00:20:46 +00:00
Mike Pritchard
6b4a832600 Spelling fixes. 2004-06-21 20:10:35 +00:00
Mike Pritchard
c20133b039 Spelling fixes. 2004-06-21 19:54:56 +00:00
Mike Pritchard
14243126c5 Spelling fixes. 2004-06-21 19:38:25 +00:00
Mike Pritchard
811815574d Spelling fixes. 2004-06-21 19:30:45 +00:00
Mike Pritchard
3c6dd63b2c Spelling fixes. 2004-06-21 18:57:32 +00:00
Mike Pritchard
12270048ca PR: docs/67884
Submitted by:	Chirstopger Nehren <apeiron@comcast.net>
2004-06-21 18:24:48 +00:00
Kelly Yancey
0a0163040b CLOCK_PROF and CLOCK_VIRTUAL are implemented now. 2004-06-17 23:13:38 +00:00
Robert Watson
804613dc06 Add reference to mac_get_link() in man page, which was omitted when
mac_get_link() and mac_set_link() were added.
2004-06-17 16:08:36 +00:00
Hajimu UMEMOTO
a214cd1abd Rename variable name from name' to hostname'.
This is a corresponding change to bin/67994.  I'll soon commit
bin/67994 into 4-STABLE.  Actually, 5-CURRENT's getaddrinfo()
doesn't have the problem mentiond in bin/67994.  However, it is
good to be in sync variable name with 4-STABLE and KAME.

PR:		bin/67994
Submitted by:	JINMEI Tatuya <jinmei@ocean.jinmei.org>
2004-06-16 16:41:23 +00:00
David Xu
2ff285bf2e Avoid to touch red zone, in libpthread, ucontext may be saved by kernel's
get_mcontext, and libpthread will use signalcontext to deliver signal in
userland, it looks same as kernel's send_sig does.

Reviewed by: deischen, tjr
2004-06-15 21:46:36 +00:00
Kelly Yancey
2aab594f92 The maximum value of iovcnt is IOV_MAX, not 16. 2004-06-15 01:24:41 +00:00
Bruce M Simpson
92b5c26f34 Document the location of the header file which declares the function
prototypes documented in this manual page.

PR:		bin/4459
2004-06-14 18:41:24 +00:00
Bruce M Simpson
445d6be61e Date bump.
Requested by:	krion
2004-06-14 14:24:18 +00:00
Bruce M Simpson
3c6ba09bdf Document some return values.
PR:		bin/22198
Submitted by:	Nick Johnson (with cleanups)
2004-06-14 14:18:41 +00:00
Stefan Farfeleder
cdff05fa7f Merge changes from the tzcode2004a import. Wherever possible I tried to bring
us closer to the vendor branch.

Requested by:	wollman
2004-06-14 10:31:52 +00:00
David Schultz
d2b8f61223 Use .Dv instead of .Li for all the RLIMIT_* constants.
Requested by:	ru
2004-06-14 01:32:40 +00:00
David Schultz
c294e3b58c Document RLIMIT_AS. While here, correct an insertion sort error. 2004-06-13 22:19:29 +00:00
Stefan Farfeleder
d06ecced73 Remove a stale reference to %Ef and %EF from a comment. 2004-06-13 16:20:23 +00:00
Ken Smith
f64520dfb8 Change defualt time zone from GMT to UTC. This will not be MFC-ed, and
was done before 5-STABLE on purpose...
2004-06-11 03:34:02 +00:00
Stefan Farfeleder
14e4372584 Remove a couple of casts added for an ancient Sun compiler.
Approved by:	das (mentor)
2004-06-08 12:20:40 +00:00
Stefan Farfeleder
cf6fc3417a The third operand of the conditional operator should have type void too.
Approved by:	das (mentor)
2004-06-08 12:03:48 +00:00
David Schultz
1e03bff7f2 In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode.  Of course this
won't work for long paths, but we can't descend more than one pathname
component beyond the directory anyway if we lack search permission.

Here is a transcript demonstrating the change, where oldls is ls(1)
linked with the old fts(3):

	das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t
	das@VARK:~> oldls t
	a       b       c
	das@VARK:~> oldls -l t
	das@VARK:~> \ls t
	a       b       c
	das@VARK:~> \ls -l t
	ls: a: Permission denied
	ls: b: Permission denied
	ls: c: Permission denied

I had forgotten about this patch until bde reminded me.  He reports
using it without problems for over a year.

PR:	45723
2004-06-08 06:23:23 +00:00
David Schultz
92a5b2ee71 Rename cantwrite() to prepwrite(). The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects.
Also, don't set errno if prepwrite() fails, since this is done in
prepwrite() now.
2004-06-08 05:45:48 +00:00
David Schultz
52183d4654 Rename cantwrite() to prepwrite(). The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects.
2004-06-08 05:45:32 +00:00
David Schultz
325d97d0d1 Set errno to EBADF on attempts to write to a stream that is not
writable.  Affected callers include fwrite(), put?(), and *printf().
The issue of whether this is the right errno for funopened streams is
unresolved, but that's an obscure case, and some errno is better than
no errno.

Discussed with:	bde, jkh
2004-06-08 05:44:52 +00:00
Yaroslav Tykhiy
e7aa25d3fb Use ".In" to mark up C include file names. 2004-06-07 21:52:20 +00:00
Yaroslav Tykhiy
cacc8e6c5d Each sentence should begin on a new line. 2004-06-07 21:48:02 +00:00
Yaroslav Tykhiy
431c0866bb Extend and improve the mdoc(7) markup of this page.
Reviewed by:	ru
2004-06-07 21:43:14 +00:00
Yaroslav Tykhiy
35641ec00f Finally document the option to avoid zombie creation
through ignoring SIGCHLD.
2004-06-07 11:01:39 +00:00
Peter Pentchev
c56864a7a7 Fix the ordering in the description of the dlsym() lookup procedure to
reflect src/libexec/rtld-elf/rtld.c rev. 1.68 - the globally-loaded
objects (RTLD_GLOBAL) are searched before the local object's DAG's.

PR:		62770
Submitted by:	Kimura Fuyuki <fuyuki@nigredo.org>
2004-06-03 10:13:26 +00:00
Hajimu UMEMOTO
146cd1bc0a use source address as a hint to determine destination address
by getipnodebyname().
2004-06-02 06:49:36 +00:00
Brooks Davis
cf7549084d Add Aerospace Corporation copyrights to EUI64 support files.
Suggested by:	marcel, imp
2004-06-01 19:30:13 +00:00
Tim J. Robbins
95a535af6d Change the signature of ftok from (const char *, char) to (const char *, int)
Obtained from:	NetBSD (christos)
2004-06-01 06:53:07 +00:00
Hajimu UMEMOTO
251b48a1bb Treat IPv4 private address as global scope rather than site scope.
Though it breaks RFC 3484, without this change, dest addr selection
doesn't work well under NAT environment.
2004-05-31 21:09:14 +00:00
Hajimu UMEMOTO
4d489f472b use source address as a hint to determine destination address.
Obtained from:	KAME
2004-05-31 19:27:54 +00:00
Tim J. Robbins
c05bd9ae25 Buffer partial wide characters more efficiently: instead of storing the
multibyte representation in conversion state objects, store the
accumulated wide character, set number and number of bytes remaining
to avoid having to derive them every time mbrtowc() is called.
2004-05-27 10:54:34 +00:00
Brooks Davis
7387768ef4 Add support for an /etc/eui64 file modeled on /etc/ethers. The API is
modeled on ethers(3) except that all functions are thread-safe.

Reviewed by:	simokawa
2004-05-26 22:58:06 +00:00
Tim J. Robbins
18b2031298 Scan the source string for invalid wide characters in wcsrtombs()
in the dst == NULL case.
2004-05-25 10:45:24 +00:00
Tim J. Robbins
e7e4715db2 Provide trivial macro implementations of getwc(), getwchar(), putwc() and
putwchar() to reduce function call overhead.
2004-05-25 10:42:52 +00:00
Tim J. Robbins
675e7ddbee Grab all the information we need about a character with one call to
__maskrune() instead of one direct call and one through iswprint().
2004-05-23 13:20:09 +00:00
Tim J. Robbins
d6ed810a67 Perform conversions straight from the stream buffer instead of scanning
through byte by byte with mbrtowc(). In the usual case (buffer is big
enough to contain the multibyte character, character does not straddle
buffer boundary) this results in only one call to mbrtowc() for each
wide character read.
2004-05-22 15:41:03 +00:00
Tim J. Robbins
87275e436a Associate a multibyte conversion state object with each stream. Reset it
to the initial state when a stream is opened or seeked upon. Use the
stream's conversion state object instead of a freshly-zeroed one in
fgetwc(), fputwc() and ungetwc().

This is only a performance improvement for now, but it would also be
required in order to support state-dependent encodings.
2004-05-22 15:19:41 +00:00
Alan Cox
db9081ab70 Update the document date.
Reminded by:	ru@
2004-05-20 18:47:15 +00:00
Alan Cox
5ae2d19711 Remove a long obsolete paragraph from the BUGS section. 2004-05-19 03:25:17 +00:00
Peter Wemm
b320e7fae7 For amd64, explicitly compile mcount.po, rather than copying mcount.o. We
need to compile it with -fno-omit-frame-pointers since the mcount code
depends on that, and by default it omits them without -pg.
2004-05-18 22:49:15 +00:00
Yaroslav Tykhiy
d0080709e7 Clarify and extend paragraphs on interoperation
of fcntl(2), flock(2), and lockf(3) advisory locks.
Add such a paragraph to the flock(2) manpage for the
sake of consistency.

Reviewed by:	Cyrille Lefevre and Kirk McKusick on -arch
MFC after:	2 weeks
2004-05-17 23:09:10 +00:00
Tim Kientzle
9b8f137b2d getgrent() and friends should set errno if there is an error.
Also, clarify the manpage description of when errno is set and
explain that clients should set errno=0 first if they want useful
error information.
2004-05-17 22:15:49 +00:00
Tim Kientzle
5edb850fbe POSIX prohibits any library function from setting errno to 0.
Correct my previous commit and add a comment to the manpage
indicating that the user must set errno to 0 if they wish to
distinguish "no such user" from "error".

Pointed out by: Jacques Vidrine (nectar@)
2004-05-17 18:27:05 +00:00
Tim J. Robbins
5e44d7ebe1 Use conversion state objects to store the accumulated wide character,
low bound, and the number of bytes remaining instead of storing the
raw byte sequence and deriving them every time mbrtowc() is called.
This is much faster -- about twice as fast in some crude benchmarks.
2004-05-17 12:32:40 +00:00
Tim J. Robbins
6107476759 Use a simpler and faster buffering scheme for partial multibyte characters. 2004-05-17 11:16:14 +00:00
Tim Kientzle
b4cc8687ad If getpwent/getpwuid/getpwnam return NULL, they must also set errno. 2004-05-17 06:17:59 +00:00
Tim J. Robbins
b666b593eb Use a simpler, faster buffering scheme for partial characters in mbrtowc(). 2004-05-14 15:40:47 +00:00
Olivier Houchard
15144b0f96 Import the softfloat emulation library, needed for FreeBSD/arm right now.
It should become useless when gcc 3.4 will be imported, as libgcc from
gcc 3.4 contains this bits for arm.
2004-05-14 12:13:06 +00:00
Olivier Houchard
2357939bc2 Import the FreeBSD/arm libc bits.
Obtained from:	NetBSD
2004-05-14 12:04:31 +00:00
Olivier Houchard
1d7c6c3311 We use __arm__, not __arm32__. 2004-05-14 11:51:22 +00:00
Olivier Houchard
57734c02cd Define malloc_pageshift and malloc_minsize for arm. 2004-05-14 11:50:51 +00:00
Bruce Evans
a1acdbf008 Fixed some minor style bugs. 2004-05-13 15:59:38 +00:00
Tim J. Robbins
ea4ac135ff Allow encoding modules to override the default implementations of
mbsrtowcs() and wcsrtombs(). Provide a fast implementation for the
trivial "NONE" encoding.
2004-05-13 11:20:27 +00:00
Tim J. Robbins
f789f94dbb Fix braino in previous: check that the second byte in the character
buffer is non-null when the character is two bytes long, not when
the buffer is two bytes long.
2004-05-13 03:08:28 +00:00
Peter Edwards
07dee1a777 Fix some^Wseveral style bugs from last commit.
Remove "sys/types.h" as "sys/param.h" is already included

Use cast rather than back-pointer to convert from public to private
version of FTS data, and so avoid littering fts.h with any of the
details.

Pointed out By: bde, kientzle
2004-05-12 21:38:39 +00:00
Josef El-Rayes
ac006f74fd Fix typo.
Submitted by:	Michel Lavondes <fox@vader.aacc.cc.md.us>
PR:		docs/66576
2004-05-12 20:45:51 +00:00
Tim J. Robbins
6155c34adf Reduce overhead by calling internal versions of the multibyte conversion
functions directly wherever possible.
2004-05-12 14:26:54 +00:00
Tim J. Robbins
2051a8f2d5 Move prototypes of various encoding-related functions into a new header
file to avoid extern'ing them all over the place.
2004-05-12 14:09:04 +00:00
Ruslan Ermilov
cb30b9c545 Link radixsort(3) to sradixsort(3), make the latter appear in
the whatis(1) output.
2004-05-12 08:13:40 +00:00
Christian S.J. Peron
1f95348010 Document the fact that in a jailed environment, sendto(2) could fail
returning EPERM if the source address specified in the IP header did
not match the address bound to the prison.

Approved by:	bmilekic (mentor)
2004-05-11 16:28:07 +00:00
Tim J. Robbins
88af941a73 In the absence of proper validation, at least check that null bytes
do not appear as anything but the first byte of a multibyte character.
2004-05-11 14:08:22 +00:00
Diomidis Spinellis
857b57eae1 Remove a trailing newline, to behave as documented in syslog(3):
"A trailing newline is added if none is present."

The code in syslogd, stderr, and console output always adds a newline
at the EOL.  However, the existing code never actually removed a
trailing newline, and apparently relied on syslogd to convert it
into a space character.  Thus, the existing newline was converted
to a trailing space at the EOL by syslogd, while stderr, and console
output resulted in an empty line.

MFC after:	2 weeks
2004-05-10 17:12:52 +00:00
Bruce Evans
d98d9ce623 Fixed style bugs in previous commit (bogus forward declaration and
inconsistent capitalization in comments).
2004-05-10 09:36:26 +00:00
Tim J. Robbins
45a11576f3 Use a binary search to find the range containing a character in
RuneRange arrays. This is much faster when there are hundreds of
ranges (as is the case in UTF-8 locales) and was inspired by a
similar change made by Apple in Darwin.
2004-05-09 13:04:49 +00:00
Christian Brueffer
b17e85fede o fix a sentence to match with the synopsis [1]
o fix grammar nit

PR:		66289 [1]
Submitted by:	Michel Lavondès <fox@vader.aacc.cc.md.us>
Obtained from:	OpenBSD [1]
MFC after:	3 days
2004-05-09 11:11:21 +00:00
Peter Edwards
99ca5b8804 The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory
has. It assumes that each subdirectory will have a hard link to its
parent, to represent the ".." node, and stops calling stat(2) when
all links are accounted for in a given directory.

This assumption is really only valid for UNIX-like filesystems: A
concrete example is NTFS. The NTFS "i-node" does contain a link
count, but most/all directories have a link count between 0 and 2
inclusive. The end result is that find on an NTFS volume won't
actually traverse the entire hierarchy of the directories passed
to it. (Those with a link count of two are not traversed at all)

The fix checks the "UFSness" of the filesystem before enabling the
optimisation.

Reviewed By: Tim Kientzle (kientzle@)
2004-05-08 15:09:02 +00:00
Tim Kientzle
542fc1042b A minor refactoring to simplify portability: assign the filename
length to a separate variable so that it will be easier to adapt to
systems that don't have d_namlen in struct dirent.
2004-05-05 06:33:00 +00:00
David E. O'Brien
253f85d3c9 Remove bogus FBSDID. 2004-05-02 20:13:29 +00:00
David E. O'Brien
af15264014 Fix damaged FBSDID. 2004-05-02 20:09:14 +00:00
David Schultz
30d3088041 Merge vfscanf.c, v1.37:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
2004-05-02 10:56:26 +00:00
David Schultz
ce2551ad29 Merge vfprintf.c, v1.65:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
- Remove HEXFLOAT
2004-05-02 10:56:17 +00:00
David Schultz
757edc654e Add option NO_FP_LIBC, which disables floating-point support in
*printf() and *scanf().  Currently, this reduces the size of libc.so
by 9K on i386.  But the real savings are for static binaries that use
*printf() or *scanf() but not strtod(); with an FP-disabled libc,
these binaries will not depend on the gdtoa routines, making each
binary about 22K smaller.
2004-05-02 10:55:07 +00:00
David Schultz
8de9e89719 - To make it easier to compile *printf() and *scanf() without
floating-point support, remove default definition of FLOATING_POINT
  from the source, and change the compile-time option to
  NO_FLOATING_POINT.
- Remove the HEXFLOAT option.  It saves an insignificant amount of
  space (<0.1% of the size of libc on i386) and complicates vfprintf()
  and checkfmt().
2004-05-02 10:55:06 +00:00
David Schultz
38d17374b2 When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.
2004-05-02 10:55:05 +00:00
Ruslan Ermilov
d1ec91e353 Markup nit. 2004-04-27 09:18:49 +00:00
Andrey A. Chernov
28aec5a68c Rewrite split_lines() to operate safely
PR:             62694
Submitted by:   moulin p <moulin.p@calyopea.com>
2004-04-25 19:56:50 +00:00
Tim J. Robbins
ccc8c6c31f Use the correct size to allocate, copy and clear argument type tables
after their change from an array of char to an array of enum.
This fixes problems that occurred when using positional arguments in
format strings, particularly with more than STATIC_ARG_TBL_SIZE (8)
of them.

PR:		65841
Submitted by:	Steven Smith (mostly)
2004-04-22 11:35:12 +00:00
Jonathan Chen
dbb4b1c83d Fix a bug that could result in getpw*() incorrectly returning NULL when NIS
adjunct maps are used.  One symtom of this bug is sshd saying:
	login_get_lastlog: Cannot find account for uid X
when logging in.  The problem here is caused by an incorrect reuse of the rv
variable when previous values are needed later.
2004-04-21 21:15:08 +00:00
Ruslan Ermilov
2d695ed31d Unbreak world. 2004-04-21 09:50:52 +00:00
Nate Lawson
1cc11684ac MFdragonfly: resolver fix for timeouts on unqualified hostnames
res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND*
  hp->rcode == SERVFAIL.  However, there are cases such as timeouts where
  rcode is not always set to SERVFAIL.  This leads to inconsistent nameserver
  operation during multi-domain and truncated dot searches, especially during
  booting when portions of the network are being brought up simultanious with
  dns lookups.

  This patch attempts to correct the problem by unconditionally terminating
  the search if TRY_AGAIN is returned (after res_query has gone through all
  retries and name servers) instead of trying other domain elements in the
  domain seach path.

  This patch should fix reported problems (which I can reproduce) with some
  NFS mounts failing during boot.  This occured because mount_nfs thought the
  host name lookup returned a definitive failure using a non-dotted host name
  when, in fact, it timed out on the first part (host.search.domain.name) and
  got a definitive host-not-found response on the second part (host.).

  Generally speaking, search path name server timeouts can exceed 60 seconds
  per element and most machines which consistently timeout on earlier portions
  of a search path are effectively non-operational due to the imposed delays.
  It is more important for DNS lookups to return the proper error code then
  to be able to recover a valid lookup in later portions of the search path
  in these situations.

Obtained from:	DragonFly
MFC after:	3 weeks
2004-04-21 00:56:38 +00:00
Colin Percival
3b38d66be6 Add mention of the fact that timeouts are silently limited to 24 hours.
Observed by:	jmg
2004-04-20 21:07:43 +00:00
Colin Percival
b6f7c57ecf Document POSIX stupidity: Attempts to mmap zero bytes will succeed (and
have no effect), while attempts to munmap zero bytes will fail.
2004-04-18 23:36:45 +00:00
Christian Brueffer
e2738131b1 Bring describtion of a sysctl in line with the source:
kern.acct_chkfreq is specified in seconds, not minutes.

Cluebat provided by:	kensmith
2004-04-16 22:53:51 +00:00
Christian Brueffer
0d5d3ffdb7 Remove unnecessary .Pp macro and bump document date
Submitted by:	ru
2004-04-16 22:38:54 +00:00
Christian Brueffer
e8490b5cb4 List some sysctl variables that influence accounting
PR:		65070
Submitted by:	Marc Silver <marcs@draenor.org>
X-MFC after:	re approval
2004-04-16 20:32:56 +00:00
Tim J. Robbins
fc813796d2 Perform some basic validation of multibyte conversion state objects. 2004-04-12 13:09:18 +00:00
Tim J. Robbins
c282a0a1ed Remove a nonsensical remark about byte order markers in UTF-8 streams. 2004-04-12 12:58:41 +00:00
Maxime Henrion
4af6b50978 Belatedly remove the getvfsent(3) API. All the consumers have been
updated to use getvfsbyname(3) or the vfs.conflist sysctl since a
long time, except mount_smbfs(8) which has just been fixed.
2004-04-11 21:36:31 +00:00
Tim J. Robbins
78c4a3f225 Document the meaning of the zero return value. 2004-04-11 05:19:19 +00:00
David Xu
6464650388 Fix a typo. I was locked out for two days from my machine. 2004-04-10 14:36:57 +00:00
Tim J. Robbins
fa02ee78c8 Don't cast away const qualifiers.
Spotted by:	bde
2004-04-10 00:27:52 +00:00
Tim J. Robbins
7937c23d49 Terminate execl()'s argument list with a null pointer instead of a
null pointer constant. (The latter may be an integer constant, which
is not correct here.)

Submitted by:	Stefan Farfeleder
2004-04-09 11:32:32 +00:00
Tim J. Robbins
8b8109275c Update manual pages for change to C99 mbrtowc() semantics. 2004-04-08 09:59:02 +00:00
Tim J. Robbins
ca2dae426e Allow partial multibyte characters to accumulate in conversion state
objects passed to mbrtowc(), mbsrtowcs(), and mbrlen(), as required
by C99.
2004-04-07 10:48:19 +00:00
Tim J. Robbins
93996f6d58 Prepare to handle trivial state-dependent encodings. Full support for
state-dependent encodings with locking shifts will come later if there
is demand for it.
2004-04-07 09:55:05 +00:00
Tim J. Robbins
e97e856274 Begin conversions for sgetrune() and sputrune() in the initial
conversion state.
2004-04-07 09:49:10 +00:00
Tim J. Robbins
dc763237da Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-07 09:47:56 +00:00
Tim J. Robbins
ed870c6a8e Begin in the initial shift state in mbstowcs() and wcstombs().
(This change is non-functional since nothing uses states yet.)
2004-04-07 08:33:23 +00:00
Tim J. Robbins
74f90def09 Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-06 13:14:03 +00:00
Pierre Beyssac
54846c9ff0 Add a missing "*errp = h_errno" forgotten in rev 1.36. 2004-04-06 09:31:22 +00:00
Doug Rabson
0128d11082 Update .Dd value.
Reminded by: ru
2004-04-06 09:06:45 +00:00
Pierre Beyssac
e651d83aa3 Fix _dns_ghbyname() to return NS_TRYAGAIN instead of NS_NOTFOUND
on temporary nameserver failure. This is necessary to get
getipnodebyname(3) to correctly return h_errno=TRY_AGAIN instead
of HOST_NOT_FOUND.

Reviewed by:	green, thomas
MFC after:	1 week
2004-04-05 20:18:48 +00:00
Doug Rabson
8aca967c58 Document lgetfh(2). 2004-04-05 10:17:56 +00:00
Tim J. Robbins
4fb9e805dc Remove support for emulating mbrtowc() and wcrtomb() in terms of the
old rune interface now that it is no longer needed.
2004-04-04 11:31:29 +00:00
Tim J. Robbins
4f6d4aa30d Reimplement the GB18030 encoding method using the new-style (mbrtowc()/
wcrtomb()) interface.
2004-04-04 11:00:42 +00:00
Tim J. Robbins
54c61797df Reimplement the deprecated UTF2 encoding method using the UTF-8 code
as a base. mbrtowc() and wcrtomb() are now implemented directly
instead of being emulatedi with sgetrune() and sputrune().
2004-04-04 10:49:45 +00:00
Andrey A. Chernov
f853699a55 Simplify one condition in prev. commit:
short_too already assumes FLAG_LONGONLY
2004-04-01 22:32:28 +00:00
Andrey A. Chernov
ed4fbbd5e3 Fix parsing of ambiguous options, whole loop must be processed 2004-04-01 22:09:07 +00:00
Jacques Vidrine
8074e24dce The previous commit changed the behavior of nsdispatch() in the
case where an /etc/nsswitch.conf file was present, but could not
be opened (e.g. due to permissions).  Previously, the open failure
condition was suppressed, and the built-in defaults were used.  In
revision 1.11, however, propagated the open failure causing all
nsdispatch() invocations to return NS_UNAVAIL, and thus many APIs
including getpwnam and gethostbyname unconditionally failed.

This commit restores the previous behavior.

Pointy hat:	nectar  (+1 for obstinance; ache had to use clue bat)
Reported by:	ache
2004-04-01 19:12:45 +00:00
Peter Wemm
3726033348 Fix Yet Another 16 byte stack alignment bug. Thankfully, this one is
solved by a simple 'make world'.  The signalcontext function was going
to the trouble of generating an even 16 byte alignment, but in fact it
needed to be odd aligned to simulate the 8-byte return address having
been pushed by the caller.  This fixes yet another group of crashes in
applications using libpthread.  And yet again, it was my fault all along.

While here, rename the duplicate internal ctx_wrapper() functions to
makectx_wrapper() and sigctx_wrapper() so that traces aren't ambiguous.
2004-03-31 07:27:31 +00:00
Jacques Vidrine
a03fd3b656 When a dynamic NSS module is built and linked against a thread
library, it may pull in that thread library at run time.  If the
process started out single-threaded, this could cause attempts to
release locks that do not exist.  Guard against this possibility by
checking __isthreaded before invoking thread primitives.

A similar problem remains if the process is linked against one thread
library, but the NSS module is linked against another.  This can only
be avoided by careful design of the NSS module.

Submitted by:	Sean McNeil <sean@mcneil.com> (mostly; bugs are mine)
2004-03-30 15:56:15 +00:00
Tim J. Robbins
6de4bcc717 Add cross-references to isideogram(3), isphonogram(3), isrune(3),
isspecial(3) and wctype(3).
2004-03-30 08:11:57 +00:00
Tim J. Robbins
32d9553d83 Add basic manual pages for isideogram(), isphonogram(), isrune()
and isspecial().
2004-03-30 07:23:54 +00:00
Tim J. Robbins
bee1de57ca Trim cross-references. 2004-03-30 07:19:35 +00:00
Tim J. Robbins
ba6699086d Document the isnumber() and ishexnumber() functions, and explain how they
differ (at least in theory) from isdigit() and isxdigit().
2004-03-30 07:02:04 +00:00
Tim J. Robbins
ab02b93f75 Remove duplicate MLINK. 2004-03-29 21:46:52 +00:00
Tim J. Robbins
97062607cd Recognize the "rune" character class in wctype(). 2004-03-27 08:59:21 +00:00
Bruce M Simpson
3b367e998f Document the existence of NET_RT_IFMALIST.
Reviewed by:	ru
2004-03-25 10:08:46 +00:00
Ruslan Ermilov
f8a89f622e [troff] removed the unnecessary use of \_ escapes. 2004-03-25 09:25:24 +00:00
Brian Feldman
5295209eff Add locking so that arc4random(3) functions are all reentrant for
pthreads.

Submitted by:	Christian S.J. Peron <maneo@bsdpro.com>
2004-03-24 14:44:57 +00:00
Tim J. Robbins
8e6b7161d3 Document incorrect handling of multibyte characters. 2004-03-21 11:31:37 +00:00
Tim J. Robbins
6eb5892c2b Mention that funopen() uses fpos_t incorrectly in the BUGS section. 2004-03-20 08:41:12 +00:00
Tim J. Robbins
1e709c9cb5 Improve documentation for fgetpos() and fsetpos(), and discourage
users from assuming that fpos_t is an integral type.
2004-03-20 08:38:27 +00:00
Diomidis Spinellis
78a5f747c9 Shave-off troff cycles by invoking .Fa only once.
Submitted by:	ru
MFC after:	1 week
2004-03-19 16:04:11 +00:00
Tim J. Robbins
f639538c20 Do not redundantly set the stream orientation in getc(), putc(), and
related functions - __sgetc() and __sputc() will set it when necessary.
2004-03-19 09:04:56 +00:00