Commit Graph

6734 Commits

Author SHA1 Message Date
tjr
563cf1c356 Simplify by removing useless local variables and explicit null termination. 2002-09-26 09:23:07 +00:00
tjr
94f6f95809 Correctly handle the case where __vfwprintf() fails because it runs out
of memory.
2002-09-26 08:26:16 +00:00
tjr
87f0743efc Sync with OpenBSD: avoid memory leak when __vfprintf() fails because it
runs out of memory, always call va_end.
2002-09-26 07:55:18 +00:00
pst
d5c1216e90 Enhance TACACS+ library to fully support authorization requests in
addition to existing authentication.  No change to the existing
APIs to preseve both binary and API compatibility, so I am not
inclined to bump the library version number unless someone thinks
this is necessary.

Submitted by:	Paul Fraley <fraley@juniper.net>
MFC after:	2 weeks
2002-09-25 23:18:51 +00:00
knu
34bc7912e5 Update compat3x libc and libc_r from RELENG_3. This fixes the buffer
overflow in resolver described in FreeBSD-SA-02:28.resolv.

Binaries built and contributed by;	motoyuki
2002-09-25 19:47:54 +00:00
mike
a7d5cbede9 <sys/types.h> is no longer needed. 2002-09-25 16:49:09 +00:00
markm
90c3e48e7b Try not to lint(1) contrib'ed sources. This Is Very Messy. 2002-09-25 14:19:51 +00:00
maxim
5264badbc6 Disqualify UID/GID with non-numeric character.
PR:		bin/41721
Reviewed by:	tjr, silence on -audit
MFC after:	2 weeks
2002-09-25 08:49:19 +00:00
mike
c29fb91cfa Use the standardized CHAR_BIT constant instead of NBBY in userland. 2002-09-25 04:06:37 +00:00
ache
0ca1f74167 Set _POSIX2_VERSION=199209 before calling MKkey_defs.sh as workaround of
obsolete +POS sort syntax.
2002-09-24 19:55:37 +00:00
tjr
7529750b9c Warn when setinvalidrune() is referenced for consistency with the rest
of the rune functions (except sgetrune() and sputrune(), which are really
macros).
2002-09-24 09:25:37 +00:00
tjr
3068301c8b Add cross-references between wide character and single-byte character
versions of printf() and scanf().
2002-09-24 09:22:47 +00:00
tjr
96742ff1f2 Remove an unneeded call to _sfrefill() that was missed in the conversion
from vfscanf() to vfwscanf(). It doesn't hurt to have it there, but it's
redundant since __fgetwc() will refill the buffer if it needs to.
2002-09-24 09:18:32 +00:00
tjr
9109f97088 Use the new va_copy macro to copy variable argument lists instead of
assignment. This is needed on powerpc but is also more correct for the
other ports.

