Commit Graph

859 Commits

Author SHA1 Message Date
Ruslan Ermilov
d3eb181523 mdoc(7) police: remove whitespace at EOL. 2001-11-20 13:43:58 +00:00
Dima Dorfman
0157de9706 Create link from directory.3 to readdir_r.3.
PR:		32028
Submitted by:	andrew@ugh.net.au
2001-11-16 15:49:38 +00:00
Bruce Evans
ac8e56a7f9 Fixed namespace pollution related to `err' in libc in the same way as for
`warn'.  Now a whole 2 members of the err() family don't cause pollution.

This fixes world breakage in awk for NOSHARED worlds. contrib/awk/msg.c
has had its own version of err() for a long time, but this somehow
didn't cause problems until the update to awk-3.1.0.
2001-11-11 02:48:09 +00:00
David Malone
7e1b81799d Add a note explaining why CLOCKS_PER_SEC isn't 1000000.
While I'm here, "of a second" does not belong to CLOCKS_PER_SEC.

PR:		30297
Submitted by:	Bernd Luevelsmeyer <bdluevel@heitec.net>
2001-11-05 21:30:43 +00:00
Poul-Henning Kamp
b4e471b90f Add notice about early use from malloc.c forbidding malloc use from
this function.
2001-11-02 11:30:42 +00:00
Mike Barcroft
762e881bab Make the output from assert() look more like the example in the C99
standard.

Requested by:	bde
2001-10-29 07:07:25 +00:00
Mike Barcroft
cb5f460523 Only provide function information in compile environments that support
the C99 variable __func__ and never for C++.  Provide a more meaningful
example in the assert(3) manual.

