Commit Graph

1177 Commits

Author SHA1 Message Date
Bruce Evans
270f6e44db Fixed some style bugs. 2003-07-01 12:30:03 +00:00
Alfred Perlstein
9470460d7a Don't segfault if setproctitle(3) is called with NULL initially.
The old buffer was not being initialized and a later str*() op on
it would cause a crash if it wasn't initialized by a previous
call to setproctitle(3) with an actual string.

Noticed by: Ashley Penney <ashp@unloved.org>
2003-07-01 09:45:35 +00:00
Gordon Tetlow
09f49aab84 Add a libc function execvP that takes the search path as an arguement.
Change execvp to be a wrapper around execvP. This is necessary for some
of the /rescue pieces. It may also be more generally applicable as well.

Submitted by:	Tim Kientzle <kientzle@acm.org>
Approved by:	Silence on arch@
2003-06-29 17:33:34 +00:00
David Schultz
ec045e41d9 Teach fmtcheck(3) about the flags a, A, F, G, t, and z. 2003-06-29 01:11:31 +00:00
John W. De Boskey
788940b418 fix NIS+ YP compat mode
PR:		bin/52792
Submitted by:	TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
2003-06-27 03:37:44 +00:00
Andrey A. Chernov
ba10c47105 Don't statically initialize buf to _PATH_DEV, _PATH_DEV always copied to
it in any case.
2003-06-24 22:20:06 +00:00
Yaroslav Tykhiy
f8193a054c Supplement the cross-references section with those to sigpending(2)
and sigprocmask(2).  These two syscalls are likely to be accompanied
by a few sigsetops(3) in a typical piece of code.
2003-06-24 15:27:31 +00:00
Poul-Henning Kamp
97679e71b0 ttyname(3) must return absolute pathnames.
Noticed by:	kris
2003-06-21 08:16:12 +00:00
Poul-Henning Kamp
e7acddfdef Use devname(3) to do the task.
Reviewed by:	imp
2003-06-20 22:45:53 +00:00
Poul-Henning Kamp
529ac58781 Add devname_r(3) which takes a buffer as argument. 2003-06-20 09:52:27 +00:00
Ruslan Ermilov
19c2ee9e5f Make the execle() synopsis look (again) like a normal C prototype.
Also fixed the rest of ell (list) functions prototypes to include
a (commented out) terminating null pointer.

Pointed out by:	bde
Obtained from:	POSIX.1-2001
Glanced at by:	imp
2003-06-18 15:24:21 +00:00
Poul-Henning Kamp
bbaba031a5 Fix the execle(3) synopsis to include the environment pointer.
Confused:	anordby
2003-06-17 08:57:37 +00:00
Philippe Charnier
ab165955de The .Fn function 2003-06-08 10:13:50 +00:00
Philippe Charnier
0d511e328f Add or correct section number in .Xr. Use .Vt or .Fn
instead of .Xr when needed
2003-06-08 10:01:52 +00:00
Poul-Henning Kamp
c6dd496cd9 Recognize the magic NODEV value.
Format other unknown devices consistently in hex.
2003-06-05 21:55:57 +00:00
Juli Mallett
d7ea49283c Match style of source and headers.
Submitted by:	bde
2003-06-01 21:35:27 +00:00
Ruslan Ermilov
0e35e492fc Assorted mdoc(7) fixes. 2003-06-01 19:19:59 +00:00
Juli Mallett
283d23cbba Make prototype match code with regard to constness of args to the
function pointer passed in.
2003-06-01 06:43:39 +00:00
Alexander Kabaev
8c22e2f77b Add an stub for _rtld_thread_init. This is a part I missed in
my last commit.

Approved by:	re (scottl)
2003-05-30 00:58:37 +00:00
Ruslan Ermilov
3a5146d9e2 Assorted mdoc(7) fixes.
Approved by:	re (blanket)
2003-05-22 13:02:28 +00:00
Ruslan Ermilov
aba60fa66b Fixed troff(1) and mdoc(7) warnings.
Approved by:	re (blanket)
2003-05-18 21:05:22 +00:00
Tim J. Robbins
6e7988b9c5 Catch up with the renaming of the "union" filesystem to "unionfs".
Fixes a problem where directory entries could show up twice: once
on the top layer of the union stack, and once on the bottom layer.