Submitted by:	grehan
Tested on:	alpha, i386, sparc64
2002-09-24 00:47:27 +00:00
tjr
a96fc812c3 Add implementations of wscanf() and related functions: fwscanf(), swscanf(),
vfwscanf(), vswscanf(), vwscanf(). As the name suggests, these are wide-
character versions of the scanf() family of functions.
2002-09-23 12:40:06 +00:00
tjr
ff870ef02c Implement the %lc, %ls and %[ conversions, which read sequences of wide
characters, non-whitespace wide character strings and wide character
strings in a scanset.
2002-09-23 11:35:50 +00:00
tjr
c027e65cdc The character argument for __ungetwc() should be wint_t instead of wchar_t. 2002-09-23 11:31:18 +00:00
tjr
441dd35939 Add the remaining C99 wide character string to integer conversion functions.
Restrict qualifiers were added to the existing prototypes in <inttypes.h>
and the typedef for wchar_t was removed.
2002-09-22 08:06:45 +00:00
tjr
f3945d0420 Add an unlocked version of ungetwc(), __ungetwc(), that __vfwscanf()
will need to use.
2002-09-22 05:59:00 +00:00
mini
78c2c1b0cd Style cleanup:
- Sort local variable declarations.
- Protect a hand-formatted comment from indent(1).
- Use portable casts, even though this is machine-dependant code.
- Remove extraneous blank lines.
- Remove trailing newline.
- Use sigdelset(3), not SIGDELSET(9).

Requested by:	bde
2002-09-21 23:54:32 +00:00
tjr
b8b976af9f Delete stray reference to vsnprintf(). 2002-09-21 14:25:58 +00:00
tjr
a399903ed4 Add implementations of the wprintf() family of functions, which perform
formatted wide-character output.
2002-09-21 13:00:30 +00:00
wollman
6f001fdc5c Initiate deorbit burn sequence for sysctl CTL_USER MIB branch.
Use the correct constants directly from sysconf() rather than calling
sysctl() to tell us the (still compiled-in) value.  Leave the CTL_POSIX1B
stuff alone for now (but I'd like to see this replaced with a single
structure returning all of the relevant information).

Implement all of the keys from 1003.1-2001 that we can.  Ensure that
the build will break if someone redefines an option constant to zero
without implementing the necessary presence-detection logic here.

(4 of 5)
2002-09-21 02:14:04 +00:00
wollman
d8d5a39838 Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI.  FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about.  As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use.  All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch
2002-09-21 01:28:41 +00:00
tjr
81bb1a4c45 Remove unnecessary #include <assert.h>; it was used to bring in the
_DIAGASSERT macro on NetBSD, but we don't need it.
2002-09-21 00:29:23 +00:00
markm
e2e7a56c5a Remove a prototype for a function that is no longer called. 2002-09-20 22:23:32 +00:00
alfred
b674d88a4e Fix an infinite loop when _fetch_read() can return 0 (if the
connection is broken), take this into account and return at this
point.
2002-09-20 21:50:57 +00:00
archie
7dc4652022 Revert previous commit to unbreak world until we figure out the
right way to do it.
2002-09-20 15:43:26 +00:00
tjr
4a91d13170 Lock the file once per call and use the unlocked fgetwc()/fputwc() variants. 2002-09-20 13:25:40 +00:00
tjr
fd97692951 Lock and unlock the file once per call and use the unlocked version of
ungetc() instead of having ungetc() recurse on the lock.
2002-09-20 13:23:26 +00:00
tjr
da75bd41a4 Introduce unlocked versions of fputwc() and fgetwc() called __fputwc()
and __fgetwc() which can be used when we know the file is locked.
2002-09-20 13:20:41 +00:00
mike
f4a51ad4cf Add restrict type-qualifier. 2002-09-20 08:24:01 +00:00
mini
2348815a32 Don't peek into MD structures from MI code. The getcontext(3) and
setcontext(3) functions check the validify of the mcontext_t structs.
2002-09-20 08:13:21 +00:00
imp
60d11016c5 Expose the new kernel data structures to libdevinfo:
o Added dd_pnpinfo, dd_location, dd_devflags, dd_flags and dd_state
	o Copy/initialize these as necessary.
	o Document the changes to the interface in devinfo.3.
2002-09-20 02:16:33 +00:00
archie
0bd9b35ef7 Fix a problem with the definition of HUGE_VAL causing the gcc warning
"cast increases required alignment of target type" on some platforms.

Reviewed by:	bde
2002-09-19 19:47:27 +00:00
tjr
a2252e5e0d Implement the %ls and %lc conversions for printing wide character strings
and wide characters. These were already documented in the manual page,
with an entry mentioning that they were not implemented yet. The XSI
%S and %C synoyms have not been added.
2002-09-19 12:50:28 +00:00
nectar
2e8027484f Add forgotten newlines in debug messages. 2002-09-19 11:36:47 +00:00
julian
d9595add00 reconnect libc_r
Hint from: deischen@freebsd.org
2002-09-19 08:06:23 +00:00
julian
8a10047dc5 Part of a bandaid to get libc_r on air again.
Submitted by: Dan Eischen (deischen@freebsd.org)
Pointy hat for breakage just before going offline: Mini@freebsd.org
2002-09-19 07:35:39 +00:00
wollman
13f4d3af1b Return the correct environment name for 64-bit platforms in the
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS case.
2002-09-19 03:47:36 +00:00
alfred
c0fa81b669 Welcome the sem_ API to libc! 2002-09-19 01:14:08 +00:00
alfred
0e6988fa9d add a stub for pthread_cond_destroy. 2002-09-19 01:09:49 +00:00
mux
cf8b0bc58a Add a missing file into the CLEANFILES variable.
Approved by:	peter
2002-09-18 21:16:17 +00:00
tjr
e84cd185bc Optimise the common case where no special encoding is in use (LC_CTYPE is "C"
or "POSIX", other European locales). Use __sgetc() and __sputc() where
possible to avoid a wasteful lock and unlock for each byte and to avoid
function call overhead.
2002-09-18 12:17:28 +00:00
tjr
7d203a48a9 Logic error in previous: don't exit the loop when an incomplete multibyte
sequence is detected.
2002-09-18 10:21:41 +00:00
tjr
64901d66d0 Deprecate the rest of the rune interface. 2002-09-18 06:19:12 +00:00
tjr
0ef3b79f68 Mark mbmb(), mbrune(), and mbrrune() as deprecated functions. We want to
get applications to move to the ISO C interfaces as well as have the
freedom to replace the rune interfaces with ones that support stateful
conversions some time in the future.
2002-09-18 06:11:21 +00:00
tjr
1324a4b719 Reimplement the functionality of fgetrune(), fputrune(), and fungetrune()
here in terms of mbrtowc(), wcrtomb(), and the single-byte I/O functions.
The rune I/O functions are about to become deprecated in favour of the
ones provided by ISO C90 Amd. 1 and C99.
2002-09-18 05:58:11 +00:00
bde
048b1b07a4 Fixed editing error in previous commit (*blush*). 2002-09-17 19:43:53 +00:00
bde
e825e2bdcb Fixed unsorting of SRCS. 2002-09-17 14:33:23 +00:00
maxim
9659f9cdad Fix vsnprintf(3) memory leak for size == 0.
PR:             bin/36175
Obtained from:  OpenBSD
Reviewed by:    silence on -audit
MFC after:      5 days
2002-09-17 11:28:24 +00:00
peter
0800c0e6ed Add i386 to the list of architectures that libc_r is broken on. This
effectively removes pppctl from the build for now.  It only compiles on
alpha now (now ironic).
2002-09-17 07:32:36 +00:00
peter
7dca8da865 Bandaid to stop failing on non-i386 platforms.
Add a big ugly #warning as a reminder.
2002-09-17 06:22:51 +00:00
fenner
8c3e434ca5 Make _fetch_connect() always set the error code.
Tell ftp that _fetch_connect() always sets the error code (http already knew)
2002-09-17 05:54:33 +00:00
mini
b9d3a42354 Use a weak symbol for signalcontext(). 2002-09-17 03:15:47 +00:00
mini
8a0c5b9c4d Add signalcontext(), which adds a signal frame to a ucontext_t. 2002-09-17 03:11:07 +00:00
peter
3c7c11fd3e Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
fenner
41b288a34e Fix documentation of clnt_control()'s CL{GET|SET}_{VERS|XID} to
reflect that they actually require a u_int32_t *, which is not
 necessarily the same as an unsigned long *.
2002-09-16 21:45:37 +00:00
mini
c6b4c83268 Make libpthread KSE aware.
Reviewed by:	deischen, julian
Approved by:	-arch
2002-09-16 19:52:52 +00:00
mini
141ea5ab5c Mechanically change all libc_r references to libpthread. 2002-09-16 19:29:34 +00:00
mini
0c766a9c9b Save and restore FPU state properly in ucontext_t's.
Reviewed by:	deischen, julian
Approved by:	-arch
2002-09-16 19:24:31 +00:00
mini
37c24d8bc5 Add signalcontext(), which lays down a signal frame onto a ucontext_t.
Reviewed by:	deischen, julian
Approved by:	-arch
2002-09-16 19:23:35 +00:00
ume
0fcfd697ed Allocate 64K recieve buffer for DNS responses. 2002-09-16 13:19:47 +00:00
tjr
a593f35cc7 Convert eight space indents to tabs in the "*" format handling code. 2002-09-16 12:07:13 +00:00
mini
fc6481bdd1 Make the changes needed for libpthread to compile in its new home.
The new libpthread will provide POSIX threading support using KSE.
These files were previously repo-copied from src/lib/libc_r.

Reviewed by:	deischen
Approved by:	-arch
2002-09-16 08:45:36 +00:00
bde
378aa4c356 Fixed messes involving $FreeBSD$ starting with one left in the copyright
after adding __FBSDID().

Garbage-collected kvm_readswap().  This was once used by kvm_uread(), but
kvm_uread() now just reads /proc/<pid>/mem and procfs hopefully handles
swapped out pages.
2002-09-16 08:22:57 +00:00
mike
a4fce7bac9 Don't depend on <sys/types.h> pollution in <fcntl.h>. 2002-09-16 07:18:27 +00:00
julian
b32c592b15 Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.
next step is to allow > 1 to be allocated per process. This would give
multi-processor threads. (when the rest of the infrastructure is
in place)

While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc
are diverging more than they should.. corrective action needed soon.
2002-09-15 23:52:25 +00:00
ume
029fdf3440 Allocate 64K recieve buffer for DNS responses.
KAME did the modification only to _dns_getaddrinfo().  However,
it is not sufficient, and res_queryN() should be modified, too.
So, I did same modification to res_queryN().

Obtained from:	KAME
2002-09-15 20:36:38 +00:00
nectar
ddc260dae6 Check for truncation in calls to res_send/res_query/res_search.
Fail when it is detected.
2002-09-15 16:51:09 +00:00
tjr
238ea7422c Add wcstod() as a wrapper around strtod(). It does not handle any characters
that strtod() does not (alternate digit characters, etc. are not handled).
2002-09-15 08:38:51 +00:00
tjr
489b832ffc Use the heap instead of the stack to store temporary multibyte string
buffers; this is slower but safer for threaded programs where threads
often have relatively low stack size limits.
2002-09-15 08:06:17 +00:00
nectar
a1dc11dea2 Backout the increase of MAXPACKET from 1024 to 65536: it
broke pthreads.

Reported by:	mbr, tjr
2002-09-15 04:23:20 +00:00
tmm
3c56a83b9c Use the macros from machine/fsr.h; some minor cleanups. 2002-09-14 18:07:03 +00:00
tmm
4d4159680a Add implementations of fpgetmask(), fpgetround(), fpgetsticky(),
fpsetround(), fpsetsticky(), obtained from NetBSD and tweaked a little
to use definitions from machine/fsr.h instead of magic numbers.
2002-09-14 18:06:21 +00:00
ume
5e6cb71dd6 Limit UDP payload size for EDNS0 to 0xffff, not use lower 16bit value.
Obtained from:	KAME
2002-09-14 17:28:40 +00:00
nectar
15073701b7 When using res_send/res_query/res_search, the caller must either
insure enough space is available for the response, or be prepared
to resize the buffer and retry as necessary.

Do the conservative thing and make sure enough space is available.

Reviewed by:	silence on freebsd-audit
2002-09-13 20:31:29 +00:00
tmm
1d61cc9f45 Add an implementation of fabs() (which is quite trivial).
When it is called directly, gcc is smart enough to generate inline
code for it, which is why it wasn't noticed before that it was missing.

fabs() would probably better fit into libm, but it has traditionally been
in libc on FreeBSD, so there is probably software around that makes
assumptions about this by now.
2002-09-13 16:01:26 +00:00
tjr
81712cef3b Correct type of second argument: it is wchar_t ** restrict,
not wchar_t * restrict.
2002-09-12 09:25:27 +00:00
archie
a087920594 Update to reflect reality.
Reviewed by:	mini
MFC after:	3 days
2002-09-11 21:40:02 +00:00
archie
3ea75fba30 Add man pages for getcontext()/setcontext(), makecontext()/swapcontext(),
and ucontext_t.

Reviewed by:	mini
MFC after:	3 days
2002-09-11 21:39:21 +00:00
nectar
e0a6134ca8 In kvm_openfiles/kvm_open, mark the file descriptors as close-on-exec.
Applications can not do this themselves, as the descriptors are hidden
behind the opaque `kvm_t' type.
2002-09-11 16:41:39 +00:00
tjr
a371cd3f71 Add an implementation of wcsftime() (wide character version of strftime()). 2002-09-11 08:57:11 +00:00
julian
c69b2fd9b6 Completely redo thread states.
Reviewed by:	davidxu@freebsd.org
2002-09-11 08:13:56 +00:00
mike
9d84bef421 Add `restrict' type-qualifier. 2002-09-11 05:05:48 +00:00
archie
27e91afec6 Adjust to reflect reality, which is that sigaltstack() takes stack_t *'s.
MFC after:	3 days
2002-09-10 21:06:51 +00:00
wollman
7718a8bb20 Implement C99's _Exit() interface.
Implement a version of qsort that provides a thunk to the comparison function.

Update manual pages.
2002-09-10 02:04:49 +00:00
phk
e1c7d43764 Get this file closer to style(9). 2002-09-08 15:10:04 +00:00
tjr
6d330c09f5 Add wcstol() and wcstoul(), based on strtol() and strtoul(). 2002-09-08 13:27:26 +00:00
tjr
5179353c30 Replace a stray reference to strtok() with one to wcstok(). 2002-09-08 11:09:24 +00:00
wollman
76975bbc9a Fix a syntax error which causes an annoying warning. 2002-09-08 04:43:28 +00:00
tjr
1da5db1bd1 Add an implementation of wcstok(), based on strtok_r(). 2002-09-07 08:16:57 +00:00
jmallett
aebf39686f Two arrays were born from the same seeds, both grew into complementary sets
of pointers to strings.  These two arrays were fixed to the same size, but one
had an implicit zeroed trailer element, which was unused because the size was
used up by the ones before said zeroed trailer element.  So the unused limb was
chopped off the over-sized-but-not-over-sized array, and everyone lived happily
ever after.
2002-09-07 08:14:19 +00:00
tjr
6f34dcc27c Sync prototypes with <wchar.h> with respect to the restrict qualifier. 2002-09-07 04:07:00 +00:00
tjr
303f557e0b Add restrict qualifiers where C99 permits them. All of these already had
restrict qualifiers on their prototypes in <wchar.h>.
2002-09-07 04:03:28 +00:00
tjr
7d56c0ce2f Call strtok_r() via a libc private name from within strtok(). 2002-09-07 02:53:19 +00:00
bmah
c397827503 Fix a bug where calling MD5File(3) with a zero-length file generated an
error, due to an uninitialized variable.

Reviewed by:	phk, archie
2002-09-06 19:51:58 +00:00
wollman
276fb14a03 Include some verbage about not calling exit() from functions registered
by atexit().
2002-09-06 19:23:28 +00:00
tjr
e841a730a7 Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
jake
a0c5b8f1fc Don't need to install the signal trampoline here anymore. 2002-09-03 14:59:41 +00:00
jake
dec81f9b64 Install the userland signal trampoline when sigaction is first called,
instead of on startup.  This fixes binary compatibility of dynamically
linked binaries from before the signal code move.

Suggested by:	wollman (a long time ago)
2002-09-03 14:55:29 +00:00
peter
9df0fa4929 Fix a nasty bug exposed by mktime() when time_t is significantly bigger
than 32 bits.  It was trying to figure out things like the day of week
of when time_t is roughly 2^62 etc.  Make a better guess for the starting
point for the binary search that works on both 32 and 64 bit types.  I have
been using this for a while now.
2002-09-03 04:34:10 +00:00
tjr
7a748ab47c Set errno to EILSEQ when invalid multibyte sequences are detected
(XSI extension to 1003.1-2001).
2002-09-03 01:09:47 +00:00
jake
0253410110 Use FOO(a) for macros with variadic args, instead of FOO(a,) or FOO(a, ).
Submitted by:	gcc3.2
2002-09-02 02:30:20 +00:00
robert
a43eb2ad85 - Let their manual pages show the reader that the bzero(3) and
bcopy(3) functions are prototyped in <strings.h> and not in
   <string.h> anymore.
 - Add a sentence about that to the respective HISTORY sections.
In the C source files:
 - Include <string.h> or <strings.h> depending on what function
   is to be compiled.
 - Use ANSI-C function definitions.
2002-09-01 21:53:46 +00:00
tjr
c55d6854b6 Typo: refer to MB_LEN_MAX instead of MB_CHAR_MAX (which does not exist). 2002-09-01 07:21:58 +00:00
tjr
a54a864f42 Add restrict qualifiers to the arguments of mbstowcs, mbtowc() and
wcstombs().
2002-09-01 07:08:22 +00:00
mike
04fb40bfb4 Fix a memory leak. 2002-09-01 01:49:27 +00:00
tjr
a3aa75b5fb Implement the XSI extension which allows the destination string to be
NULL, and returns the number of bytes that would be required to store
the result of the conversion without storing anything.

PR:		17694
2002-08-31 14:16:12 +00:00
tjr
11f99a178c Split ansi.c into a separate source file for each function. 2002-08-31 11:26:55 +00:00
ache
8503d48e24 Use ntohl() to read cnains number in new format 2002-08-31 01:05:39 +00:00
robert
1f380cc81f Add the 'restrict' type qualifier to the function prototype
of the swab(3) function in its manual page to match the
standardization by POSIX.1-2001.
2002-08-30 21:18:39 +00:00
robert
0ff67278c4 - Update the manual page of bcmp(3) by replacing
.In string.h
   with
     .In strings.h
   and adding a sentence to the HISTORY section.
 - Use an ANSI-C function definition.
 - Include <strings.h> instead of <string.h>.
 - Apply style(9): Put a space after return keywords.
2002-08-30 21:07:40 +00:00
ache
7a03045e51 Style fix 2002-08-30 20:39:53 +00:00
robert
6d3066d735 - Convert the function definition to declare its arguments
in the ANSI-C format.
 - Change the code a bit to hopefully save some cycles.
   I.e. (simplified) change

     a = b + 1;
     while (--b & 0x7)
	/* ... */
   to
     a = b;
     for (; b & 0x7; b--)
	/* ... */
   and
     while (--a >= 0)
	/* ... */
   to
     for (; a > 0; a--)
	/* ... */
 - Equip two function arguments of swab() with the 'restrict'
   type qualifier in form of the '__restrict' macro.  This is
   specified by POSIX.1-2001.
2002-08-30 20:33:05 +00:00
ache
3d3ee1e603 Prepare for switching to unlimited chains format.
Optimize chains lookup a bit.
2002-08-30 20:26:02 +00:00
robert
92885860c0 - Update the manual pages of index() and rindex() to show
<strings.h> as the associated header file.
   The prototypes have been moved there from <string.h> because
   POSIX.1-2001 said so.
 - Conditionally include either <strings.h> or <string.h> based
   on whether the [r]index() or str[r]chr() functions are
   compiled, respectively.
 - Style(9) tells us to
    - put a space after the return keyword
    - to check for a NUL character without using the ! operator.
    - use NULL instead of (type *)NULL where the compiler knows
      the type.
   Apply these rules.
 - Rather use ANSI-C function definitions than K&R ones.
 - For index(3), correct second function argument's type; it was
   declared to be a `const char' before and is now an `int'.
2002-08-30 19:42:07 +00:00
robert
3abb363715 - Update the manual page to show that the associated header file
is <strings.h> and not <string.h> anymore.
 - Tell the reader about this change in the HISTORY section.
 - Switch to use an ANSI-C function definition.
 - Include <strings.h> instead of <string.h> in the source file.
2002-08-30 19:08:53 +00:00
robert
2155343757 - Update strcasecmp(3)/strncasecmp(3) to reflect the fact that
the prototypes for both functions are now in the <strings.h>
   header, as required by IEEE Std 1003.1-2001.
 - Add one sentence about that in the HISTORY section.
 - Include <strings.h> in the source file to have the prototypes
   in scope when the _ANSI_SOURCE macro is defined.
2002-08-30 15:40:01 +00:00
peter
c36bb537a2 Hopefully unbreak world. ke_slptime is gone. It should really have been
looking at p_ksegrp.kg_slptime anyway.
2002-08-30 02:18:38 +00:00
deischen
f33bb8954f Remove much of the dereferencing of the fd table entries to look
at file flags and replace it with functions that will avoid null
pointer checks.

MFC to be done by archie ;-)