Reviewed by:	asmodai, bde
2001-10-27 20:11:10 +00:00
Mike Barcroft
c44a27673c Restore K&R prototype. Fix other style bugs.
Reviewed by:	asmodai, bde
2001-10-27 19:37:20 +00:00
Peter Wemm
9213df7cda Explicitly use int32_t for on-disk records for pw_change and pw_expire,
since that is what we use now and this insulates us from any time_t
tweaks here.  We can define a record format that uses 64 bit times if/when
we need to.
2001-10-27 02:13:41 +00:00
Jeroen Ruigrok van der Werven
6cefb54a32 Add __FBSDID.
Change __assert() function to print failing function name.
#if 0 the sccsid block.
This makes us C99 conforming.
2001-10-24 18:12:18 +00:00
Bruce Evans
6eabd84580 Compensate for "Compensate for header dethreading" by backing it out. 2001-10-10 17:48:44 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
7d8983a292 Document the FTS_ROOTPARENTLEVEL and FTS_ROOTLEVEL constants. 2001-09-20 12:32:45 +00:00
Ruslan Ermilov
d6002fef6f Use ``.Rv -std'' wherever possible.
Submitted by:	yar
2001-08-31 09:57:38 +00:00
Bruce Evans
1643f03d5f Fixed namespace pollution related to `warn' in libc (but not in other
libraries or for other members of the err() family).

This fixes world breakage in bc and rcs/* for NOSHARED worlds.
2001-08-29 13:52:27 +00:00
Dima Dorfman
dae32f31ab begin executed --> being executed
Obtained from:	NetBSD
2001-08-24 00:18:37 +00:00
Dima Dorfman
2c0dd4d134 Use .In, .Ux, and .Rv where appropriate. Also consistently call this
a "function" instead of a "routine".

Submitted by:	ru
2001-08-21 19:32:47 +00:00
Dima Dorfman
ccbe835258 Expand the ?: construct into an if/else.
Submitted by:	nectar
2001-08-21 19:27:07 +00:00
Dima Dorfman
c9fa8f40fe The setprogname() function sets the name of the program to be the last
component of the progname argument.
2001-08-21 18:49:58 +00:00
Dima Dorfman
f7bec57b78 Fix style bug. 2001-08-21 18:46:33 +00:00
Ruslan Ermilov
c45f3b47c8 Fixed warnings. 2001-08-21 17:28:39 +00:00
Jacques Vidrine
80578ef3c9 Pass the pointy hat, please.
Submitted by:	ru
2001-08-21 17:16:32 +00:00
Jacques Vidrine
dbdb228cf7 setprogname() should set __progname to the last component of the given
path.
2001-08-21 16:55:34 +00:00
Dima Dorfman
e6063dd1a6 Implement getpeereid(3), a front-end to the LOCAL_PEERCRED
socket option for the Unix domain.  It's weaker than the
socket option (this only returns the uid and gid, while the
socket opt. can return the entire group list), and is
implemented mostly for compatibility with OpenBSD.
2001-08-17 22:09:15 +00:00
Yaroslav Tykhiy
a2a0a4dc2a Use the ".Rv" mdoc(7) macro where appropriate.
Reviewed by:	ru
2001-08-14 14:20:35 +00:00
Ruslan Ermilov
753d686d34 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
Ruslan Ermilov
ed2879a5cf mdoc(7) police: s;BSD/OS;.Bsx; where appropriate. 2001-08-13 17:07:40 +00:00
Ruslan Ermilov
d013e3f544 mdoc(7) police: s/NetBSD/.Nx/ where appropriate. 2001-08-13 17:00:36 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Ruslan Ermilov
8af1452cf8 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
Ruslan Ermilov
c75526d5a0 mdoc(7) police: fixed the "new sentence" bogons. 2001-08-10 15:03:10 +00:00
Ruslan Ermilov
57e4378bf6 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
Maxim Sobolev
5d25d75662 Fix xrefs.
times.3:	gettimeofday(3) --> gettimeofday(2)
rc.conf.5:	isndn(8)	--> isdnd(8)
		idsnd(8)	--> isdnd(8)

MFC after:	2 weeks
2001-08-09 15:46:53 +00:00
Yaroslav Tykhiy
b1250632c5 Use the ``.Rv -std'' mdoc(7) macro in appropriate cases.
Reviewed by:	ru
2001-08-09 13:32:13 +00:00
Mike Heffner
785ead5062 typo: patched->matched 2001-08-09 00:34:57 +00:00
Ruslan Ermilov
6575e6daae mdoc(7) police: expand plain text xrefs. 2001-08-08 11:48:28 +00:00
Ruslan Ermilov
c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Ruslan Ermilov
f61004566c mdoc(7) police: markup nits. 2001-08-07 12:17:32 +00:00
Dima Dorfman
557b792532 varargs -> stdarg 2001-08-05 05:39:16 +00:00
Sheldon Hearn
86f478757a MFS: in HISTORY section, fix release number of first appearance 2001-08-01 12:15:21 +00:00
Sheldon Hearn
b47d4cf924 Fix broken Fn calls; Fn doesn't take a manual page section as an
argument.

Terminate the last sentence with a period.
2001-08-01 12:04:32 +00:00
Mark Peek
545d32087b Only pull in the MD files if they exist. This allows for progressive
implementation and compilation when bringing up a new architecture.
2001-07-31 16:34:52 +00:00
Jeroen Ruigrok van der Werven
6a0fc191fb FreeBSD now also defines EIDRM and uses it.
Inspired by PR:		22470
Which was submitted by:	Bjorn Tornqvist <bjorn@west.se>
MFC after:	1 week
2001-07-30 19:30:26 +00:00
Jeroen Ruigrok van der Werven
2341e86854 Remove bogus BUGS section.
FreeBSD _does_ define ENOMSG as per SVID when IPC_NOWAIT is set.

PR:		22470
Submitted by:	Bjorn Tornqvist <bjorn@west.se>
MFC after:	1 week
2001-07-30 19:25:16 +00:00
Thomas Moestl
d35bce02ee Correct the old length argument passed to sysctlbyname to be a pointer
to a size_t (not to an int).

MFC after:	2 days
2001-07-29 22:01:55 +00:00
Mike Heffner
75dc5f1a82 Rename the GLOB_MAXPATH flag of glob(3) to GLOB_LIMIT to be compatible
with NetBSD and OpenBSD. glob(3) will now return GLOB_NOSPACE with
errno set to 0 instead of GLOB_LIMIT when we match more than `gl_matchc'
patterns. GLOB_MAXPATH has been left as an alias of GLOB_LIMIT to
maintain backwards compatibility.