Approved by:	re (rwatson)
2003-05-16 02:15:07 +00:00
Tom Rhodes
a460614661 Use the .Dl macro.
Discussed with:	mdoc(7) officer ru
2003-05-01 20:27:59 +00:00
Tom Rhodes
7b98ad3005 State the fact that the range is twice the traditional RAND_MAX.
Add an EXAMPLES section.

PR:		48493
Submitted by:	Paul Herman <pherman@frenchfries.net> (original version)
2003-05-01 19:09:16 +00:00
Jacques Vidrine
d05090827f Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.
2003-05-01 19:03:14 +00:00
Jacques Vidrine
5723e501ab `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
Robert Drehmel
da0db726f7 Replace the return value of rfork_thread(3) in its manual page
function prototype with `pid_t' to match the declaration in
<unistd.h>.
2003-04-27 21:07:27 +00:00
Jacques Vidrine
c14d379de1 When using `compat' mode, be sure to re-dispatch setpwent, endpwent,
setgrent, and endgrent also.  (The previous NSS implementation used to
simply twiddle the internal data of the various modules directly.)

A symptom (group list set incorrectly in sshd) was
Reported by:	Glenn Johnson <gjohnson@srrc.ars.usda.gov>

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-25 18:25:19 +00:00
Jacques Vidrine
e2527daf1a In compat mode, we `redispatch' the lookup. It is probably a good
idea to re-initialize `struct passwd', because e.g. pw_class might
get set by one module, but not by another.  Add another call to the
internal pwd_init function to accomplish this.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 23:56:58 +00:00
Jacques Vidrine
0030cba4aa Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by
namespace.h.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 20:16:21 +00:00
Jacques Vidrine
5460b1abd2 ``Strong typing is a crutch for people with weak memories.''
Correct a bug that should have wreaked havoc everywhere, but for
some reason only bit unlucky people who use `-march' optimizations.
The compiler cannot assist one in distinguishing between the two
function calls below.

   int nsdispatch(void *, ...);
   void *discard;

   nsdispatch(&discard, ...);  /* correct .. no, really! */
   nsdispatch(discard, ...);   /* Boom                   */

Robin provided me with a debugging environment in which I could see
what was going on.

Badness when using CPUTYPE was
Reported by:	"Robin P. Blanchard" <Robin.Blanchard@gactr.uga.edu>
Reported by:	nork

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-22 22:19:05 +00:00
Jacques Vidrine
d3fc864f93 Don't try to access the NIS `master' maps unless we have superuser
privileges.  To do so may cause the NIS server to log spurious and
annoying `access denied' messages.

Reported by:	Philip Paeps <philip@paeps.cx>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-21 13:57:58 +00:00
Jacques Vidrine
43652a6ba6 Repair a bug in which a faulty group entry (one with only 2 colons)
would result in an incorrectly terminated grouplist.

login(1) crashes
Reported by:	Morten Rodal <morten@rodal.no>,
		Matthias Schuendehuette <msch@snafu.de>
2003-04-20 01:12:00 +00:00
Jacques Vidrine
171614bfd6 Follow-up to revision 1.74: Using the result buffer to store our empty
string was an incredibly dumb idea (of course it will be changed by an
NSS module on success!).  Use a static empty string instead.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 22:07:30 +00:00
Jacques Vidrine
a9ceaa9dc8 Follow-up to revision 1.73: set _PWF_FILES when `compat' source is used
but user is found in local file.