PR:		42100
Reviewed by:	archie, robert
MFC after:	3 days
2002-08-29 23:06:07 +00:00
archie
e9e37212c4 Make the libc_r version of select() set the readable or writable
file descriptor bit if poll() returns POLLERR, POLLHUP, or POLLNVAL.
Othewise, it's possible for select() to return successfully but
with no bits set.

Reviewed by:	deischen
MFC after:	3 days
PR:		bin/42175
2002-08-29 21:39:19 +00:00
archie
256320cb58 When poll(2)'ing for readability or writability of a file descriptor
on behalf of a thread, we should check the POLLERR, POLLHUP, and
POLLNVAL flags as well to wake up the thread in these cases.

Suggested by:	deischen
MFC after:	3 days
2002-08-29 00:44:11 +00:00
alfred
3e1f49aecc Allow one to grab the definition of struct ucred by defining _WANT_UCRED
instead of forcing _KERNEL.

Move the include of sys/_label.h in ucred.h under the
_KERNEL || _WANT_UCRED case.
2002-08-28 20:39:48 +00:00
schweikh
8da007c6be Print a '-' sign for negative zero. Tested with
#include <stdio.h>
	int main(void)
	{
		printf("%+f\n", -0.0);
		printf("%+f\n", +0.0);
		printf("%+f\n",  0.0);
		return 0;
	}

