Commit Graph

70 Commits

Author SHA1 Message Date
tjr
8366c4708a Remove incomplete support for running FreeBSD userland on old NetBSD kernels
lacking the issetugid() and utrace() syscalls.
2003-10-29 10:45:01 +00:00
nectar
0b64e1476b Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.
2003-05-01 19:03:14 +00:00
nectar
e69967f534 `Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
technique) so that we don't wind up calling into an application's
version if the application defines them.

Inspired by:	qpopper's interfering and buggy version of strlcpy
2003-04-29 21:13:50 +00:00
ru
40e2359f4b libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
wollman
f8a79b86e6 Do not include <sys/syslimits.h> directly; it is not intended for general
consumption.
2002-10-27 17:44:33 +00:00
ache
08eb533d34 Now, malloc is fixed, remove ENOMEM hardcode 2002-08-12 11:47:19 +00:00
ache
586a522666 Set errno to ENOMEM for strdup too (due to malloc errno bug) 2002-08-07 23:52:28 +00:00
ache
99fbabc1a4 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
fcb62c0916 Close descriptor, if error happens in loadCat() 2002-08-07 07:02:37 +00:00
ache
fe9a9d5bc5 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
obrien
d90536e35b Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
2002-03-22 21:53:29 +00:00
ru
623da62a5a mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
ru
95ce4d2cdc Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
dd
a145482cf6 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
25ef23ac1c MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
phantom
5f22417d42 Use .Rv macro instead of hardcoded message 2001-02-12 08:42:56 +00:00
deischen
1635c221b7 Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions.  If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
	__sys_foo - actual system call
	_foo - weak definition to __sys_foo
	foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo.  In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde).  All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes.  <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h  namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE.  We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by:	-arch
2001-01-24 13:01:12 +00:00
ru
8ba4187688 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
ru
eb8c554f56 mdoc(7) police: use certified section headers wherever possible. 2000-11-17 11:44:16 +00:00
phantom
7413cf0b7c Fix typo
PR:		misc/21596
Submitted by:	TOGAWA Satoshi <toga@puyo.org>
2000-09-27 18:24:31 +00:00
ache
ddefbaa46b Prevent buffer overflow if NLSPATH is too long 2000-09-08 11:42:37 +00:00
ache
962cffc5fb Add .El 2000-09-06 16:52:01 +00:00
ache
f7c8729376 Document %-macros and NLSPATH better. 2000-09-05 19:14:34 +00:00
ache
7925505886 Fully implement NLSPATH processing as described in SUSv2 2000-09-05 14:04:21 +00:00
phantom
5b566d9d01 Oops! don't set errno to ENOMEM explicitly if malloc() failed.
Found by:	ache
2000-09-05 12:23:08 +00:00
phantom
adbc56332d * move $FreeBSD$ tag to its usual place (bottom of copyright)
* mdoc cleanup
* document missing errno values (ERRORS section)

Reviewed by:	sheldonh
2000-09-04 13:20:56 +00:00
phantom
07bb417f8a Finaly cleanup libc/nls code:
* rewrite catopen() to remove duplicate code chunks and optimize
* if empty string is passed to catopen() as name argument then
   catopen() will set errno to ENOENT (File not found), not EINVAL
* move search code to LOOKUP() macro to shrink amount of duplicated code
* move common resource freeing actions to __nls_free_resources() function
* exclude from build code related to MCLoadAll defintion since it is not
  using at all
* style(9) related whitespace changes

Reviewed by:	ache
2000-09-04 12:09:40 +00:00
ache
bbd4badbd6 Rewrite using stdio. It cause program speedup since eliminates lots of small
read() syscalls.  It not cause static binary size increasing because stdio
already picked via setlocale() called from catopen()
2000-09-03 21:05:10 +00:00
ache
6d6923050a Treat empty lang as "C" lang too 2000-09-01 13:19:18 +00:00
phantom
5b3f190e28 Set rcsid to correct value
Resort #include files
Remove SYSV compatibility chunks
2000-09-01 12:19:00 +00:00
phantom
76465a7c58 protect .h file contents correctly. 2000-09-01 12:13:33 +00:00
phantom
2ae932bdcb Remove unused indirect references to cat* functions. 2000-09-01 12:10:59 +00:00
phantom
3fd2030fc4 Fix memory leak introduced by kris in rev 1.22 2000-09-01 11:56:31 +00:00
ache
abfec47a85 setlocale may return NULL, handle this case too by resetting to "C" 2000-09-01 11:13:38 +00:00
ache
fea9bbdd85 Move protection code down to handle NL_CAT_LOCALE case too. 2000-09-01 11:09:34 +00:00
ache
c023c260fc Protect from badly formed LANG variable 2000-09-01 10:54:04 +00:00
ache
85d6a99272 catgets: detect if fd becomes invalid after exec and return default response
cosmetique, use NULL for pointers comparison
2000-08-30 11:44:44 +00:00
ache
b919003d91 Explicetely describe catalog descriptor lifetime 2000-08-30 10:22:23 +00:00
kris
04e6eba710 Prevent internal buffer overflow due to expansion of $LANG and/or name
argument in catopen().

Reviewed by:	chris, -audit
2000-08-05 04:56:43 +00:00
phantom
5401879e3b Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
sheldonh
329223e6f2 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +00:00
jasone
8abe2a2d86 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo().  In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate.  In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by:	deischen
2000-01-27 23:07:25 +00:00
jasone
75903038bc Add three-tier symbol naming in support of POSIX thread cancellation
points.  For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep().  The arrows represent weak aliases.  For
system calls, the pattern is _read() <-- _libc_read() <-- read().
2000-01-12 09:23:48 +00:00
phantom
f78a3faf1a Add gencat(1) to SEE ALSO section.
PR:		docs/13658
Submitted by:	Zahemszky Gabor <zgabor@code.hu>
1999-09-22 22:44:42 +00:00
peter
76f0c923fe $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
ache
3d028a61c9 Provide meaningful errno value on error return 1998-07-14 18:27:43 +00:00
ache
6a800a155d Add reference to setlocale(3) 1998-04-30 16:11:50 +00:00
ache
f4a8d4f4e4 Return -1 for invalid descriptor in catclose 1998-04-30 13:15:31 +00:00
ache
b2b5a3545a If passed catgets descriptor is NULL or -1, return default string immediately 1998-04-30 12:25:05 +00:00
ache
c21e828637 Force loadType to 0 1998-04-30 11:39:08 +00:00