Reported by:	Shizuka Kudo <shizukakudo_99@yahoo.com>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 21:13:35 +00:00
Jacques Vidrine
4c3c0fecae Don't use `memset' to initialize a struct passwd. A module
may not fill in all fields, and in the case of string fields, this could
cause trouble for applications.  (The only likely example is `pw_class',
because this field is not used by all modules in all cases.)

Move initialization of struct passwd from module-specific code to the
dispatch code.

The problem of a NULL pw_class was
Noticed by:	Philip Paeps <philip@paeps.cx>
                    and the c^Htrusty ssh(1) command.
Déjà vu by:	getpwent.c revision 1.56

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 17:27:05 +00:00
Jacques Vidrine
71cc8f0764 Correctly set _PWF_FILES in pw_fields when appropriate.
(_PWF_NIS and _PWF_HESIOD were already being set.)

Reported by:	Shizuka Kudo <shizukakudo_99@yahoo.com>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 16:24:25 +00:00
Jacques Vidrine
b4603f3dd4 Revert the definitions of _PW_KEY* to their previous values. There is
at least one consumer outside of libc and pwd_mkdb.
Adjust the versioning in libc and pwd_mkdb accordingly.

named was the application affected, and that fact was first
Reported by:	Zherdev Anatoly <tolyar@mx.ru>

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 14:11:17 +00:00
Jacques Vidrine
1b467db206 The default if nsswitch.conf(5) is not present is supposed to be the
hated `compat' source, not `files'.

Reported by:	Philip Paeps <philip@paeps.cx>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 01:00:37 +00:00
Jacques Vidrine
05f98035ee = Implement thread-safe versions of the getpwent(3) and getgrent(3)
family of functions using the new nsdispatch(3) core.  Remove
  arbitrary size limits when using the thread-safe versions.

= Re-implement the traditional getpwent(3)/getgrent(3) functions on
  top of the thread-safe versions.

= Update the on-disk format of the hashed version of the passwd(5)
  databases to allow for versioned entries.  The legacy version is
  `3'.  (Don't ask.)

= Add support for version `4' entries in the passwd(5) database.
  Entries in this format are identical to version 3 entries except
  that all integers are stored as 32-bit integers in network byte
  order (big endian).

= pwd_mkdb is updated to generate both version 3 and version 4
  entries.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-17 14:15:26 +00:00
Jacques Vidrine
46d9306383 = Implement name service switch modules (NSS modules). NSS modules
may be built into libc (`static NSS modules') or dynamically loaded
  via dlopen (`dynamic NSS modules').  Modules are loaded/initialized
  at configuration time (i.e.  when nsdispatch is called and nsswitch.conf
  is read or re-read).

= Make the nsdispatch(3) core thread-safe.

= New status code for nsdispatch(3) `NS_RETURN', currently used to
  signal ERANGE-type issues.

= syslog(3) problems, don't warn/err/abort.

= Try harder to avoid namespace pollution.

= Implement some shims to assist in porting NSS modules written for
  the GNU C Library nsswitch interface.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-17 14:14:22 +00:00
Tim J. Robbins
a40248455d Return "/boot/kernel/kernel" instead of "/kernel" if the sysctl() call
fails. The documentation was incorrectly updated in getbootfile.3 rev. 1.10.
2003-04-11 13:54:28 +00:00
Matthew N. Dodd
196f440aa2 Bump the date. 2003-04-07 22:59:12 +00:00
Matthew N. Dodd
564b641ef9 Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.
Requested by:	 ru
2003-04-07 14:21:14 +00:00
Matthew N. Dodd
134dbc4c32 - Add setfstab() and getfstab().
- Use the environment variable 'PATH_FSTAB' if set rather than the
  hardcoded '/etc/fstab' (fstab.h:_PATH_FSTAB)
2003-04-07 12:55:00 +00:00
Jeff Roberson
cc3521d660 - Define a _spinunlock() function so that threading implementations may do
more complicated things than just setting the lock to 0.
 - Implement stubs for this function in libc and the two threading libraries
   that are currently in the tree.
2003-03-26 04:02:24 +00:00
Philippe Charnier
b43dc21149 The .Fn function
The ... 2 system call
2003-03-24 16:07:19 +00:00
Philippe Charnier
9d09157a0f The .Fn function. Use .Xr where appropriate. 2003-03-24 16:05:24 +00:00
Robert Drehmel
0d74f328ae - Revamp the function _nis_initshells() to make getusershell() backed
by NIS work, like nsswitch.conf(5) promises to be able to.
   (These modifications will be fed back to NetBSD, of course)
 - In endusershell(), do not set `sl' to NULL if we know it already has
   that value.
2003-03-19 14:17:24 +00:00
Robert Drehmel
916560b152 If realloc(3) fails in copyline(), do not make matters worse by
leaving without deallocating `data' thereby creating a memory leak.
2003-03-19 14:01:35 +00:00
Tim J. Robbins
be074a2dd8 Document return type of wordfree() (void). Reduce the space between
struct member names and the corresponding comments so the lines don't
wrap on 80-column terminals.
2003-03-13 11:18:53 +00:00
Jacques Vidrine
2bbd7cf820 Eliminate 19 warnings in libc (at level WARNS=2) of the
`implicit declaration of function' variety.
2003-02-27 13:40:01 +00:00
Ruslan Ermilov
5b58c5a0d5 Fixed copyright.
Tidy up the markup.
Only describe the new, post-2.0 behavior.
Added the RETURN VALUES and ERRORS sections.
2003-02-24 22:55:33 +00:00
Ruslan Ermilov
ace5be682d mdoc(7) police: Scheduled sweep. 2003-02-24 22:53:26 +00:00
Ruslan Ermilov
522ccf3f35 mdoc(7) police: markup laundry. 2003-02-23 01:47:49 +00:00
Mike Heffner
ad4f17067f More changes from NetBSD:
* use correct error detection of realloc failure
     * strtol negative return check
     * use strtol to validate string instead of rolling our own
       validation code
     * terminate the command sequence correctly
2003-02-23 00:24:03 +00:00
Mike Heffner
215d1a9eb1 Grab some changes from NetBSD:
fix const poisoning
     add cast to silence warning
     pull in unistd.h
2003-02-23 00:06:35 +00:00
Dave Zarzycki
a23c6aee4d Apple PR-2449102: getdomainname() doesn't document that it is NIS/YP specific 2003-02-22 19:02:23 +00:00
Alexey Zelkin
e859833529 Mention that dlerror() is also applicable to retrieve error message after
dladdr() and dlinfo() functions calls.
2003-02-21 13:43:41 +00:00
Jacques Vidrine
6d7bd75a4e Whack 28 unused variables. 2003-02-18 13:39:52 +00:00
Jacques Vidrine
e0554a531f Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).
Only warnings that could be fixed without changing the generated object
code and without restructuring the source code have been handled.

Reviewed by:	/sbin/md5
2003-02-16 17:29:11 +00:00
Alexey Zelkin
02e6893b9c Add dlinfo(3) manual page to the rank of base system manpages 2003-02-15 10:52:46 +00:00
Alexey Zelkin
f734492604 Add examples of dlinfo() usage to manual page. 2003-02-15 10:51:05 +00:00
Alexey Zelkin
7ec37597d3 o Document that dlsym()'s behaviour with new special handle RTLD_SELF
o Add cross reference to dlinfo(3)
o Minor mdoc nits
2003-02-14 10:57:20 +00:00
Alexey Zelkin
6bc55edb4c Follow Solaris's manual page and describe Link_map structure here 2003-02-14 10:54:37 +00:00
Alexey Zelkin
8647a1ed45 Add manual page for dlinfo(3). It's still need some work and add
examples, but it's better than nothing already.
2003-02-14 10:07:43 +00:00
Alexander Kabaev
42d206e975 Implement dlinfo() function.
Introdice RTLD_SELF special handle and properly process it within
dlsym() and dlinfo() functions.

The intention is to improve our compatibility with Solaris and
to make a Java port easier.

Partially submitted by:	phantom
2003-02-13 17:47:44 +00:00
Mike Barcroft
5d62092f94 o Implement C99 classification macros isfinite(), isinf(), isnan(),
isnormal().  The current isinf() and isnan() are perserved for
  binary compatibility with 5.0, but new programs will use the macros.
o Implement C99 comparison macros isgreater(), isgreaterequal(),
  isless(), islessequal(), islessgreater(), isunordered().

Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
2003-02-12 20:03:41 +00:00
Mike Barcroft
1006f448b7 This manual is called SIGNBIT(3) not FPCLASSIFY(3). 2003-02-12 03:29:39 +00:00
Mike Barcroft
8e9b28311e Implement C99's signbit() macro. 2003-02-11 21:56:21 +00:00
Alfred Perlstein
e6cfb1ccd3 Handle %%m properly in syslog format string. Previously it would expand
the %m into the errno and then vfprintf would expand the % and the first
character of the strerror(3) return causing possible data corruption.
2003-02-10 08:31:28 +00:00
Mike Barcroft
8cf5ed5125 Implement fpclassify():
o Add a MD header private to libc called _fpmath.h; this header
  contains bitfield layouts of MD floating-point types.
o Add a MI header private to libc called fpmath.h; this header
  contains bitfield layouts of MI floating-point types.
o Add private libc variables to lib/libc/$arch/gen/infinity.c for
  storing NaN values.
o Add __double_t and __float_t to <machine/_types.h>, and provide
  double_t and float_t typedefs in <math.h>.
o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF,
  HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to
  <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via
  <machine/float.h>.
o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based
  on the size of its argument.  __fpclassifyl() is never called on
  alpha because (sizeof(long double) == sizeof(double)), which is good
  since __fpclassifyl() can't deal with such a small `long double'.

This was developed by David Schultz and myself with input from bde and
fenner.

PR:		23103
Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
		(significant portions)
Reviewed by:	bde, fenner (earlier versions)
2003-02-08 20:37:55 +00:00
Mike Heffner
5a63c107db Grammer fix. 2003-02-04 16:28:04 +00:00
Tom Rhodes
61827fde23 Add getosreldate.3 to the Makefile. 2003-01-30 21:38:39 +00:00
Tom Rhodes
a117d47242 Add a manual page for getosreldate.c.
PR:		46365
Submitted by:	gioria (original version)
OK'ed by:	alfred (older version)
2003-01-30 21:37:06 +00:00
Alfred Perlstein
b17c9cfa5e Add const qualifier to data argument for msgsnd.
PR: standards/45274
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-01-26 20:09:34 +00:00
David E. O'Brien
0f38d8d9aa Sync with NetBSD -- sl_add() now returns an int. 2003-01-19 01:16:01 +00:00
Tim J. Robbins
5b8dbaa1f9 Add a missing word. 2003-01-15 09:48:15 +00:00
Tim J. Robbins
bae7e9ec5e Document the named semaphore functions. This could still use a bit
of polishing.
2003-01-15 03:07:40 +00:00
Tim J. Robbins
74e03642ee Back out previous; sharing semaphores between processes only works
in certain special cases.
2003-01-14 07:14:06 +00:00
Tim J. Robbins
ab099bd309 Sharing semaphores between processes works now, so remove the stale comments
about it always returning EPERM. Document that ENFILE occurs when the
limit on kernel semaphores is reached.
2003-01-14 04:12:33 +00:00
Tim J. Robbins
51f2ddd7af Cross reference sem(4) so users know which kernel options are required
to use these semaphore functions.
2003-01-14 03:39:09 +00:00
Tim J. Robbins
a91b25dc1c Add the newly created semaphore to the named semaphore list in sem_open()
so that multiple opens of the same semaphore without an intervening
sem_close() return the same object, and so that sem_close() does not
segfault while trying to remove the item from the list.
2003-01-14 03:36:45 +00:00
Tim J. Robbins
098b8611cb Avoid a memory leak by using reallocf() instead of realloc(). 2003-01-10 02:58:25 +00:00
Tim J. Robbins
73e8989de8 Prototype __getcwd() to avoid a warning. 2003-01-10 02:54:37 +00:00
Tim J. Robbins
826f01cb9e #include <ctype.h> for prototypes (or macro versions) of
tolower() and isdigit().
2003-01-10 02:46:32 +00:00
Tim J. Robbins
6398b9c017 #include "namespace.h" to get a prototype for _err(). 2003-01-07 06:55:58 +00:00
Tim J. Robbins
2005f192e5 Use hidden names (_close, _dup2, _waitpid, etc.) where appropriate. 2003-01-07 06:07:56 +00:00
Tim J. Robbins
fe634ca75f Fix a number of bugs noticed by more extensive testing:
o Call waitpid() if an error occurs after forking the child process
   to avoid leaving zombies around.
 o Handle the WRDE_DOOFS|WRDE_APPEND combination correctly
 o Do not confuse $( substitution with $(( shell arithmetic
     (noticed by wollman)
 o Handle backslash escaping properly
 o Allow $( and ${ to be quoted
2003-01-04 06:07:44 +00:00
Tim J. Robbins
86e1d4729f Rename UL_GETSIZE to UL_GETFSIZE and UL_SETSIZE to UL_SETFSIZE; these are
the names required by 1003.1-2001. The old names are retained for
source compatibility with FreeBSD 5.0 and will be removed before 6.0.
2003-01-04 01:11:49 +00:00
Tim J. Robbins
f2bc7cd262 Remove unused variable: sz. 2003-01-04 00:24:35 +00:00
Tim J. Robbins
e61ca145b8 Remove unused variable: size. 2003-01-04 00:20:54 +00:00
Tim J. Robbins
81b3ad59c2 #include <string.h> for strcmp()'s prototype. 2003-01-04 00:18:50 +00:00
Tim J. Robbins
a97ab40a26 Remove unused variable: omask. 2003-01-04 00:15:15 +00:00
Tim J. Robbins
4ee99abcd1 #include <sys/linker.h> for kldload()'s prototype. 2003-01-04 00:13:00 +00:00
Tim J. Robbins
e8cfa64a75 #include <string.h> for strlen()'s prototype. 2003-01-04 00:11:11 +00:00
Tim J. Robbins
185ec971c5 #include <ctype.h> for isspace()'s prototype (or a macro version). 2003-01-03 23:55:58 +00:00
Tim J. Robbins
02ba3221ff Remove an unused variable: `sb' in fts_read(). 2003-01-03 23:25:25 +00:00
Tim J. Robbins
d3701b0441 Remove an unused variable, `sverrno', which has not been used since 1.11. 2003-01-03 23:16:55 +00:00
Tim J. Robbins
7d3125b3ac It is no longer necessary to include sys/types.h before wordexp.h. 2003-01-03 12:04:36 +00:00
Tim J. Robbins
c0595bfc20 popen() is a function, not an argument. 2003-01-03 05:21:59 +00:00
Tim J. Robbins
77e2381a3e Protect pidlist with a mutex to avoid a race causing a duplicate free()
when the same pipe FILE is pclosed()'d in different threads, and to avoid
corrupting the linked list when adding or removing items. The symptoms of
the linked list getting corrupted were pclose() either not finding the pipe
on the list, or the list becoming circular and pclose() looping infinitely.
2003-01-03 04:35:04 +00:00
Thomas Quinot
464ef179a0 In cgetmatch(3), return -1 if a NULL or 0-length name parameter is used.
This situation most notably arises in chkprintcap, when a /etc/printcap
entry has an empty rp= attribute. In that case, cgetmatch would enter
an infinite loop if any entry in the file has multiple names.

This causes lpd to hang at boot time on 5.0-DP2 when both conditions
are met (:rp=: and multiple names -- not necessarily on the same entry).

Reviewed by:	roberto
2003-01-02 10:19:43 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
David E. O'Brien
c2e55537ec Back out the s/int */size_t */ commit.
It makes a difference on 64-bit arches, and no one really wants a 2^64
block size [yet].
2002-12-30 11:12:16 +00:00
Marcel Moolenaar
2bc46a6452 Fix LP64 architectures and especially ia64. Functions that return
a pointer and lack a prototype will have the return value (assumed
to be an integer) zero-extended to a pointer. On ia64 this is
unconditionally fatal as it zeroes-out the region bits, forming an
invalid pointer. Fix the sigsegv by including <stdlib.h>.

Pointy hat: bbraun
2002-12-30 01:41:14 +00:00
Mike Barcroft
07842325eb Use useconds_t' instead of u_int' or `unsigned int' where appropriate. 2002-12-29 00:59:09 +00:00
Jens Schweikhardt
57bd0fc6e8 english(4) police. 2002-12-27 12:15:40 +00:00
Alfred Perlstein
beb24986a7 Silence casting away constness warnings.
Make cgetmatch's locals const.
Make cdbget take a const string and copy it into a buffer.
2002-12-27 08:43:40 +00:00
Tim J. Robbins
cd203b8ead Fix a small typo. 2002-12-27 08:28:53 +00:00
Tim J. Robbins
97c1c8f886 Be more consistent with "static". 2002-12-27 01:01:03 +00:00
Tim J. Robbins
faea1495bf Add an implementation of the POSIX wordexp() and wordfree() functions,
which perform shell-style word expansion on strings. This is still a
little rough around the edges.

PR:		13420
2002-12-26 14:34:18 +00:00
Rob Braun
81781ca042 Reduce libc's memory footprint by lazily allocating memory used internally
by setproctitle().

Reviewed by: jkh
2002-12-21 22:04:50 +00:00
Rob Braun
5fb691beab Reduce libc.so's memory footprint by lazily allocating memory used internally
by basename() and dirname().
Reviewed by: eric
2002-12-21 07:12:35 +00:00
Ruslan Ermilov
2efeeba554 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
Ruslan Ermilov
5c564bae0a mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
Ruslan Ermilov
95f4226b27 mdoc(7) police: "The .Fn function". 2002-12-18 10:13:54 +00:00
Ruslan Ermilov
b92cc9b878 mdoc(7) police: Fixed the .Nm abuse. 2002-12-18 10:10:32 +00:00
Maxim Konovalov
a61f5b202b o getsockopt(2) 'level' argument should be 0, not SOCK_STREAM. It
does not hurt anything because uipc_ctloutput() does not check
sopt->sopt_level.

Pointed out by:	ru
MFC after:	1 week
2002-12-16 13:42:13 +00:00
Maxim Konovalov
04e30a1ce6 o Fix bogus getsockopt(2) call: swap SOCK_STREAM and LOCAL_PEERCRED.
The bug does not affect anything because SOCK_STREAM == LOCAL_PEERCRED == 0x1.

PR:		bin/46165
Submitted by:	Alain Thivillon <at@rominet.net>
Reviewed by:	dd
MFC after:	1 week
2002-12-15 09:37:54 +00:00
Ruslan Ermilov
8d5d039f80 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
Ruslan Ermilov
db8993ce9e Capitalize ASCII code names.
Approved by:	re
2002-12-05 08:50:00 +00:00
Ruslan Ermilov
ae82896268 Consistently mark std(in|out|err) with .Dv, because that's how they
are marked up in stdio(3), and because they are defined expressions
of type "FILE *".

Approved by:	re
2002-12-04 18:57:46 +00:00
Ruslan Ermilov
304d1f73fe mdoc(7) police: overhaul.
Approved by:	re
2002-12-04 15:47:41 +00:00
Ruslan Ermilov
1798791d24 mdoc(7) police: formatting nits.
Approved by:	re
2002-11-29 15:57:50 +00:00
Ruslan Ermilov
c51d717f0c libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
Doug Barton
7fd268cce6 goto break; != break;
I've no idea if this is the right behavior for the library, but this
at least fixes the build, and matches what seems to be alfred's intent
in the commit message for 1.19.
2002-11-17 08:54:29 +00:00
Alfred Perlstein
f51c1e897d Rework the sysconf(3) interaction with aio:
sysconf.c:
  Use 'break' rather than 'goto yesno' in sysconf.c so that we report a '0'
  return value from the kernel sysctl.

vfs_aio.c:
  Make aio reset its configuration parameters to -1 after unloading
  instead of 0.

posix4_mib.c:
  Initialize the aio configuration parameters to -1
  to indicate that it is not loaded.
  Add a facility (p31b_iscfg()) to determine if a posix4 facility has been
  initialized to avoid having to re-order the SYSINITs.
  Use p31b_iscfg() to determine if aio has had a chance to run yet which
  is likely if it is compiled into the kernel and avoid spamming its
  values.
  Introduce a macro P31B_VALID() instead of doing the same comparison over
  and over.

posix4.h:
  Prototype p31b_iscfg().
2002-11-17 04:15:34 +00:00
Alfred Perlstein
3d8ce33a50 Provide more correct default values for sysconf(3) reporting of the AIO
subsystems capabilities:

_SC_AIO_LISTIO_MAX returns the default of _POSIX_AIO_LISTIO_MAX
_SC_AIO_MAX returns the default _POSIX_AIO_MAX
_SC_AIO_PRIO_DELTA_MAX returns the default of 0

Without these adjustments the values returned are -1 even when the
aio side of the kernel returns '0' for them which is incorrect.

Noticed by: Craig Rodrigues <rodrigc@attbi.com>
2002-11-16 06:35:20 +00:00
Ruslan Ermilov
bedff4e805 Reset LogTag to NULL in closelog(3). This fixes mysterious crashes
caused by dynamic PAM modules that call openlog(3) and closelog(3),
e.g. ports/security/pam_pwdfile.

What happened here is that the module first registered its "ident"
with openlog(3), then PAM library unloaded module with dlclose(3),
and the next call to syslog(3) resulted in SIGSEGV.

MFC after:	3 days
2002-11-14 12:40:14 +00:00
Daniel Eischen
fcfc20c88a Argh, change declaration of two-dimensional array so that it actually
builds.
2002-11-13 21:55:22 +00:00
Daniel Eischen
fb22a377c6 Use a jump table (a la Solaris) for pthread routines with default
entries in the table being stubs.  While I'm here, add macros to
auto-generate the stubs.  A conforming threads library can override
the stub routines by filling in the jump table.

Add some entries to namespace.h and sync un-namespace.h to it.
Also add a comment to remind folks to update un-namespace.h
when changing namespace.h.
2002-11-13 18:12:09 +00:00
Doug Rabson
ceb336710e * Add stubs for pthread_cond_broadcast.
* Fix typos in rwlock stubs.
* Add pthread_XXX counterparts to the _pthread_XXX stubs which libraries
  like libX11 can use to ensure thread-safety without requiring the use
  of a thread library.

Submitted by: Terry Lambert (pthread_cond_broadcast)
Reviewed by: deischen
2002-11-01 09:37:17 +00:00
Garrett Wollman
c9885518de Create a small library function, check_utility_compat(3), to determine
whether a named utility should behave in FreeBSD 4.x-compatible mode
or in a standard mode (default standard).  The configuration is done
malloc(3)-style, with either an environment variable or a symlink.

Update expr(1) to use this new interface.
2002-10-28 00:15:43 +00:00
Garrett Wollman
188c541ceb Update limits and configuration parameters for 1003.1/TC1/D6.
Implement new sysconf keys.  Change the implenentation of
_SC_ASYNCHRONOUS_IO in preparation for the next set of changes.

Move some limits which had been in <sys/syslimits.h> to <limits.h> where
they belong.  They had only ever been in syslimits.h to provide for the
kernel implementation of the CTL_USER MIB branch, which went away with
newsysctl years ago.  (There is a #error in <sys/syslimits.h> which I
will downgrade in the next commit.)
2002-10-27 18:03:02 +00:00
Mark Murray
d69d15193c Make the first argument of getbsize a size_t* instead of an int*, as this is what the quantity actually is. Fix an easy const while I'm here. 2002-10-23 14:18:07 +00:00
Tim J. Robbins
67c3339291 The ftok() function has not been in libcompat for quite a while. 2002-10-19 13:33:12 +00:00
Mark Murray
08076c086f Oops. Also provide a lint-compatible unused argument warning killer. 2002-10-18 16:24:20 +00:00
Mark Murray
6b83b5cdb8 ISOfy functions, sort headers and mark unused arguments. 2002-10-18 16:22:13 +00:00
Tim J. Robbins
185b9d1c2c Add a Bugs section and note that fmtcheck() is out of sync with printf();
it does not recognise any of the conversions or modifiers added in C99.
2002-10-16 04:03:02 +00:00
Mike Barcroft
54e4e385de Add restrict type-qualifier. 2002-10-12 16:13:41 +00:00
Maxim Konovalov
65edeb2358 Do not allow empty GIDs for non-NIS entries.
MFC after:	2 weeks
2002-10-11 11:35:30 +00:00
Peter Wemm
cf9f968444 Drop almost 3k from /bin/sync by moving errno to a seperate file
to avoid all syscalls pulling in sys_errlst[].

Noted by:  bde
2002-10-09 08:04:24 +00:00
Mike Barcroft
ddb4fb5b44 Add restrict type-qualifier to sem_getvalue(). 2002-10-04 21:32:00 +00:00
Maxim Konovalov
9b7c7ff8ce Too strict error checking in rev. 1.22 broke pwd_mkdb(8) in NIS
environment. An empty UID and GID are valid there.

Spotted by:	rwatson
2002-10-02 07:02:46 +00:00
Maxim Konovalov
05a7daf5ca 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
Garrett Wollman
0b32a813fa 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
Garrett Wollman
0d3bcc2e80 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
Jonathan Mini
4ed3c94b61 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