to output
-0.000000
+0.000000
+0.000000

PR:		bin/41823
Submitted by:	GOTO Kentaro <gotoken@notwork.org>
Liked by:	bde
MFC after:	3 weeks
2002-08-27 20:11:08 +00:00
charnier
06afb62b3c Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:10:45 +00:00
jdp
f98a36d07d Fix a bug in __ivaliduser_sa() which caused some rsh/rlogin attempts
to fail needlessly if a reverse DNS lookup of the IP address didn't
come up with a hostname.  As a comment in the code clearly stated,
the "damn hostname" was looked up only for the purpose of netgroup
matching.  But if that lookup failed, the function bailed out
immediately even though in many cases netgroup matching would not
be used.

This change marks the hostname as unknown but continues.  Where
netgroup matching is performed, an unknown hostname is handled
conservatively.  I.e., for "+@netgroup" (accept) entries an unknown
hostname never matches, and for "-@netgroup" (reject) entries an
unknown hostname always matches.

In the lines affected (only), I also fixed a few bogus casts.  There
are others, and in fact this entire file would be a good candidate
for a cleanup sweep.

Reviewed by:	imp (wearing his flourescent yellow Security Team cap)
MFC after:	2 days
2002-08-24 17:37:42 +00:00
kris
7c3a0284bf &x is not a format string 2002-08-24 07:15:55 +00:00
mike
bd085edd0d Note that <sys/types.h> in no longer a prerequisite for <utime.h> and
<sys/mman.h>.
2002-08-24 00:39:43 +00:00
marcel
004dfe76c0 We cannot use an alloc with only inputs and/or locals. The kernel
assumes that the parameters are passed in output registers. Remove
the alloc entirely, but don't depend on the kernel not trashing
our registers.
2002-08-23 03:47:50 +00:00
jmallett
ceb7453fb1 Wrap the header to prevent multiple inclusion, and mark the DECLS section.
Reminded by:	Rachel Hestilow <hestilow@ximian.com>
2002-08-22 23:35:35 +00:00
pirzyk
8bd034327b Fixed getaddrinfo to honor sortlist in /etc/resolv.conf
PR:		bin/27939
Reviewed by:	ru, sheldonh (about a year ago)
Obtained from:	ume (via KAME, I think)
MFC after:	1 month
2002-08-21 19:57:53 +00:00
phk
4b59b6bb73 s/EDOFUS/EDOOFUS/
Persuaded by:	Google
2002-08-21 17:11:00 +00:00
mike
5d0fbddc4d o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
scottl
f73fe2349f Fix a typo in #if 0 code 2002-08-21 09:30:45 +00:00
tjr
0205a0ffee Add a manual page for wcwidth(). 2002-08-20 03:42:21 +00:00
tjr
6d3cb7bb91 Add a manual page for wcswidth(). 2002-08-20 03:40:45 +00:00
ache
3407d2c811 Move just committed version of wcswidth.c here (from "locale"),
a bit optimized now.
2002-08-20 02:06:28 +00:00
ache
ba87b2c9c7 Remove wcswidth.c from here (and move it to "string") 2002-08-20 01:59:26 +00:00
ache
1419258201 Remove space at the end of continuation line in prev. commit 2002-08-20 01:16:06 +00:00
bde
40d1e3da5b xdr.3 is added to MAN in ../xdr/Makefile.inc where it belongs, so don't
add it here.
2002-08-19 23:06:00 +00:00
ache
76428962f3 Implement wcswidth() 2002-08-19 20:46:10 +00:00
ache
a7d6d1784b Use modern-style arguments declaration 2002-08-19 20:32:27 +00:00
ache
7eeba77736 Write null wide-character as L'\0' like in other places 2002-08-19 20:12:38 +00:00
ache
57b58c92d3 According to SUSv2, always return 0 for null wide-character code 2002-08-19 18:06:18 +00:00
jmallett
23770870e0 s/trailing NULL/trailing NUL/ 2002-08-19 17:14:58 +00:00
ache
78e59f599d Move internal defines from ctype.h here 2002-08-19 09:02:49 +00:00
jmallett
07d5a64349 Leave room for a trailing NUL not a NULL, that's not an ASCII character. 2002-08-19 03:52:36 +00:00
tjr
a4e0bb4130 Implement the ISO C90 Amd.1 restartable wide and multibyte character
manipulation functions mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(),
wcrtomb(), wcsrtombs().
2002-08-18 06:30:10 +00:00
ache
4a1a05f8fe Move wcwidth() to separate file, it doesn't belong to iswctype.c at all 2002-08-17 20:30:34 +00:00
ache
3083ba69da According to SUSv2, wcwidth() should return -1 for non-printing characters 2002-08-17 20:11:31 +00:00
ache
513ad1189a Cosmetic - remove unneded brackets and #undef 2002-08-17 20:03:44 +00:00
ache
c7e9ed7c15 wcwidth: fix espression to work correctly with SWIDTH0 2002-08-17 14:16:14 +00:00
bmilekic
9ba26ec3bd Fix libc build breakage by defining FSTYPENAMES before including
disklabel.h; broken originally by 1.87 of sys/disklabel.h, which
made the split between DKTYPENAMES and FSTYPENAMES.
Someone who knows disklabel.c: do we still need DKTYPENAMES to be
defined here now?
2002-08-16 15:33:20 +00:00
keichii
7a4eacff03 Add iswctype wcwidth function code
Submitted by:	clkao@clkao.org
Reviewed by:	keichii
Obtained from:	NetBSD
MFC after:	1 month
2002-08-16 13:45:23 +00:00
alfred
f48beb61ce Hide 'struct ucred' behind '#ifdef _KERNEL', this should stop userland
from attempting to use it for good.  There is a catch, kvm_proc.c needs
to '#define _KERNEL' to get at the ucred.