Reviewed by:	sheldonh, assar
Obtained from:	NetBSD/OpenBSD
2001-07-29 00:52:37 +00:00
Sheldon Hearn
745b20f712 The previous delta duplicated a significant amount of information
already found in the sigaction(2) manual.

As discussed with the committer of that delta, cross-reference the list
in sigaction(2) instead of duplicating the list of functions that are
safe for use within signal handlers.
2001-07-24 11:37:33 +00:00
Kris Kennaway
fd9139a04e Add the list of signal-handler safe functions here too, so people can
find it more easily

Obtained from:	OpenBSD
MFC After:	1 week
2001-07-24 08:26:37 +00:00
Ruslan Ermilov
97e1bac189 mdoc(7) police: fix markup. 2001-07-18 15:55:34 +00:00
Kris Kennaway
54b8fe08cf Remove unnecessary #include <stdlib.h>
Obtained from:	NetBSD
MFC After:	1 week
2001-07-16 04:48:28 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
David E. O'Brien
8dfd7bcddf MFS: add the FreeBSD history. 2001-07-10 00:12:50 +00:00
David E. O'Brien
6e6c8a08c8 Give the FreeBSD history also. 2001-07-10 00:11:00 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Ruslan Ermilov
3d1455a39d mdoc(7) police: compact VFCF_ list. 2001-07-04 10:42:03 +00:00
Dima Dorfman
f9eeb822d0 mdoc(7) police: fix spacing issue
Submitted by:	ru
2001-07-03 21:16:34 +00:00
Dima Dorfman
ff5f0dbc41 Fix a one-byte overrun.
PR:		28472
Submitted by:	David Xu <davidx@viasoft.com.cn>
Obtained from:	OpenBSD
2001-06-28 21:50:53 +00:00
Dima Dorfman
9351f51fd8 getcwd(3) is defined by POSIX, not ISO C.
Approved by:	bde
2001-06-28 19:27:02 +00:00
Dima Dorfman
9a66daa5d4 Document the existing vfc_flags.
PR:		25837
Submitted by:	Tony Finch <dot@dotat.at>
2001-06-28 06:50:19 +00:00
Dima Dorfman
a910f192bb Remove duplicate words. 2001-06-24 01:34:38 +00:00
Dima Dorfman
12985df355 Fix a grammar bogon. 2001-06-20 22:03:10 +00:00
Garrett Wollman
3f22a03fa6 Fix spelling of `errno' and add cross-references. 2001-06-18 22:26:31 +00:00
Garrett Wollman
5813675eed Document _SC_IOV_MAX. Add cross-references to pathconf(2), confstr(3), and
getconf(1).  This document still needs to be sorted and to have other missing
parameters described.
2001-06-18 22:18:08 +00:00
Garrett Wollman
37336173d3 After one too many PRs on the subject, bite the bullet and define IOV_MAX
and its associated constants.  Implement _SC_IOV_MAX in the usual way.
Be a bit sloppy about the namespace question; this should get cleared up
in time for 5.0.

MFC after:	1 month
2001-06-18 20:24:54 +00:00
David Malone
75328eca8d If the username we are trying to look up in the db files won't fit into
the buffer then act like it doesn't exist. The buffer is always big enough
for any valid username.

PR:		27860
Reviewed by:	nectar
2001-06-18 16:09:24 +00:00
Ruslan Ermilov
589ee357a4 Complete prototype for fts_compar. 2001-06-13 14:59:57 +00:00
Ian Dowse
f9f6897972 Make the non-threaded stub for pthread_sigmask() a no-op instead
of calling sigprocmask(). This matches the behaviour of thr_sigsetmask()
on Solaris; _pthread_sigmask_stub was added purely for compatibility
with Solaris (for TI-RPC), so it might as well do the same thing.

This fixes the problem where client RPC calls ignored all signals
for the complete duration of the RPC. This behaviour is currently
necessary in the threaded case due to locking issues, but was never
intended to occur in non-threaded programs.

Reviewed by:	deischen
2001-06-11 23:18:22 +00:00
Dima Dorfman
4088069c3a Xref dladdr(3).
Requested by:	-hackers
2001-06-08 22:50:33 +00:00
Kris Kennaway
93a8551831 Fix another unprotected instance of chdir() by extending the
fts_safe_changedir() function and using that instead for both of the
chdir()s.

Partially submitted by:	Todd Miller <millert@OpenBSD.org>, bde
2001-06-01 21:53:50 +00:00
Kris Kennaway
fdeb0156dd When doing the chdir("..") in the !FTS_NOCHDIR case, stat() after we get
there and compare the inode and device numbers to the values we remember,
to guard against the directory having been moved around in the meantime.

Reported by:	Nick Cleaton <nick@cleaton.net>
2001-05-30 20:35:44 +00:00
Eric Melville
2de2196026 Add warnings about trusting user-supplied data.
Reviewed by:	ru
Approved by:	murray
Obtained from:	OpenBSD
2001-05-25 20:42:40 +00:00
Ruslan Ermilov
d4aac95ca2 Fix the range of the returned value.
PR:		docs/27446
Submitted by:	Tadayuki OKADA <tadayuki@mediaone.net>
2001-05-23 12:37:50 +00:00
Ruslan Ermilov
58ceb60878 Suppress compiler warning by adding a type cast. 2001-05-17 12:51:43 +00:00
Dima Dorfman
cd18ccdc30 Introduce getprogname(3) and setprogname(3) library calls. These get
and set __progname, respectively.

Discussed on:	-arch (Feb 2001), -audit
Reviewed by:	-audit
Approved by:	kris
Obtained from:	(mostly) NetBSD
2001-05-15 23:41:01 +00:00
David E. O'Brien
5e6220d9d0 * include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
2001-05-02 23:56:21 +00:00
Mark Murray
e16138fead Compensate for header dethreading. 2001-05-01 09:30:02 +00:00
Joerg Wunsch
b2bcd87e4f Fix directory reads of MNT_UNION mounts, where entries present in both
layers would be displayed twice.

PR:		bin/26498
Submitted by:	Olliver Fromme <olli@secnetix.de>
2001-04-23 10:01:38 +00:00
Ruslan Ermilov
eb0838029f mdoc(7) police: normalize .Nd. 2001-04-18 15:54:10 +00:00
Ruslan Ermilov
2efb80a813 mdoc(7) police: fix markup. 2001-04-18 15:43:06 +00:00
Kris Kennaway
3d09054934 Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.

Example usage:

printf(fmtcheck(user_format, standard_format), arg1, arg2);

checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format.  If they differ,
standard_format is used instead to avoid potential crashes or security
violations.

Obtained from:  NetBSD
Reviewed by:    -arch
2001-04-17 07:59:52 +00:00
Daniel Eischen
54fd7f685f To be consistent, use the __weak_reference macro from <sys/cdefs.h>
instead of #pragma weak to create weak definitions.  This macro is
improperly named, though, since a weak definition is not the same
thing as a weak reference.

Suggested by:	bde
2001-04-10 04:11:50 +00:00
Ruslan Ermilov
6a5e9ec940 mdoc(7) police: add missing .Pa call. 2001-04-04 09:52:28 +00:00
Peter Wemm
487dbd927f Mostly pick up OpenBSD's rev 1.14 by deraadt@ and millert@.
I've left out a couple of unused args between internal functions.
Use MAXPATHLEN, not MAXPATHLEN + 1 in a couple of places.
Pass a pointer to the end of the target filename space.
2001-03-28 23:55:51 +00:00
Peter Wemm
27d52f6943 OpenBSD's g_Ctoc() returned a false error when the target buffer was
exactly the right size.  Do it differently - pass a length rather than an
end-of-string+1 pointer as this is more convenient anyway.  Get rid of
the bogus +1's.
2001-03-28 10:56:11 +00:00
Peter Wemm
76e2bc010d Fix g_Ctoc() interface, approximately based on OpenBSD's recent changes.
Also, set gl_pathv to NULL after we free it, especially when dealing
with realloc failures.

Obtained from: OpenBSD
2001-03-28 09:53:16 +00:00
Chris Timmons
5c620e2dad Document LOG_CONSOLE. 2001-03-27 19:55:53 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Alfred Perlstein
8f15078110 give the "netgrent" functions a home in netdb.h 2001-03-27 09:49:03 +00:00
Peter Wemm
32e479705a This is kind of a hack, but it should work. Currently, world is broken
because libc/rpc/key_call.c references uname(), and ps/print.c also
defines uname(), and ps is linked statically.  This leads to a symbol
clash.  The userland uname(3) kinda sucked anyway as the hostname
etc was too short.  And since the libc rpc interface now uses
the utsname.nodename which gets truncated, I was tempted into doing
something about it.  Create a new userland uname function, called
__xuname() which takes an extra argument that allows you to change
the size of the fields.  uname() becomes a static inline function
in sys/utsname.h that passes the extra argument in.  struct utsname
has its field members expanded by default now in userland.
We still provide a 'uname' externally linkable function for things
that either think that they ``know'' the utsname format and assume
32 character strings and bypass the include file, or objects that
are linked against old libcs.  ie: just about every plausible
case that I can think of is covered.  Should we ever change the
default lengths again, a libc major bump should not be required
as the size is now passed to the function.

XXX the uname(2) in the kernel is for FreeBSD 1.1 binary compatability!
All the uname(3) functions that are exported to userland are actually
implemented in libc with sysctl.  uname(1) uses sysctl directly and
does not call uname(3).

PR:		bin/4688
2001-03-24 04:40:49 +00:00
Jonathan Lemon
bae8632f82 Introduce the GLOB_MAXPATH flag, which allows the user to limit the
number of paths which glob(3) will return.  Remove the hardcoded limit
from the last commit, which restores the previous unbounded behavior.

Document the new flag in the manual page.
2001-03-19 19:10:06 +00:00
Alfred Perlstein
8360efbd6c Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

  Bring in required TLI library routines to support this.

  Since we don't support TLI we've essentially copied what NetBSD
  has done, adding a thin layer to emulate direct the TLI calls
  into BSD socket calls.

  This is mostly from Sun's tirpc release that was made in 1994,
  however some fixes were backported from the 1999 release (supposedly
  only made available after this porting effort was underway).

  The submitter has agreed to continue on and bring us up to the
  1999 release.

  Several key features are introduced with this update:
    Client calls are thread safe. (1999 code has server side thread
    safe)
    Updated, a more modern interface.

  Many userland updates were done to bring the code up to par with
  the recent RPC API.

  There is an update to the pthreads library, a function
  pthread_main_np() was added to emulate a function of Sun's threads
  library.

  While we're at it, bring in NetBSD's lockd, it's been far too
  long of a wait.

  New rpcbind(8) replaces portmap(8) (supporting communication over
  an authenticated Unix-domain socket, and by default only allowing
  set and unset requests over that channel). It's much more secure
  than the old portmapper.

  Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
  to support TI-RPC and to support IPV6.

  Umount(8) is also fixed to unmount pathnames longer than 80 chars,
  which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00
Jonathan Lemon
daa4742e72 Bump MAX_GLOBENTRIES up to 16384, so it is a power of two. Add
some comments explaining that this is an arbitrary limit.

Requested by:  jkh
2001-03-16 19:05:20 +00:00
Jonathan Lemon
813c96dbd7 Limit the number of paths that glob can return to MAX_GLOBENTRIES, which
is currently set to 10000.  This is intended to prevent glob from running
amok when a highly recursive path is provided (such as "../*/../*/../*/...")

Reviewed by: Diane Bruce <db@db.net>, jhb
2001-03-15 18:50:32 +00:00
Brian Somers
ad5a84f5eb Mention that MAXHOSTNAMELEN includes space for the NUL. 2001-03-15 08:35:53 +00:00
David Malone
aa9ab917d7 Use the right format string for printing ULONG_MAX. 2001-03-05 11:58:12 +00:00
David E. O'Brien
d2357f9842 Fix style breakage in rev 1.3 2001-03-05 09:33:08 +00:00
David E. O'Brien
8bb47e4083 Fix style bug that was introduced. 2001-03-05 09:21:44 +00:00
Ruslan Ermilov
fdc1fef594 Use ``.St -p1003.[12]''. 2001-02-26 16:12:39 +00:00