Requested by: rwatson
2002-08-16 07:01:43 +00:00
rwatson
779e9c05c5 Add LOGIN_SETMAC, which will indicate to the user context management code
that it should also set the user's default MAC label, if available and
permitted.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-16 02:14:21 +00:00
robert
a834279e5a - Fix a bug that wrote one char behind the end of the
supplied buffer in case the size of it was equal to
   the number of characters the converted address consumed.
   The bug occurred when converting an AF_INET address.
 - Remove the SPRINTF macro and use sprintf instead.
 - Do not do string formatting using sprintf(3) and a
   temporary buffer which is copied when the supplied
   buffer provides enough space.  Instead, use snprintf(3)
   and the real destination buffer, thus avoid the copy.

Reported by:	Stefan Farfeleder <e0026813@stud3.tuwien.ac.at> (1)
PR:		misc/41289
2002-08-15 21:19:31 +00:00
robert
a58570f7e4 Put each function argument on its own line to keep lines shorter
than 80 columns.
2002-08-15 20:33:44 +00:00
robert
2877957282 Use one line for each function argument to keep the line
width smaller than 80 columns.

Thanks to Ruslan for an explanation of multiple ways to
achieve this.
2002-08-15 18:57:57 +00:00
bde
71afe3acf3 Removed duplicated MLINKS which make(1) recently started warning about. 2002-08-15 12:31:01 +00:00
robert
76358c6b3c Include <stdlib.h> to have abort() and exit() declared. 2002-08-15 11:58:24 +00:00
robert
0ed84d70ad - For compliance with IEEE Std 1003.1-2001, add the 'restrict'
qualifier to function prototypes and definitions where
   appropriate using the '__restrict' macro.
 - Update the manual page.
2002-08-15 10:28:52 +00:00
robert
b0383fce7a - Introduce the 'restrict' qualifier to function prototypes and
definitions to comply with IEEE Std 1003.1-2001.
 - Update the manual pages.
2002-08-15 09:47:10 +00:00
robert
4b216b48b0 - Add the 'restrict' qualifier to the function prototypes and
definitions of the functions that convert strings to numbers
   and are defined by IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions for all of the functions
   mentioned above plus strtouq and strtoq.
 - Update the prototypes in the manual pages.
2002-08-15 09:25:04 +00:00
robert
d844847716 - Add the 'restrict' qualifier to the function definitions and
public prototypes of setbuf(3) and setvbuf(3) using the
   '__restrict' macro from <sys/cdefs.h> to be compliant with
   IEEE Std 1003.1-2001.
 - Replace the K&R with ANSI-C function definitions.
 - Bring the manual page up-to-date.
2002-08-14 23:45:42 +00:00
robert
3a77f79d44 - Add the 'restrict' qualifier to the function definition of
strftime(3) for IEEE Std 1003.1-2001 compliance and remove
   excessive usage of the 'const' qualifier that was neither
   present in the prototype in the publice header, nor in the
   local prototype just above the function definition.
 - Replace the K&R function definition with a ANSI-C one.
 - Update the prototype of strftime(3) in its manual page.
2002-08-14 23:20:48 +00:00
robert
3294a7fc5a - Add the 'restrict' qualifier to the definitions of the string
concatenation and copy functions using the '__restrict' macro.
   This is to satisfy IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions.
 - Add the 'restrict' keyword to the manual pages, too.
2002-08-14 22:59:22 +00:00
robert
78711cadb9 - Add the C99 'restrict' qualifier using the '__restrict' macro to
function prototype and definition of strptime(3).
 - Update the manual page.
2002-08-14 22:36:22 +00:00
rwatson
af32c4898e Use "ugidfw.h" rather than <ugidfw.h> so that mkdep can find it.
Suggested by:	mike
2002-08-14 22:30:07 +00:00
robert
f1b53f4d95 - Add the 'restrict' qualifier to match the IEEE Std 1003.1-2001
prototype of the tdelete(3) function.
 - Remove duplicated space.
 - Use an ANSI-C function definition for tdelete(3).
 - Update the manual page.
2002-08-14 21:16:41 +00:00
robert
b9e5cc5c73 - Add the 'restrict' qualifier required by IEEE Std 1003.1-2001
to the function definition of strxfrm(3) in form of our
   '__restrict' macro.
 - Use an ANSI-C function definition for strxfrm(3).
 - Change the manual page accordingly.
2002-08-14 21:01:04 +00:00
robert
3a82d49c05 -Add the restrict required by IEEE Std 1003.1-2001 in form
of our __restrict macro to the prototypes and function
   definitions of inet_pton and inet_ntop.
 - Use ANSI-C function argument lists.
 - Adjust the prototypes in the manual page.
2002-08-14 20:40:35 +00:00
phk
215b234fbc Unbreak one of the most confusing breaks of the tree I've seen.
The last commit cannot possibly have been tested.
2002-08-13 18:55:51 +00:00
ache
6d4f2c4daa Reduce BSS size for programs which not load collate by eliminating
static buffer.
2002-08-13 14:55:17 +00:00
dwmalone
e3390526f7 Use a union to access the words of a double as this is less likely
to cause bugs when gcc is more aggressively optimising things.

There are still problems with dtoa mentioned in the PR - maybe
Dan could suggest a patch.

PR:		40209
Submitted by:	Dan Lukes <dan@obluda.cz>
Approved by:	bde
MFC after:	2 weeks
2002-08-13 14:17:39 +00:00
ru
8f6c4c0f03 can not -> cannot. 2002-08-13 14:10:36 +00:00
tjr
158ac2b528 Tidy up SRCS and MAN assignments. 2002-08-13 11:56:02 +00:00
tjr
ca49b6fa09 Remove the Bugs section, which is not relevant to FreeBSD: there is no
one-character ungetwc(3) buffer limit.
2002-08-13 10:50:22 +00:00
tjr
c18b51c83e FreeBSD-ify: use In macro for header files in Synopsis, St C-99 instead of
St C99 in Standards section.
2002-08-13 10:47:17 +00:00
tjr
1b489ba271 Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),
putwc(), fputwc(), putwchar(), ungetwc(), fwide().
2002-08-13 09:30:41 +00:00
ru
1412019b69 Handle the escaped colon \: in a capability.
PR:		bin/30778
Reviewed by:	ache, peter
MFC after:	3 days
2002-08-12 19:13:22 +00:00
ache
9001814d5d Now malloc() is fixed, remove errno hardcoding to ENOMEM 2002-08-12 17:14:04 +00:00
tjr
186bb525c6 Manual pages for fwide(), getwc(), fgetwc(), getwchar(), putwc(), fputwc(),
putwchar(), ungetwc() from NetBSD and Citrus Project, unmodified except
for the addition of $FreeBSD$.

Obtained from:	NetBSD, Citrus Project
2002-08-12 13:23:12 +00:00
ache
73d79074ac Now, malloc is fixed, remove ENOMEM hardcode 2002-08-12 11:47:19 +00:00
dwmalone
f3f5da8d87 Add a missing copyright for Doug. There are other files missing this
copyright in -stable.

PR:		41397
Submitted by:	dfr
2002-08-11 19:31:02 +00:00
jmallett
0359a25e71 Initialise disk->d_ufs so that in sblock.c it's always initialised
(unless someone tries to use libufs support functions without using
	_fillout or _ctor to construct a uufsd.)

Obtained from:	jmallett_libufs Perforce branch.
2002-08-11 15:37:10 +00:00
schweikh
7f17c396f7 Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
rwatson
387b7755d3 Whitespace cleanup--it's not style(9), but it is consistent. Prep
for MAC-related commits to the login infrastructure.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-11 01:48:43 +00:00
jake
66238fd082 Auto size available kernel virtual address space based on phsyical memory
size.  This avoids blowing out kva in kmeminit() on large memory machines
(4 gigs or more).

Reviewed by:	tmm
2002-08-10 22:14:16 +00:00
mux
079fc3b148 - Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
  kernel, and rewrite getvfsbyname() to use this instead of the weird
  existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
  sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
  vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
  an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility.  Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.
2002-08-10 20:19:04 +00:00
phk
22111d7178 Update with new error return code.
Reminded by:	rwatson
2002-08-09 13:22:21 +00:00
ru
1eb1582ee7 mdoc(7) police: spelling. 2002-08-09 12:08:47 +00:00
ru
2d26a73daf mdoc(7) police: tidy up the formatting. 2002-08-09 12:07:17 +00:00
ru
054dc890a2 mdoc(7) police: punctuation. 2002-08-09 11:36:48 +00:00
ru
c01a69ddeb mdoc(7) police: sort xrefs. 2002-08-09 11:33:23 +00:00
ru
c3f12a4818 mdoc(7) police: punctuation. 2002-08-09 11:24:21 +00:00
ru
869e635bad mdoc(7) police: whitespace nits. 2002-08-09 11:17:56 +00:00
ru
9e9b1b85ae mdoc(7) police: laundry. 2002-08-09 11:15:49 +00:00
ru
0cacae3055 mdoc(7) police: laundry. 2002-08-09 11:06:03 +00:00
phk
e1f27f13db Make sure we set errno sensibly in case of failure.
Spotted by:	ache
2002-08-09 10:16:24 +00:00
phk
523fe00262 Introduce a new error return code:
#define EDOFUS          88              /* Programming error */
This can be used to signal error situations which indicate that the
program logic or assumptions is deficient.
2002-08-09 10:15:48 +00:00
ache
0702e07843 Add safeguards to never use errno == 0 as setrunelocale() error return code 2002-08-09 08:22:29 +00:00
rwatson
9cc94e456c Update TE policy and MAC text conversion routines to support partial
label updates.  Biba and MLS already supported this.  This permits the
userland library to submit relative updates on MAC labels, rather
than submitting an entire label to replace the current label.  This
also requires changes to the MAC modules, which are forthcoming.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-09 03:09:38 +00:00
rwatson
c65adec684 X-ref mac.3. 2002-08-09 03:03:08 +00:00
kan
4a9710a06d Use '_end' symbol instead of 'end' to initialize minbrk and curbrk
variables. Both symbols are set to the same value by the linker,
and _end symbol has less chances to clash with application defined
global symbols.

alpha, ia64 and sparc64 ports already use _end, i386 is now
consistent with them.

Reviewed by:	bde
Approved by:	obrien
Reported by:	pirzyk
2002-08-08 17:28:07 +00:00
ache
79ec2feeed Rewrite locale loading procedures, so any load failure will not affect
currently cached data.  It allows a number of nice things, like: removing
fallback code from single locale loading, remove memory leak when LC_CTYPE
data loaded again and again, efficient cache use, not only for
setlocale(locale1); setlocale(locale1), but for setlocale(locale1);
setlocale("C"); setlocale(locale1) too (i.e.  data file loaded only once).
2002-08-08 05:51:54 +00:00
mike
18df7c3f79 Implement POSIX.1-2001 (XSI)'s ulimit(3).
Submitted by:	Kyle Martin <mkm@ieee.org>
2002-08-08 04:50:36 +00:00
ache
af2928ecd6 Set errno to ENOMEM for strdup too (due to malloc errno bug) 2002-08-07 23:52:28 +00:00
ache
85c22fded0 Always set errno to ENOMEM after malloc failed (as workaround).
Our malloc sometimes forget to set errno, f.e. for size overflow case.
2002-08-07 22:03:46 +00:00
ache
3e9de67100 Reset __mb_cur_max to 1 when "C" or "POSIX" locales loaded after multibyte one 2002-08-07 20:49:25 +00:00
ache
b201e9010d Fix wrong address when EucInfo > "variable" size 2002-08-07 20:20:56 +00:00
archie
3fbb1e3cbf Correct an inaccuracy in this man page regarding detecting empty fields.
MFC after:	2 days
2002-08-07 20:08:50 +00:00
wollman
d5128d65e4 Document file descriptor reopening and current standardization status. 2002-08-07 18:03:30 +00:00
ache
eec8e25da2 Style fixes in preparation for rewritting 2002-08-07 18:02:45 +00:00
ache
667facf7e8 Style fixes 2002-08-07 16:49:20 +00:00
ache
91c4ffbf9e Style fixes in preparation of code rewritting 2002-08-07 16:45:23 +00:00
ache
e764c21376 Close descriptor, if error happens in loadCat() 2002-08-07 07:02:37 +00:00
tjr
98d924bef2 Build iswctype.c and manual pages for the functions it defines. 2002-08-06 00:49:59 +00:00
mike
a2eeb2ff2c o Fix a memory leak.
o Rewrite validmsgverb() so that it works (I'm not sure how it escaped
  my original testing).
o Document nextcomp().
2002-08-05 19:36:09 +00:00
tjr
3045dd93bd Add missing prototypes for extension functions to the SYNOPSIS. 2002-08-05 11:02:04 +00:00
tjr
f497534ce2 Use In macro instead of Fd. Add crossref to wctype(3). Refer to 1003.1-2001
in STANDARDS section. Document functions which are extensions to the standard.
2002-08-05 10:50:39 +00:00
tjr
f46620921a Use the In macro instead of Fd. Add crossref to wctrans(3). Refer to
1003.1-2001 in STANDARDS section.
2002-08-05 10:48:05 +00:00
tjr
fb27dc7d9f Implement the missing <wctype.h> functions: isw*() (iswalnum() etc.),
towlower() and towupper() required by ISO C90 Amd. 1.

iswascii(), iswhexnumber(), iswideogram(), iswnumber(), iswphonogram(),
iswrune() and iswspecial() have also been implemented for consistency
with the BSD extensions in <ctype.h>.
2002-08-05 10:45:23 +00:00
ache
d8308553eb Reject encoding > ENCODING_LEN at early stage instead of truncating it.
Use ptr == NULL instead of !ptr in few places.
Move saverr declaration to global section.
2002-08-05 09:58:45 +00:00
tjr
d3fd6b9974 Manual pages for wide character classification (isw*) and case conversion
(tow*) functions from NetBSD, unmodified except for the addition of $FreeBSD$.

Obtained from:	NetBSD
2002-08-05 08:04:58 +00:00
mike
4a94c14eee Implement POSIX.1-2001 (XSI)'s fmtmsg(3). 2002-08-05 06:49:58 +00:00
ache
c4541fa787 Try harder to check lang as path component (".", "..", / inside).
Try harder to not overwrite failure errno.
style(9) whitespace reformatting for code readability.
2002-08-04 14:03:59 +00:00
tjr
20a53a858b Change wctype_t to an unsigned type to avoid warnings. 2002-08-04 12:43:53 +00:00
tjr
cf85691cdb Add the ISO C90 Amd. 1 wctrans(3) and towctrans(3) functions. 2002-08-04 12:09:08 +00:00
tjr
cf46308bbf Add btowc(3) to SEE ALSO section. 2002-08-04 11:02:21 +00:00
ache
a96dd1fe9f Use errno to indicate failure reason.
Remove incomplete checks for 'name' and 'PatchLocale', they must be
already checked at this point.
2002-08-04 09:37:28 +00:00
bde
6448cde819 Fixed some style bugs (unsorting of MLINKS, and more than 1 assignment to
MAN per section).
2002-08-04 07:54:41 +00:00
obrien
0f6051060e Updated libc/libc_r that fixes the FreeBSD-SA-02:28.resolv resolver bug.
Submitted by:	Trevor Johnson <trevor@jpj.net>
2002-08-04 05:51:05 +00:00
ache
a3f41ddb94 Rewrite loadlocale() to eliminate LOAD_CATEGORY macro to save space. 2002-08-04 04:29:54 +00:00
ache
e6dac6fc83 Nonexistent SIZE_MAX -> SIZE_T_MAX 2002-08-04 04:11:48 +00:00
tjr
5526f51762 Signal an error instead of giving the caller less memory than they asked
for when num * size would cause integer overflow.

MFC after:	1 week
2002-08-04 02:52:11 +00:00
ache
9d7c2ac1fd Add ERRORS section according to POSIX (no errors) 2002-08-03 17:20:45 +00:00
ache
8a9b80f372 Catch empty encoding name too 2002-08-03 17:09:21 +00:00
ache
d72f1f4923 Fix return codes to match what setrunelocale() returns 2002-08-03 16:26:47 +00:00
ache
e01d9e52fc Preserve errno in fallback code 2002-08-03 15:56:25 +00:00
tjr
ce6de52497 Add ISO C90 Amd. 1 btowc(3) and wctob(3) functions. 2002-08-03 13:49:55 +00:00
tjr
272176b1a0 Correct use of Nm macro in NAME section and a broken cross reference. 2002-08-03 12:39:41 +00:00
ache
92af4a47aa Return errno provided by fopen, not always ENOENT.
Return EFTYPE instead of EINVAL for wrong locale file format.
Whitespaces.
2002-08-03 11:55:19 +00:00
ache
769d7edc1d Check encoding for ".", ".." and / inside 2002-08-03 10:23:06 +00:00
ache
dbc7991319 Return EINVAL for NULL or too long encoding, not EFAULT 2002-08-03 09:10:31 +00:00
ache
b83cc15839 Return ENAMETOOLONG for long PATH_LOCALE, not EFAULT 2002-08-03 09:07:27 +00:00
ache
418cd0ce7b 1) Use errno to indicate faulure reason.
2) Move incomplete check for / in locale name from env section to
loadlocale(), add check for "." and ".." too.
It allows to check any argument, not env only.
3) Redesing LOAD_CATEGORY macro to eliminate code duplication.
4) Try harder in fallback code: if old locale can't be restored,
load "C" locale
5) White space formatting, long lines, etc.
2002-08-03 09:04:44 +00:00
tjr
38509edfd6 Add ISO C90 Amd. 1 wctype(3) and iswctype(3) functions. 2002-08-03 04:18:40 +00:00
rwatson
4a12be55a4 Introduce support for Mandatory Access Control and extensible
kernel access control.

Extensions to libc to provide basic MAC label manipulation facilities
for userland.  These interface will be replaced in the next month
or two with more flexible interfaces, but provide sufficient support
to allow use of the Biba and MLS policies for user applications.

libc_r wrappers to follow.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-02 21:14:42 +00:00