Commit Graph

2474 Commits

Author SHA1 Message Date
Archie Cobbs
42cebaa5c0 Fix bugs in the handling of > 8 positional arguments:
- The stack was getting smashed by __grow_type_table()
- reallocf() was being called with the wrong pointer
- The maximum argument number was being incorrectly computed

PR:	misc/23521
2001-01-06 20:48:00 +00:00
Alexander Langer
e2a2e8c7e0 gethostbyname2() is able to lookup AF_INET6.
PR:		23823
Noticed by:	Andrew Arensburger <arensb@ooblick.com>
2001-01-06 12:48:43 +00:00
David E. O'Brien
2ad094d8bc Fix SCCS id string abuse I introduced. 2001-01-02 09:10:14 +00:00
Daniel Eischen
fc1d3c6dfb Change the interface of getlogin_r to return an int. The former
interface was based on a draft version of POSIX whereas the final
(1996) version of POSIX specified that the error is returned.

While I'm here, fix getlogin_r so that it works for more than just
the first time it's called.

Reviewed by:	wes, wollman (man page)
2001-01-01 13:29:19 +00:00
Ben Smithurst
7e7a6ec033 Make it a bit clearer that asprintf doesn't actually "return" a pointer in
the normal sense of the word, but does it through one of its arguments which
is a pointer to a pointer.

PR:		23717
Submitted by:	phk
2001-01-01 05:19:52 +00:00
Brian Feldman
429d49129b Fix a tailq conversion bug that resulted in, e.g., nvi crashing upon
quitting every time.  The way to free a CIRCLEQ was to loop until
the current == current->head, but the way to free a TAILQ is to loop
until current->head == NULL.

In any case, the CORRECT way to do it is a loop of TAILQ_EMPTY() checks
and TAILQ_REMOVE()al of TAILQ_FIRST().  This bug wouldn't have happened
if the loop wasn't hard-coded...

There may be more bugs of this type from the conversion.
2000-12-30 16:10:32 +00:00
Poul-Henning Kamp
fabacd3a11 Use TAILQ instead of CIRCLEQ. 2000-12-29 20:25:01 +00:00
Ruslan Ermilov
672062062d Fixed typo not fixed in previous revision. 2000-12-29 14:36:05 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Ben Smithurst
5ff8bb1602 Link stringlist.3 to sl_{add,find,free,init}.3 2000-12-27 20:00:01 +00:00
Jacques Vidrine
b048419e0d Fix mostly harmless typo:
if (data);
            free(data);

Discovered by:	emacs cc-mode
2000-12-17 21:10:41 +00:00
Ruslan Ermilov
88544700ca mdoc(7) police: added missing .Os call. 2000-12-14 13:58:15 +00:00
Ruslan Ermilov
ed40311694 mdoc(7) police: removed history info from the .Os FreeBSD call. 2000-12-14 11:52:05 +00:00
David E. O'Brien
515f933b8b #endif should not have a non-comment token after it.
GCC 2.97 (snapshot) complains about this.
2000-12-13 08:59:18 +00:00
Robert Watson
6fd0cf5eb0 o Introduce a pile more documentation about capabilities, including
identification and descriptions of most capabilities, current inheritence
  rules, etc.  More to follow.

Reviewed by:	sheldonh
Obtained from:	TrustedBSD Project
2000-12-11 15:25:49 +00:00
Ruslan Ermilov
a2fd3702a3 mdoc(7) police: use canonical form of .Dd macro. 2000-12-11 15:15:20 +00:00
Daniel Eischen
10d1cba0bf Move telldir position recording type definitions and prototypes
to "telldir.h" in order to prevent namespace pollution in
<dirent.h> (which was including <sys/queue.h>).

Add $FreeBSD$ to rewinddir.c and seekdir.c.
2000-12-11 04:00:36 +00:00
David E. O'Brien
1a37aa566b Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
Alexander Langer
f5009c10dc strunvis(3) and unvis(3) are the same files. 2000-12-08 12:35:06 +00:00
Alexander Langer
e7db1cd82e There are four types of encoding now, not three. Most of them use the
backslash as a special char, but not all.
2000-12-08 12:17:53 +00:00
Ruslan Ermilov
f2b6be9022 Upgrade to groff 1.16.1. 2000-12-06 11:38:34 +00:00
Ruslan Ermilov
bcec0cefc4 Back this out, we apparently have the ipfw(4). 2000-12-06 06:50:24 +00:00
Ruslan Ermilov
4daefb4d8e ipfw(4) -> ipfw(8). 2000-12-06 06:48:28 +00:00
Daniel Eischen
ef80a53495 Cleanup XXXdir functions to eliminate global hash table of
telldir positions.  This will allow (future) locking on a
per-DIR basis (for MT-safety).  For now, this change does
the following:

  o Remove the hash table from telldir.c.  Recode to use queue
    macros.

  o Remove 'const' from 'telldir(const DIR *)'.

  o Remove 'register' variables as suggested in a recent
    thread.

No response from: -current
2000-12-06 03:15:49 +00:00
John Baldwin
04cb9bbb1e Move the ipfw(4) xref to the description of LOG_SECURITY instead of
LOG_UUCP.

PR:		docs/23302
Submitted by:	cshumway
2000-12-05 20:30:28 +00:00
Hajimu UMEMOTO
eb74b99618 - __ivaliduser_sa() was introduced for forthcoming IPv6 support to lpd
- iruserok_sa() and __ivaliduser_af() were re-organized to use
  __ivaliduser_sa()
- __icheckhost() was re-written to use getaddrinfo() instead of
  getipnodebyname()
- better handling of multiple destination addresses in rcmd()

These changes were basically taken from KAME and changed to fit our
rcmd.c.

Obtained from:	KAME
2000-12-04 18:02:12 +00:00
Ruslan Ermilov
687a7e07cf mdoc(7) police: fix formatting errors in rev 1.27. 2000-12-04 08:11:50 +00:00
John Polstra
882cdc116d When recording the original arguments, stop short if we encounter
a NULL argument.  Some programs change the contents of the argv
array, typically to remove some special arguments.  They shorten
argv by storing a NULL where an argument pointer used to be.  Such
programs core dumped if they called setproctitle(), because it
would try to apply strlen() to a NULL pointer.
2000-12-04 01:45:57 +00:00
John Polstra
4113386c62 When recording the original arguments, don't (ab)use "nargc" for
iterating over the arguments.  Doing so wipes out the value which
is about to be stored into the ps_strings structure.
2000-12-04 01:26:29 +00:00
Matthew Dillon
fbf8638995 Add warning on file-fragmentation issues related to MAP_NOSYNC 2000-12-03 20:17:36 +00:00
Jake Burkholder
4231c165f7 Remove last vestiges of thr_sleep and thr_wakeup from libc. 2000-12-02 05:58:03 +00:00
Garance A Drosehn
bbe8edb0ac Fix some error-handling logic so that ferror is called before fclose,
instead of immediately after the fclose.  The previous logic did work
on freebsd, but is somewhat risky practice (and causes trouble when
porting to other OS's).

PR:		bin/22965
Reviewed by:	Garrett Wollman
2000-12-02 00:07:56 +00:00
Alfred Perlstein
070f57f520 document O_NOFOLLOW and O_FSYNC flags to open 2000-11-29 04:08:49 +00:00
John Baldwin
9a51cfcde1 Prefix the register argument of indirect 'jmp's with a * to make gas 2.10.x
happy.
2000-11-28 22:59:14 +00:00
Matthew Hunt
fecae3493c The parameter that contains valid options is "optstring", not "optarg". 2000-11-28 22:06:17 +00:00
Maxim Sobolev
1447779521 Add reference to elf(5) in addition to already mentioned a.out(5) and add both
elf(5) and a.out(5) into `SEE ALSO' section.
2000-11-27 15:18:25 +00:00
David E. O'Brien
07a9238fc1 Note that the `fmt' parameter is a printf()-like string. 2000-11-26 23:33:40 +00:00
Poul-Henning Kamp
798c1fd885 Make it possible to override the function which writes messages to
stderr in case of warnings and errors.

Rename malloc_options to have a leading underscore, I belive I have been
told that is more correct namespace wise.
2000-11-26 10:30:18 +00:00
Kris Kennaway
4b5e6561d3 sprintf -> snprintf 2000-11-26 09:05:40 +00:00
Sheldon Hearn
b97552bf54 Remove the only hard sentence break in the file. 2000-11-24 10:48:02 +00:00
Ruslan Ermilov
454409ad22 Eliminate groff(1) warnings. 2000-11-24 09:33:37 +00:00
Ruslan Ermilov
c23155a43a mdoc(7) police: Er macro usage cleanup. 2000-11-22 16:02:00 +00:00
Ruslan Ermilov
725ab6287f log 2000-11-22 09:23:54 +00:00
Jonathan Lemon
ee85cf8bb2 Fix a logic reversal: the RFFDG flag must be unset in order to share
a file descriptor table.  (Thanks to Alan Cox)

Clarify the fact that the changelist and eventlist can be shared.
2000-11-21 22:40:59 +00:00
Jeroen Ruigrok van der Werven
02e1f97870 Clarify the time parameter of the kevent() system call.
Inspired by PR:		21708
Submitted by:		Ronald F. Guilmette <rfg@monkeys.com>
Reviewed by:		jlemon
2000-11-21 15:22:36 +00:00
Sheldon Hearn
067c7f48de Fix hard sentence break introduced in rev 1.7. 2000-11-20 16:25:10 +00:00
Sheldon Hearn
8e770e7803 Add a period missing from rev 1.13. 2000-11-20 16:19:37 +00:00
Sheldon Hearn
3efaff6731 Remove blank line introduced in rev 1.13. 2000-11-20 16:18:45 +00:00
Ruslan Ermilov
a304568fd9 mdoc(7) police: fixed warnings. 2000-11-20 14:22:41 +00:00
Ruslan Ermilov
432108fa2a mdoc(7) police: fixed warning. 2000-11-20 14:18:21 +00:00
Ruslan Ermilov
563f6bde6e mdoc(7) police: Nm -> Fn where appropriate. 2000-11-20 14:11:46 +00:00
Ruslan Ermilov
3b8ecdbbbe mdoc(7) police: use the new features of the Nm macro. 2000-11-20 14:08:07 +00:00
Kris Kennaway
b05092e25a MAXPATHNAMELEN -> MAXPATHLEN
Submitted by:	ianm@kashmir.cit.nepean.uws.edu.au via OpenBSD
Obtained from:	OpenBSD
2000-11-19 11:29:58 +00:00
Kris Kennaway
7853d5d839 Don't suggest people use getpid() to construct temporary filenames;
point them to mkstemp() instead.

Obtained from:	OpenBSD (based on)
2000-11-19 10:30:42 +00:00
Kris Kennaway
dc3f2db745 Update the documentation to describe the new mktemp() family behaviour.
Also notes that mkstemp() first appeared in 4.4BSD (change obtained
from OpenBSD)

Reviewed by:	sheldonh
2000-11-19 10:21:32 +00:00
Ruslan Ermilov
251c176f41 mdoc(7) police: use certified section headers wherever possible. 2000-11-17 11:44:16 +00:00
Ruslan Ermilov
55d8033fb4 Replace a dagger' sign with a double dagger' one.
The former looks ugly on grotty(1) devices.
2000-11-16 11:22:42 +00:00
Ben Smithurst
cb17760de7 Remove fullstops from the end of .Xr lines in SEE ALSO section. 2000-11-15 14:40:14 +00:00
Ruslan Ermilov
855ac919f1 Convert this from -man to -mdoc. 2000-11-14 16:47:54 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Sheldon Hearn
b03c558b5a Change [Ii]t's to "It is" and "its" as appropriate. 2000-11-14 07:36:51 +00:00
Sheldon Hearn
d2d9aa87f5 Whitespace only: remove hard sentence breaks introduced in previous
commit and use a paragraph marker (Pp) instead of a blank line.
2000-11-14 07:35:02 +00:00
David E. O'Brien
fe17fef5d2 Bump the shared lib version. There seems to have been an incompatible
change committed to RELENG_4 where a bump there is now necessary.
We've got to go before RELENG_4 does.
2000-11-14 02:46:23 +00:00
Jacques Vidrine
0634de0c1f Fix bug introduced in previous commit: users obtained via compat mode
had uid, gid set to 0 if not otherwise specified!

Submitted by:	eivind
2000-11-13 21:22:50 +00:00
Nik Clayton
d4c5a1f678 Create the links for the reentrant time functions.
PR:		 docs/22644
Submitted by:	 andrew@ugh.net.au
2000-11-12 16:17:53 +00:00
Andrzej Bialecki
2de021a4bc Correct description of KERN_PROC. Add description of KERN_PROC_ARGS. 2000-11-11 16:12:30 +00:00
Kris Kennaway
f1303ab4b2 Increase the size of the mktemp() filename space by dropping the PID from
the encoding and using the character set [a-zA-Z0-9]. This gives a total
of 62^6 = 56800235584 possible temporary filenames for the usual default
invocation of 6 X's (compared to as few as 52 possibilities for the
previous algorithm where up to 5 characters were wasted by the PID).

Update some apparently bitrotten comments to reflect reality.

Audited by:	eivind, freebsd-audit
Reviewed by:	freebsd-current (a while ago)
Originally submitted by:	Peter Jeremy <Peter.Jeremy@alcatel.com.au>
2000-11-10 23:27:55 +00:00
Alfred Perlstein
589d1374d4 remove outdated bugs, we actually do have aio_cancel support
as well as support for the field aio_offset in the aiocb structure.
2000-11-10 20:57:05 +00:00
Jacques Vidrine
61a33b7ca5 Fix passwd entry `prototypes' in compat mode. I broke this in revision
1.55 when importing nsswitch from NetBSD.

Reported by:	Naoki Kobayashi <shibata@geo.titech.ac.jp>
2000-11-10 19:11:14 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
David E. O'Brien
d045c51555 Use size_t rather than a 16-bit data type fo the length.
PR:	9350
Submitted by:	Danny J. Zerkel <dzerkel@columbus.rr.com>
2000-11-07 22:19:23 +00:00
Ruslan Ermilov
a72b09f0aa Fixed typos. 2000-11-06 15:46:57 +00:00
Kris Kennaway
ce41d42aeb More secure temporary filename. This needs to be revisited to use
mkstemp().
2000-11-02 10:14:09 +00:00
Sheldon Hearn
22c8b05f4e Fix nits introduced in rev 1.9:
Remove single-space hard sentence break.
	Mark errno up as a Variable (Va).
2000-10-30 19:43:30 +00:00
Jeroen Ruigrok van der Werven
f99e2564c2 Replace old sigaction struct declaration with the new one as present
in <sys/signal.h>.

This might be a shortterm fix until the manpage is updated towards
POSIX terminology.  And maybe not...

PR:		21542
Submitted by:	Ronald F. Guilmette <rfg@monkeys.com>
2000-10-30 14:27:18 +00:00
Jeroen Ruigrok van der Werven
cc5966e584 Correct incorrect information about the PATH used for exec*() calls.
PR:			21990
Partially submitted by:	Gerhard Sittig <Gerhard.Sittig@gmx.net>
2000-10-30 13:39:23 +00:00
Jeroen Ruigrok van der Werven
5714e85318 Whitespace only change: trim trailing whitespace. 2000-10-30 13:23:19 +00:00
Munechika SUMIKAWA
725f35a7e5 Fix memory leak.
Obtained from:	KAME
2000-10-29 16:10:48 +00:00
Eivind Eklund
e68aef6429 Back out previous commit (MLINK malloc.conf.5 -> malloc.3).
This did not work correctly with whatis(1).

Issue brought up by:	mpp
2000-10-29 13:20:24 +00:00
Eivind Eklund
8b746a4d67 Add link malloc.conf.5 -> malloc.3 2000-10-29 09:59:35 +00:00
Mike Pritchard
beb64fb5ac Style & grammar fixes.
PR:		docs/22374, docs/13020
2000-10-28 18:37:37 +00:00
Hajimu UMEMOTO
7363d0e795 defined HAVE_IFM_DATA for (free|net|open)bsd
Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
Obtained from:	KAME Project
2000-10-28 17:54:19 +00:00
Jacques Vidrine
580ef74769 Explicitly initialize _pw_passwd. 2000-10-27 18:27:07 +00:00
Hajimu UMEMOTO
4a5af3d0cc Make RES_OPTIONS=inet6 work.
Basically PR22196, but slightly modified.

PR:	bin/22196
2000-10-27 12:34:52 +00:00
Andrey A. Chernov
a91655018d For %c replace reference to asctime(3) with ctime(3) from which %c genetically
originates
2000-10-26 22:11:11 +00:00
Andrey A. Chernov
aabf7d45a4 Treat c_fmt field as compatibility placeholder 2000-10-26 16:20:57 +00:00
Andrey A. Chernov
c877745700 Force "%c" to be ctime-compatible
Submitted by:	ru
2000-10-26 16:07:04 +00:00
Andrey A. Chernov
f0b22c7b6a Force %c to be "%a %Ef %T %Y" to eliminate problems with bad c_fmt
Submitted by:	ru
2000-10-26 14:22:41 +00:00
Andrey A. Chernov
a2e0cef1d5 Describe %c better
Submitted by:	ru (with modifications)
2000-10-24 15:37:48 +00:00
Nick Hibma
40a7a362c7 Correct the text on RETURN VALUES. 2000-10-20 00:27:56 +00:00
Doug Rabson
84dc1ae7fc Return zero from setjmp() and _setjmp() for now. 2000-10-16 16:51:50 +00:00
Doug Rabson
6b7d87d9e1 Fix a couple of dumb mistakes. 2000-10-16 16:48:48 +00:00
Marcel Moolenaar
603fa52221 Fix RAW dependency violation on p6 between cmp and mov. 2000-10-15 20:33:41 +00:00
Doug Rabson
94fb7ad620 Initial libc port for ia64. 2000-10-14 17:01:12 +00:00
John W. De Boskey
6bf02e51da Document the ptrace() PT_STEP request.
Add references to the newly added hardware debug register
support functions i386_clr_watch(3) and i386_set_watch(3).

Reviewed by:    Sean Eric Fagan <sef@kithrup.com>
                and no other response to the review request.
2000-10-14 04:01:39 +00:00
Robert Watson
36fa62c01b o Introduce cap_from_text() and cap_to_text() implementations.
Reviewed by:	green
Obtained from:	TrustedBSD Project
Security audited by:	imp, green
2000-10-13 18:24:58 +00:00
Robert Watson
ab024bb02e o Simplify capability types away from an array of ints to a single
u_int64_t flag field, bounding the number of capabilities at 64,
  but substantially cleaning up capability logic (there are currently
  43 defined capabilities).

o Heads up to anyone actually using capabilities: the constant
  assignments for various capabilities have been redone, so any
  persistent binary capability stores (i.e., '$posix1e.cap' EA
  backing files) must be recreated.  If you have one of these,
  you'll know about it, so if you have no idea what this means,
  don't worry.

o Update libposix1e to reflect this new definition, fixing the
  exposed functions that directly manipulate the flags fields.

Obtained from:	TrustedBSD Project
2000-10-13 17:12:58 +00:00
Robert Watson
42acb11991 o Update BUGS entry to indicate in a more precise manner the implementation
status of capabilities (library is complete, kernel work is maintained
  outside the tree).

Obtained from:	TrustedBSD Project
2000-10-12 17:58:14 +00:00
Jason Evans
1ae8b96572 Fix pthread cancellation point propagation. 2000-10-12 04:29:44 +00:00
Robert Watson
c0e01b9036 o Introduce a MAINTAINER entry for libposix1e, since it is actively
developed and maintained.
2000-10-02 23:41:19 +00:00
Jacques Vidrine
534f2a9dad Use issetugid instead of comparing get[ug]id and gete[ug]id.
Suggested by:	Don Lewis <Don.Lewis@tsc.tdk.com>
2000-09-30 17:29:54 +00:00
Jacques Vidrine
b27eae53e9 Ignore HESIOD_CONFIG and HES_DOMAIN environmental variables for
set-user-ID and set-group-ID programs.

Suggested by:	Danny Braniss <danny@cs.huji.ac.il>
2000-09-29 12:56:33 +00:00
Peter Wemm
5edc357219 Add man pages for mod*(2). Shamelessly cut/pasted from the kld*(2) man
pages by Chris Costello.
2000-09-28 22:39:59 +00:00
Alexey Zelkin
e3950d8e0e Fix typo
PR:		misc/21596
Submitted by:	TOGAWA Satoshi <toga@puyo.org>
2000-09-27 18:24:31 +00:00
Jun-ichiro itojun Hagino
45181a751b off-by-1 error in string length validation
From: Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>
2000-09-25 23:04:36 +00:00
Robert Watson
374c6c0f71 o Minor whitespace, comment cleanups
o Removal of unneeded enum
o Removal of commented out debugging printf()'s.

Obtained from:	TrustedBSD Project
2000-09-22 16:36:04 +00:00
Eivind Eklund
11ab3fc7cb Better documentation of append mode. This should have gone in -current
directly.   Now also .Xr fseek reference.

Prodded by:	sheldonh
2000-09-22 12:55:36 +00:00
Ralf S. Engelschall
a98588331c Resurrect documentation of chflags(2)'s SF_ARCHIVED.
PR:		21428
Reviewed by:	ben
2000-09-22 06:58:22 +00:00
Brian S. Dean
9d90941a83 Add a couple of debug register helper functions to assist in setting
and clearing watchpoints.

Reviewed by:	jwd@FreeBSD.org, -hackers@
2000-09-21 17:07:27 +00:00
Brian Somers
f241969910 Oops, un-spam this file - the last commit was an accident.
Pointed out by: phk
2000-09-20 06:16:23 +00:00
Brian Somers
b1daa1b9db Only realloc() environ if we're sure that we know where it came from.
The recent problems with sshd were due to sshd reassigning
`environ' when setenv() thinks it owns it.  setenv() subsequently
realloc()s the new version of environ and *boom*
2000-09-20 03:05:37 +00:00
Robert Watson
fa1ffad7e1 o Whitespace reduction appled to FreeBSD CVS ID
Obtained from:	TrustedBSD Project
2000-09-19 19:20:21 +00:00
Robert Watson
689f3ef9fe o General warning fixing commit
- Include <stdlib.h> and <string.h> as needed for prototypes
    - Remove unneeded "error" variables
o Make cap_init() use cap_clear() instead of bzero()

Obtained from:	TrustedBSD Project
2000-09-19 19:14:31 +00:00
Robert Watson
579f01fcfe o Add cap_from_text(3) and cap_to_text(3) man pages.
o Implementations will remain in the seperately distributed capability
  patch until the cap_t type changes are synchronized.

Obtained from:	TrustedBSD Project
2000-09-19 19:04:47 +00:00
Robert Watson
d94de3e80f o EACCES is not a possible error for acl_from_text(), so fix
acl_from_text.3
o Minor whitespace cleanups relative to the TrustedBSD tree to reduce
  content-free differences.

Obtained from:	TrustedBSD Project
2000-09-19 18:58:28 +00:00
John Polstra
7f244df88e Document RTLD_DEFAULT and the search algorithm used for resolving
undefined symbols.
2000-09-19 04:28:34 +00:00
John Polstra
07f643a52b Make a somewhat unsatisfactory attempt to describe the effects of
the RTLD_GLOBAL and RTLD_LOCAL flags which can be passed to dlopen().
2000-09-19 04:02:05 +00:00
Robert Watson
9f3aa35641 o cap_set_flag() was not correctly clearing capabilities when value
was CAP_CLEAR.

Obtained from:	TrustedBSD Project
2000-09-19 00:10:39 +00:00
Poul-Henning Kamp
3cea595248 Pickup SPECNAMELEN from <sys/param.h> and use it.
A missing _PATH_DEVDB ("/var/run/dev.db") is not cause for a warning
anymore, the file is effectively optional these days.
2000-09-16 21:58:53 +00:00
Paul Saab
0c893d623c Change from using poll(2) to kqueue/kevent when waiting for a DNS
response to return.  This will stop processes waiting on DNS requests
from being woken up when a select collision occurs.  This was tested
on mx1.FreeBSD.org (outgoing mail for the FreeBSD.org mailing
lists.)

Reviewed by:	jlemon, peter
2000-09-12 11:37:20 +00:00
Jacques Vidrine
6737f02e97 Set h_errno when an error is encountered.
PR:		bin/21092
Submitted by:	Alexander Kabaev <ak03@gte.com>
2000-09-10 19:06:05 +00:00
Poul-Henning Kamp
8d25eb2c3a Add code to devname(3) so it can find the names of devices which
were not present when dev_mkdb(8) was run.

First the dev_mkdb(8) database is searched, this caters for non-DEVFS
cases where people have renamed a device.

If that fails we ask the kernel using sysctl kern.devname if the device
driver has put a name in the dev_t.  This covers DEVFS cloned devices.

If that also fails we format a string which isn't entirely useless.
2000-09-09 11:39:59 +00:00
Andrey A. Chernov
86797bf956 Prevent buffer overflow if NLSPATH is too long 2000-09-08 11:42:37 +00:00
Kris Kennaway
b777873ec1 Disallow '/' characters in LC_* environment variables which might
be used to point to a bad locale file. This is only believed to be a
minor security risk - the only risk is if some program uses the result
of a localized string as a format specifier in a vulnerable function
like sprintf(). No such code is believed to exist in the FreeBSD base
system, although it is possible that badly written third party code
would do that.

Submitted by:	imp
Approved by:	ache
2000-09-08 07:29:48 +00:00
Jacques Vidrine
cb0600bd54 Fix getipnodebyname(3) bug.
Submitted by:	ume
2000-09-07 02:18:22 +00:00
Jacques Vidrine
248aee623c Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
  functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
    . getgrent, getgrnam, getgrgid
    . getpwent, getpwnam, getpwuid
    . getusershell
    . getaddrinfo
    . gethostbyname, gethostbyname2, gethostbyaddr
    . getnetbyname, getnetbyaddr
    . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc.  rc.network has been modified
  to warn that host.conf is no longer used at boot time.  In addition, if
  there is a host.conf but no nsswitch.conf, the latter is created at boot
  time from the former.

Obtained from:	NetBSD
2000-09-06 18:16:48 +00:00
Andrey A. Chernov
60cff0a75c Add .El 2000-09-06 16:52:01 +00:00
Andrey A. Chernov
89817a4122 Document %-macros and NLSPATH better. 2000-09-05 19:14:34 +00:00
Andrey A. Chernov
f3ed913592 Fully implement NLSPATH processing as described in SUSv2 2000-09-05 14:04:21 +00:00
Alexey Zelkin
316321ebdf Oops! don't set errno to ENOMEM explicitly if malloc() failed.
Found by:	ache
2000-09-05 12:23:08 +00:00
Peter Wemm
7aa1d9cd4a Remove the SIGSYS handler and wrapper around the __getcwd() syscall.
It was kinda silly since the sigaction() syscall that it used to setup
the handler is more recent than __getcwd(), therefore it was useless
as the wrapper would have died before even getting as far as __getcwd(2).

Reminded by:	bde
2000-09-05 09:35:36 +00:00
Peter Wemm
8cae7cc3d6 Yank out the NOPOLL conditionals. libc_r no longer needs it, and this
library depends on other things that come *way* later than poll() now
(sigset size changes in particular)
2000-09-04 21:28:16 +00:00
Warner Losh
f741619cb2 Use .St -susv2 rather than "The Single UNIX Specification".
Submitted by: sheldonh
2000-09-04 15:38:58 +00:00
Alexey Zelkin
7dc5eb443d * 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
Alexey Zelkin
49b8dd0db5 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
Warner Losh
e9d918edb6 Don't print an error message if the bad option is '?'. This has been
in my tree for a long time.  bde reviewed this once upon a time and
said it was OK, iirc.  This also obviates the need to put ? in the
optstring argument to preclude the extra warning message which some
people think confuses users.  When I made my getopt cleanups of a long
time ago, this was the compromise reached.  I just neglected to commit
it until now.
2000-09-04 03:49:22 +00:00
Warner Losh
12b92015dd The comparison against 0 should be against LC_ALL. category isn't a
boolean and it is LC_ALL that's special.

Someone submitted this to me a long time ago, but I can't find the
mail now.
2000-09-04 03:43:24 +00:00
Warner Losh
71300cb5db Soften the statement about select's timeout argument. This part of
the system likely won't change in the future, but the warning is a
good idea.
2000-09-04 03:32:30 +00:00
Andrey A. Chernov
08ba69b8a4 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
Andrey A. Chernov
e426928478 Add:
The implementation will behave as if no library function calls strtok().
2000-09-03 13:24:28 +00:00
Brian Somers
1357c5d3cc setproctitle() requires unistd.h and not libutil.h/-lutil 2000-09-02 02:25:34 +00:00
Brian Somers
9feac5c218 Move setproctitle() from libutil to libc (after a repo-copy)
and bump __FreeBSD_version to 500012 to mark the occasion.

setproctitle() is prototyped in unistd.h as opposed to stdlib.h
where OpenBSD and NetBSD have it.

Reviewed by: peter
2000-09-02 01:51:36 +00:00
Andrey A. Chernov
56338d5acb Treat empty lang as "C" lang too 2000-09-01 13:19:18 +00:00
Alexey Zelkin
a8a87cc61b Set rcsid to correct value
Resort #include files
Remove SYSV compatibility chunks
2000-09-01 12:19:00 +00:00
Alexey Zelkin
2873532b59 protect .h file contents correctly. 2000-09-01 12:13:33 +00:00
Alexey Zelkin
6b9175e062 Remove unused indirect references to cat* functions. 2000-09-01 12:10:59 +00:00
Alexey Zelkin
a367b9700f Fix memory leak introduced by kris in rev 1.22 2000-09-01 11:56:31 +00:00
Andrey A. Chernov
460b926285 setlocale may return NULL, handle this case too by resetting to "C" 2000-09-01 11:13:38 +00:00
Andrey A. Chernov
016de69d9e Move protection code down to handle NL_CAT_LOCALE case too. 2000-09-01 11:09:34 +00:00
Andrey A. Chernov
53d620a5fb Protect from badly formed LANG variable 2000-09-01 10:54:04 +00:00
Dag-Erling Smørgrav
1250db8139 Import XPG4-compliant basename(3) and dirname(3) from OpenBSD.
The man pages need some adjustments.

PR:		12960, 12962
Submitted by:	James Howard <howardjp@wam.umd.edu>
Obtained from:	OpenBSD
2000-08-31 15:56:15 +00:00
Andrey A. Chernov
b9b68e50dc 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
Andrey A. Chernov
d8283f6866 Explicetely describe catalog descriptor lifetime 2000-08-30 10:22:23 +00:00
Andrey A. Chernov
67ab6e9844 strtok() -> strsep() (no strtok() in libraries allowed)
small cleanup in nearby area:
pointer 0 -> NULL, according to manpages
hardcoded constant -> sizeof(buf)
2000-08-29 21:04:07 +00:00
David Malone
ad8c1e6a09 According to the susv2 man pages I have, remove(3) should act as
rmdir(2) on directories and unlink(2) otherwise. This modification,
and most of the man page update has been obtined from OpenBSD. This
was spotted by someone on a mailing lists a few months ago, but
I've lost their mail.

Reviewed by:	sheldonh
2000-08-28 15:45:42 +00:00
John Baldwin
183012b423 The API change mentioned in the previous revision has been backed out, so
back out the corresponding documentation.

Noticed by:	brian, ume
2000-08-22 21:50:03 +00:00
John Baldwin
4f9d9dc272 Remove duplicate FreeBSD id tags. 2000-08-21 21:05:44 +00:00
Brian Feldman
8ca723793a Fix style bugs (including ones introduced from OpenBSD). 2000-08-16 23:37:16 +00:00
Hajimu UMEMOTO
2368b03bf4 Don't retry connecting via the same medium.
I changed to close to original code before merging IPv6 support.
It seems having delay before another try is useless.  However, I'm
not sure that delay means.  So, I leave it as-is.

PR:		bin/20515
2000-08-10 17:10:57 +00:00
Jun-ichiro itojun Hagino
1bf6f71909 mention getipnodeby* and get{addr,name}info are not thread-safe. (sync with kame)
s/.Os KAME/.Os/
comment From: Greg Thompson
2000-08-09 23:16:23 +00:00
Brian Feldman
4f0682b0f3 If using a DB_RECNO, db::put should return the new key if R_IAFTER is
set, not the previous key.

Add $FreeBSD$, not taking this off the vendor branch because it's not on.
2000-08-08 05:20:57 +00:00
Jonathan Lemon
b275c430a5 Document return value of ENOENT for nonexistent/invalid filter entries. 2000-08-07 16:47:35 +00:00
Ben Smithurst
d9b1c37c3b Fix description of argv[0] passed to interpreted scripts; it's the name of
the interpreter, _not_ the argv[0] passed in the original exec() call.
2000-08-05 16:38:24 +00:00
Kris Kennaway
84b578d562 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
Kris Kennaway
63c21920f9 Calculate the string length of a u_long at compile-time, instead of using a
hardcoded value.
2000-08-04 11:07:57 +00:00
Kris Kennaway
dec5f6ac42 Correct factor-of-10 error in INT_STRLEN_MAXIMUM() calculation. 2000-08-04 11:03:20 +00:00
Kris Kennaway
683544bd3e Correct string length bounds checking. 2000-08-04 10:53:37 +00:00
Kris Kennaway
099d883225 Prevent TMPDIR overflow. 2000-08-04 10:50:21 +00:00
Kris Kennaway
f1c418cfd4 Don't overflow the internal buffer in clnt_sperror() 2000-08-04 10:34:59 +00:00
Kris Kennaway
8f6d480067 sprintf -> snprintf paranoia 2000-08-04 10:23:42 +00:00
Jason Evans
b167c9a5c1 Make sem_post() safe to call from within a signal handler, as required by
POSIX/SUSv2.
2000-08-01 21:19:09 +00:00
Peter Wemm
41cbed694a Revert the temporary hack in rev 1.79. 2000-08-01 18:50:29 +00:00
Paul Saab
305ad8f908 If the format string passed to setproctitle begins with a '-'
character, skip the program name when setting the process title.
Ansified with extreme prejudice.

Reviewed by:	peter
2000-08-01 06:37:09 +00:00
Peter Wemm
5cb2354662 Add pointers to rfork_thread(3) 2000-07-31 05:43:43 +00:00
Peter Wemm
db3c6b6b22 Add a skeleton rfork_thread(3) man page. 2000-07-29 12:12:39 +00:00
Peter Wemm
13dfe2f092 Take a shot at implementing a functional rfork_thread() for alpha. This
was not fun and I am not entirely certain of the correctness, but it seems
to work.  (in fact, side by side testing of this code vs the x86 version
turned up hidden bugs in the x86 code).
2000-07-29 11:43:21 +00:00
Peter Wemm
ea3d353444 Fix some rather interesting bugs that managed to not turn up in various
testing and real-life applications:
1) If you returned from the thread function, you got a segv instead of
  calling _exit() with your return code.
2) clean up some bogus stack management.  There was also an underflow
  on function return.
3) when making syscalls, the kernel is expecting to have to leave space
  for the function's return address.  We need to duplicate this.  It was
  an accident that the rfork syscall actually worked here. :-/
2000-07-29 11:34:01 +00:00
Peter Wemm
c932e5d18f rfork(2) wrapper for simple rfork-style threads. I have lost count of
the number of times I have given this to people and got asked: why isn't
it in libc?  It is impossible to do this without assembler glue to reset
the stack for the new child process.

int rfork_thread(flags, stack_addr, start_fnc, start_arg)
int flags;                 Flags to rfork system call.  See rfork(2).
void *stack_addr;          Top of stack for thread.
int (*start_fnc)(void *);  Address of thread function to call in child.
void *start_arg;           Argument to pass to the thread function in child.

This is deliberately not documented or prototyped in includes until the
corresponding alpha version is written.
2000-07-29 07:14:04 +00:00
Peter Wemm
00bc791d86 Deal with the exit entry in MIASM changing to sys_exit.
This Is A Hack(TM).
2000-07-29 00:28:44 +00:00
Matthew Dillon
01ba8e704f MFC 1.11.2.3 from -stable to -current 2000-07-25 18:50:22 +00:00
Sheldon Hearn
3c63f48c66 Clean up some nits, with the permission of the author:
* Grammar fixes.
  * Mark up rfork and vnode as cross-references.
  * Clarify the use of the RFFDG flag to rfork(2).
2000-07-24 18:03:53 +00:00
Sheldon Hearn
8072ee08a9 Remove the reference to KERN_UPDATEINTERVAL and syncer(4), since
KERN_UPDATEINTERVAL can't be used to control sched_sync().  In
fact, there's no easy way to control the syncer with sysctls.

Reported by:	bde
2000-07-22 15:36:36 +00:00
Jason Evans
61e4108c41 Use _close() instead of close() in addrconfig() to keep it from becoming a
potential cancellation point in libc_r.
2000-07-21 04:22:39 +00:00
Hajimu UMEMOTO
c98e299e93 Copy canonname for *ahost, into static buffer.
Obtained from:	KAME Project
2000-07-20 18:49:35 +00:00
Alfred Perlstein
372e9eb0af use .Pp instead of faking it with an extra newline
Pointed out by: sheldonh
2000-07-20 11:05:52 +00:00
Alfred Perlstein
f47d88b0b7 document get/set sockopt usage with accept_filter(9) 2000-07-20 10:33:08 +00:00
Brian Somers
732d07e535 Alocate rcmd{,_af}()'s *ahost argument using malloc() (well
strdup()) rather than pointing it at something that's free()d
(via freeaddrinfo(res)) before the function returns.

I appreciate that this is an API change, but it's the only way
(AFAIK) of doing this without breaking existing code that uses
rcmd{,_af}().

Pointed out by: phkmalloc
2000-07-20 09:05:15 +00:00
Sheldon Hearn
a6b651021d Update stale references to update(4) with references to the new
syncer(4) manual page.
2000-07-19 07:39:08 +00:00
Hajimu UMEMOTO
05c36511b9 To define A RR to root (.) is valid in DNS. So, h_name = "" shouldn't
be treated as NULL.

PR:		bin/19816
Submitted by:	Bill Fenner <fenner@research.att.com>
Reviewed by:	Atsushi Onoe <onoe@sm.sony.co.jp>
2000-07-19 06:22:01 +00:00
Archie Cobbs
6e64168369 Const'ify parameters to ethers(3) routines as appropriate. 2000-07-18 22:44:52 +00:00
Jonathan Lemon
a8e65b915e Simplify kqueue API slightly.
Discussed on:	-arch
2000-07-18 19:31:52 +00:00
Alexander Langer
6e145859ff Drop the references to index(3) and rindex(3), which are non-standard
and people shouldn't be encouraged to use them.

Asked by:	sheldonh
2000-07-18 08:05:11 +00:00
Jason Evans
8e234adf86 Change my email address in the copyright notices for the sake of consistency
(jasone@canonware.com --> jasone@freebsd.org).
2000-07-18 01:38:19 +00:00
Jason Evans
82db3da3e1 Reshuffle the SEE ALSO section.
Prompted by:	sheldonh
2000-07-17 22:33:32 +00:00
Alexander Langer
24c196fe25 Add SEE ALSO section, as with the other string functions.
Submitted by:	dcs
2000-07-17 19:00:26 +00:00
Ben Smithurst
f21ff38bf4 Make the NAME section a bit less confusing.
PR:		19262
Submitted by:	NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>
Reviewed by:	sheldonh
2000-07-15 13:04:33 +00:00
Jeroen Ruigrok van der Werven
62048b0a9e Fix typo, teh -> the. 2000-07-14 11:23:04 +00:00
Ben Smithurst
744cb90e1f Fix typo; sa_siginfo -> sa_sigaction
PR:		19602
Submitted by:	Tony Finch <dot@dotat.at>
2000-07-11 11:39:57 +00:00
Peter Wemm
4a1afa49fd Try and fix the worst of some highly bogus malloc/free resource
management involving rcmd_af(), getaddrinfo(), freeaddrinfo(), etc.
We set *ahost to point to ai->canonname; and later free the ai-> stuff
and still leave the old pointers in *ahost to the freed data.
Perhaps the best way to deal with this is a static buffer or a static
strdup() that is freed on the next iteration or something.  This gives
me headaches just thinking about this.

The new 'AJ' default for malloc() tripped this up.
2000-07-11 09:31:19 +00:00
Brian Feldman
c98c98a822 Actually make it so this Makefile can build grot. 2000-07-10 06:10:47 +00:00
Daniel C. Sobral
beea813ee4 Add a test case for one of the bugs found on the new additions to
regex(3).
2000-07-09 18:14:39 +00:00
Daniel C. Sobral
8ca5c256cb Spencer's regex(3) test code.
Obtained from: BSD/OS
2000-07-09 18:13:35 +00:00
Daniel C. Sobral
8f9e434f46 altoffset() always returned whenever it recursed, because at the end
of the processing of the recursion, "scan" would be pointing to O_CH
(or O_QUEST), which would then be interpreted as being the end character
for altoffset().

We avoid this by properly increasing scan before leaving the switch.

Without this, something like (a?b?)?cc would result in a g->moffset of
1 instead of 2.

I added a case to the soon-to-be-imported regex(3) test code to catch
this error.
2000-07-09 17:45:30 +00:00
Daniel C. Sobral
b6c1a56180 Since g->moffset points to the _maximum_ offset at which the must
string may be found (from the beginning of the pattern), the point
at which must is found minus that offset may actually point to some
place before the start of the text.

In that case, make start = start.

Alternatively, this could be tested for in the preceding if, but it
did not occur to me. :-)

Caught by: regex(3) test code
2000-07-09 17:36:53 +00:00
Daniel C. Sobral
517bffca1b Add some casts here and there. 2000-07-09 15:12:28 +00:00
Poul-Henning Kamp
832505d0c9 Turn malloc options "AJ" on by default.
These will be turned off again as we approach 5.0-RELEASE.

If you benchmark things, make sure to
	ln -sf j /etc/malloc.conf
to see "true" performance.
2000-07-09 13:10:18 +00:00
Jun-ichiro itojun Hagino
ec20fe00cc reject empty scopeid. use strtoul() for checking all-numericness of
portname.  explicitly reject empty numeric portname.
sync with kame.  based on comments from itohy@netbsd.org
2000-07-09 06:10:01 +00:00
Daniel Harris
9559d2b084 First appeared in 2.9BSD, not 3.0.
PR:		19263
Submitted by:	NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>
Obtained from:	Open|NetBSD
2000-07-08 18:17:12 +00:00
Daniel C. Sobral
6d902efe43 Since we have modified charjump to be CHAR_MIN-based, we have to
correct the offset when we free it.

Caught by: phkmalloc
2000-07-08 09:45:17 +00:00
John Polstra
59a821dae2 Change the dllockinit() interface from "experimental" to
"deprecated" and warn that it will disappear eventually.
2000-07-08 04:17:28 +00:00
Andrey A. Chernov
6ea9889255 fix comment 2000-07-07 08:24:50 +00:00
Daniel C. Sobral
4d41cae8f8 Do not free NULL pointers. 2000-07-07 07:47:39 +00:00
Daniel C. Sobral
c5e125bbbf Deal with the signed/unsigned chars issue in a more proper manner. We
use a CHAR_MIN-based array, like elsewhere in the code.

Remove a number of unused variables (some due to the above change, one
that was left after a number of optimizing steps through the source).

Brucified by: bde
2000-07-07 07:46:36 +00:00
John-Mark Gurney
20ff215b1d remove sys/time.h by instruction from bde. 2000-07-06 22:18:44 +00:00
Alfred Perlstein
55241422d6 cleanup the tsearch import.
remove (comment out) functions defined or depricated elsewhere:
  bsearch, lfind, lsearch, insque, remque

change hcreate to take a size_t rather than uint (essentially the same)

since hcreate/hdestroy are now in <search.h>, remove private search.h
in lib/libc/db/hash/

add $FreeBSD tags to hsearch.c
2000-07-06 20:04:34 +00:00
Daniel C. Sobral
f943749dcd I hate signed chars.^W^W^W^W^WCast to unsigned char before using signed
chars as array indices.
2000-07-06 06:37:30 +00:00
Daniel C. Sobral
9868274b74 Correct comment to work with test code.
Prevent out of bounds array access in some specific cases.
2000-07-06 06:34:15 +00:00
Daniel C. Sobral
03b59f2038 Use UCHAR_MAX consistently. 2000-07-06 05:19:29 +00:00
Jun-ichiro itojun Hagino
024cdeff7a sync with more recent kame tree.
- correct scoped notation separator (s/@/%/)
- include example and more references
2000-07-05 08:27:50 +00:00
Jun-ichiro itojun Hagino
6cb9418289 sync with latest kame.
- permit numeric scopeid, be more careful about buffer size

TODO: 2nd arg type should be socklen_t for RFC2553 conformance,
but due to include file dependency it is not a easy thing to do
(netdb.h does not have socklen_t)
2000-07-05 05:09:17 +00:00
Jun-ichiro itojun Hagino
b826397abd sync with kame.
- better return code.  from enami@netbsd
- do not use "class" as variable name.  C++ guy had trouble with it.
2000-07-05 05:07:23 +00:00
Robert Watson
76e14ed07f o Enable building of libposix1e capability state utility functions and
capability-related syscall wrappers.

Obtained from:	TrustedBSD Project
2000-07-05 04:25:09 +00:00
Robert Watson
89b7801213 o Introduce cap_{get,set}_{file,fd}() syscall wrappers, associated with
soon to be committed syscall stubs.  These calls will be used to get
  and set capability state associated with executables.

Obtained from:	TrustedBSD Project
2000-07-05 04:20:59 +00:00
Robert Watson
5d08343440 o When calling the syscall, use &cap instead of cap. Apparently this
error was introduced during the merge; fixing it corrects a (correct)
  warning about types.

Obtained from:	TrustedBSD Project
2000-07-05 04:08:35 +00:00
Robert Watson
b00446f08a o Comment out <sys/audit.h> and <sys/mac.h> since they are not yet
committed

Obtained from:	TrustedBSD Project
2000-07-05 03:30:32 +00:00
Jun-ichiro itojun Hagino
23ba01423e add getifaddrs(3) from bsdi. this is a magic function which lets you grab
interface addresses in a portable manner, without headache of SIOCGIFCONF
or sysctl.  it is in bsdi/openbsd/netbsd already.
from kame tree (actually, mandatory for latest kame tree).
2000-07-05 02:13:17 +00:00
Andrey A. Chernov
3bc7ba9057 Describe agrument range correctly, according to multibyte(3)
Remove unneded comment
2000-07-03 13:03:15 +00:00
Sheldon Hearn
256dba38d1 Remove trailing whitespace only. 2000-07-03 08:31:02 +00:00
Sheldon Hearn
d72b904079 Fix overlong line and trailing whitespace introduced in rev 1.8. 2000-07-03 08:28:30 +00:00
Sheldon Hearn
c50c83c0e1 Add to the SEE ALSO section, a reference to the RFC mentioned in
text introduced in the previous commit.
2000-07-03 08:26:50 +00:00
Brian Feldman
a9e2722c58 Re-pair the MLINKS of unvis.3 with strunvisx.3. This undoubtedly was a
world breakage.
2000-07-03 05:21:43 +00:00
Kris Kennaway
3f587e572f Previous commit broke the case of chained CNAME entries. Instead handle
the bogus case by being stricter about errors.

Submitted by:   itojun
Obtained from:  KAME
2000-07-03 04:43:14 +00:00
Kris Kennaway
dc578f2564 Fix a nasty bug which would leave the struct hostent incompletely filled out
when parsing certain DNS records during a reverse address resolution. Thus
when code tries to examine the returned host name, it dereferences a null
pointer :-(

Problem noticed by:	ps
2000-07-03 02:33:02 +00:00
Alexander Langer
0b1c18e4cf Add strunvisx.3 MLINK. 2000-07-02 21:45:16 +00:00
Alexander Langer
d8fa6babb4 Document VIS_HTTPSTYLE:
VIS_HTTPSTYLE is a new encoding style for use in vis(), strvis() and
  strvisx() that escapes characters according to RFC 1808 (URI encoding).

Since decoding of these require different detection of start-points of
  escaped characters, VIS_HTTPSTYLE can be given as flag to unvis().
  unvis() will then properly decode URIs.

A new function appeared, strunvisx(): strunvisx() behaves similar as
  strunvis(), with one exception: It has an additional flag parameter,
  which is passed to unvis() to archive the effect I described above.
2000-07-02 21:31:26 +00:00
Daniel C. Sobral
a5378e623a Fix memory leak introduced with regcomp.c rev 1.14. 2000-07-02 15:58:54 +00:00
Daniel C. Sobral
e6a886d8db Enhance the optimization provided by pre-matching. Fix style bugs with
previous commits.

At the time we search the pattern for the "must" string, we now compute
the longest offset from the beginning of the pattern at which the must
string might be found. If that offset is found to be infinite (through
use of "+" or "*"), we set it to -1 to disable the heuristics applied
later.

After we are done with pre-matching, we use that offset and the point in
the text at which the must string was found to compute the earliest
point at which the pattern might be found.

Special care should be taken here. The variable "start" is passed to the
automata-processing functions fast() and slow() to indicate the point in
the text at which they should start working from. The real beginning of
the text is passed in a struct match variable m, which is used to check
for anchors. That variable, though, is initialized with "start", so we
must not adjust "start" before "m" is properly initialized.

Simple tests showed a speed increase from 100% to 400%, but they were
biased in that regexec() was called for the whole file instead of line
by line, and parenthized subexpressions were not searched for.

This change adds a single integer to the size of the "guts" structure,
and does not change the ABI.

Further improvements possible:

Since the speed increase observed here is so huge, one intuitive
optimization would be to introduce a bias in the function that computes
the "must" string so as to prefer a smaller string with a finite offset
over a larger one with an infinite offset. Tests have shown this to be a
bad idea, though, as the cost of false pre-matches far outweights the
benefits of a must offset, even in biased situations.

A number of other improvements suggest themselves, though:

	* identify the cases where the pattern is identical to the must
	string, and avoid entering fast() and slow() in these cases.

	* compute the maximum offset from the must string to the end of
	the pattern, and use that to set the point at which fast() and
	slow() should give up trying to find a match, and return then
	return to pre-matching.

	* return all the way to pre-matching if a "match" was found and
	later invalidated by back reference processing. Since back
	references are evil and should be avoided anyway, this is of
	little use.
2000-07-02 10:58:07 +00:00
Daniel C. Sobral
5ead635430 Remove from the notes a bug that it's said to have been fixed.
PR: 15561
Submitted by: Martin Kammerhofer <mkamm@gmx.net>
Confirmed by: ache
2000-07-02 10:34:25 +00:00
Dan Moschuk
d81584ae91 Style fixes. 2000-07-01 17:49:34 +00:00
Dan Moschuk
e63a7af508 Add URI encoding to the vis/unvis routines courtesy of VIS_HTTPSTYLE.
Since alex is a -doc committer, he can update his own manpage. :-)

Also add $FreeBSD$ while I'm here.

Submitted by: alex
2000-07-01 15:55:49 +00:00
Alfred Perlstein
64566a3e2a bring in binary search tree code.
Obtained from: NetBSD
2000-07-01 06:55:11 +00:00
Daniel C. Sobral
6b709b74ae Initialize variables used by the Boyer-Moore algorithm.
This should fix core dumps when the must pattern is of length
three or less.

Bug found by: knu
2000-06-29 18:53:55 +00:00
Andrey A. Chernov
849c64f5ff Fix assigning alt_month in compatibility code 2000-06-29 17:21:45 +00:00
Daniel C. Sobral
6049d9f0eb Add Boyler-Moore algorithm to pre-matching test.
The BM algorithm works by scanning the pattern from right to left,
and jumping as many characters as viable based on the text's mismatched
character and the pattern's already matched suffix.

This typically enable us to test only a fraction of the text's characters,
but has a worse performance than the straight-forward method for small
patterns. Because of this, the BM algorithm will only be used if the
pattern size is at least 4 characters.

Notice that this pre-matching is done on the largest substring of the
regular expression that _must_ be present on the text for a succesful
match to be possible at all.

For instance, "(xyzzy|grues)" will yield a null "must" substring, and,
therefore, not benefit from the BM algorithm at all. Because of the
lack of intelligence of the algorithm that finds the "must" string,
things like "charjump|matchjump" will also yield a null string. To
optimize that, "(char|match)jump" should be used.

The setup time (at regcomp()) for the BM algorithm will most likely
outweight any benefits for one-time matches. Given the slow regex(3)
we have, this is unlikely to be even perceptible, though.

The size of a regex_t structure is increased by 2*sizeof(char*) +
256*sizeof(int) + strlen(must)*sizeof(int). This is all inside the
regex_t's "guts", which is allocated dynamically by regcomp(). If
allocation of either of the two tables fail, the other one is freed.
In this case, the straight-forward algorithm is used for pre-matching.

Tests exercising the code path affected have shown a speed increase of
50% for "must" strings of length four or five.

API and ABI remain unchanged by this commit.

The patch submitted on the PR was not used, as it was non-functional.

PR: 14342
2000-06-29 04:48:34 +00:00
Jason Evans
b79702feff Fix typo in SEE ALSO section. 2000-06-28 03:15:21 +00:00
John-Mark Gurney
55b8fbfb5b change first release date to 4.1-R as 5.0-R won't be out for at least a
year (from jkh)..

Caught by:	Fx macro warning on 3.4-R
2000-06-26 21:23:57 +00:00
Alexander Langer
271c4bdbce The argument is not mcontext_t but ucontext_t.
PR:		17836
Submitted by:	Tim Moore <moore@bricoworks.com>
2000-06-26 15:00:25 +00:00
Chris Costello
4b4289e4d0 Repair a cross-reference to sync(1) that should refer to sync(8). 2000-06-23 20:47:50 +00:00
Chris Costello
1c67d6c539 Properly separate paragraphs by using `.Pp' instead of a blank line. 2000-06-23 20:35:45 +00:00
Chris Costello
4f18b87801 Remove blank lines. 2000-06-23 20:34:31 +00:00
Sheldon Hearn
8a4272bf51 Mark up errno as a variable (Va), not as a defined value (Dv).
Do not terminate the cross-reference list in the SEE ALSO section with
a period.
2000-06-23 15:02:29 +00:00
Sheldon Hearn
a6a2ba1c18 Apply the accepted line breaking rules. 2000-06-23 15:01:18 +00:00
Chris Costello
bb33e42207 Replace .Va, .Ar and .Nm with .Fa or .Va where necessary, examples:
``.Ar errno'' -> ``.Va errno''
  ``.Nm ops'' -> ``.Fa ops''
  ``.Va fd'' -> ``.Fa fd''
2000-06-23 05:05:44 +00:00
Chris Costello
a907d4fd1f Replace an erroneous .Va error' with .Va errno'. 2000-06-23 04:25:10 +00:00
Chris Costello
48b5eb7c85 Replace `FreeBSD 4.0'' with `.Fx 4.0'' and remove a useless empty line
at the end of the file.
2000-06-23 03:50:32 +00:00
Chris Costello
dca3f6825f Replace .Va references to function arguments to .Fa references. 2000-06-23 03:43:34 +00:00
Hajimu UMEMOTO
a42af91cba Don't call _getipnodebyname_multi(). It fixes the problem that
getaddrinfo() accidentally returns IPv4 mapped IPv6 address instead
of native IPv4 address.
Now, getaddinfo() is scoped address ready.  You can put scoped
address within /etc/hosts.

Obtained from:	KAME Project.
2000-06-20 16:33:33 +00:00
Hajimu UMEMOTO
a40e8e8ba4 Re-commit DNS IPv6 transport support with fixes for IPv4 only
kernel and compatibility issue.

Obtained from:	KAME Project
2000-06-19 18:25:06 +00:00
Josef Karthauser
1246bf7279 Remove the setflags/getflags routines. Their functionality has
been replaced with the library calls fflagstostr and strtofflags.
2000-06-18 20:10:41 +00:00
Josef Karthauser
0a266c86a2 Make a note of fflagstostr and strtofflags in the 'see also' section. 2000-06-17 14:03:34 +00:00
Josef Karthauser
c5bb91d1b2 Add strtofflags and fflagstostr to libc. 2000-06-17 11:55:57 +00:00
Josef Karthauser
8c7bdc130e Modify strtofflags so that it returns a malloced string instead of a
pointer to a static buffer.
2000-06-17 11:09:24 +00:00
Josef Karthauser
d502d9ac46 The "def" arg for fflagstostr is too specialized for ls. The caller
can easily translate from "" to whatever it wants to print if no
flags are set.  (ls prints "-" and mtree prints "none".)

Suggested by:	bde
2000-06-17 01:43:56 +00:00
Josef Karthauser
b81eeaf0a6 Return of the evil file flags! The {s|g}etflags functions were
renamed to {s|g}etflagsbyname, which received objections.   They're
now called strtofflags (string to file flags) and fflagstostr (file
flags to string).

Suggested by:	bde
2000-06-17 01:28:13 +00:00
Hajimu UMEMOTO
672315756a Backout my previous commit.
Cannot resolve any host on IPv4 only kernel.

Reported by:	ache
2000-06-14 20:51:55 +00:00
Alexander Langer
c20d2ab74b You need options USER_LDT in your kernel to use these functions.
PR:		18943
Submitted by:	Ben Smithurst <ben@scientia.demon.co.uk>
Reviewed by:	asmodai
2000-06-14 13:38:21 +00:00
Alexander Langer
cb477b672b Fix typo: turn of -> turn off.
PR:		18805
Submitted by:	Yoshihiro Ota <ota@mail.drexel.edu>
Kind of Reviewed by:	asmodai ("sure")
2000-06-13 12:50:47 +00:00
Hajimu UMEMOTO
7c381eb7d5 DNS IPv6 transport support.
It is nessesary for IPv6 only life.

Obtained from:	KAME
2000-06-11 15:43:34 +00:00
Chris Costello
55ef467128 - Replace `.Va (cap_t)NULL'' with `.Dv NULL''
- Fix a typo: ``constrains'' -> ``constraints''

Reviewed by:	rwatson
2000-06-09 02:01:27 +00:00
Chris Costello
cce53efa17 - Replace
.Pp
   .Fn func
   .Pp
   Description ...
  with a list (Bl ... Li ... El).
- Remove a superfluous ``.Sh ENVIRONMENT'' and replace it with a ``.Pp''
  within the IMPLEMENTATION DETAILS section.

Reviewed by:	rwatson
2000-06-09 01:59:48 +00:00
John-Mark Gurney
e585cdf0ce add a BUGS section on how we can only watch VNODE's on a UFS file system
right now...

I talked w/ phk last night and "fixing" this in a generic way is going
to require a lot of complex thought on stacking let alone the NFS problems..

add missing sys/time.h for struct timespec def...
2000-06-07 22:09:16 +00:00
Robert Watson
9bcdb11de0 o Introduce libposix1e capability support routines, which provide a
standardized interface to the capability support in TrustedBSD.
o Not currently enabled in Makefile, as this code depends on syscalls
  and include files that will be committed at a later date.

Obtained from:	TrustedBSD Project
2000-06-04 22:17:11 +00:00
Robert Watson
4f15cc7406 o Fix incorrect descriptions of cap_get_flag() and cap_set_flag() in
capabilities summary manpage, cap(3).

Obtained from:	TrustedBSD Project
2000-06-04 22:14:10 +00:00
Robert Watson
ef9bbc7e4d o Build and install POSIX.1e capabilities man pages
o Add shared library version 2 to libposix1e given API changes, et al
o Commented out cap_*.c as that is not currently being compiled into
  the library (pending syscalls being committed)

Obtained from:	TrustedBSD Project
2000-06-04 21:25:31 +00:00
Robert Watson
db0e6ab267 o Add posix1e(3) references to acl.3 and cap.3
Obtained from:	TrustedBSD Project
2000-06-04 21:23:20 +00:00
Robert Watson
0da8c9400b o Add mention of capabilities documentation + APIs
o Switch reference to www.trustedbsd.org instead of POSIX.1e implementation
  page
o Add cross references to capabilities man pages
o Remove extended attribute not implemented "BUGS" entry

Obtained from:	TrustedBSD Project
2000-06-04 21:18:20 +00:00
Robert Watson
49a2603d32 o Introduce man pages for POSIX.1e capability API
- cap.3 describing library interface
  - cap_*.3 describing specific API calls

APIs to follow relatively soon, code to follow later.

Obtained from:	TrustedBSD Project
2000-06-04 21:15:16 +00:00
Robert Watson
f4286d4722 o Remove extra cross reference from acl.3 to acl.3
o Remove "BUGS" entries indicating that there's nowhere to store ACLs as
  we now have extended attributes.

Obtained from:	TrustedBSD Project
2000-06-04 21:10:59 +00:00
Andrey A. Chernov
8b96e6c916 Megre XPG4 code into libc 2000-06-03 12:24:08 +00:00
Kris Kennaway
6641555f44 #include <string.h> for memcpy() prototype
Obtained from:	OpenBSD
2000-06-03 00:27:54 +00:00
Chris Costello
f9a2346166 Replace a `manual(section)' reference with a proper .Xr statement. 2000-05-31 21:12:08 +00:00
Tim Vanderhoek
0525c9d127 Fix an mdoc-o, and english. 2000-05-31 04:34:23 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
John-Mark Gurney
af7b56f450 fix up the kqueue documentation... comment some things that were left
out that really needed to be here...

Reviewed-by: jlemon
2000-05-24 04:29:57 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Guy Helmer
b4183771fd Describe errx/warnx in comparison to errc/warnc/err/warn.
Use .Fa instead of .Va for function arguments.

Reviewed by:	sheldonh
2000-05-23 19:52:35 +00:00
Brian Feldman
a274d19ba2 Back out NOTE_EXIT status reporting pending discussion. 2000-05-21 16:27:41 +00:00
Tim Vanderhoek
8187dd1c8b Fix a memory leak in getent() that occurred when the requested entry
could not be found.

PR:		bin/17084
2000-05-21 02:55:09 +00:00
Chris Costello
12b03e57e5 Remove a superfluous `.Pp' occuring directly after
`.Sh IMPLEMENTATION NOTES'.
2000-05-19 02:55:43 +00:00
Chris Costello
ef626a01c1 Add a note under IMPLEMENTATION NOTES about the behavior of sendfile()
in the threaded library.
2000-05-19 02:53:55 +00:00
Peter Wemm
76e61b9c71 List ECONNRESET as a return value. EINVAL was not documented either. 2000-05-19 01:00:57 +00:00
Brian Feldman
a24b514d72 Put the wait(2) exit status in "data" for NOTE_EXIT kevents. 2000-05-17 01:16:11 +00:00
Alexey Zelkin
314c685440 mdoc related fixes:
. synchronize NAME and SYNOPSIS sections
. replace .Ev macros with .Dv / .Er / .Em macros  as mdoc(7)
  specification declare
2000-05-12 10:22:50 +00:00
Alexey Zelkin
cdbbbfa4fb . fix .Dt macro argument
. spell inet6_rthdr_reverse correctly
2000-05-12 10:07:31 +00:00
Bruce Evans
200f7053ee Fixed missing include in synopsis.
Use a long line instead splitting a line with backslash-newline in synopsis.
My synopsis checker doesn't understand backslash-newline.
2000-05-11 16:01:17 +00:00
Tim Vanderhoek
49ca482a68 When "any" acts as a subject, the verb must agree with whatever any is of. 2000-05-11 05:29:10 +00:00
Tim Vanderhoek
d4b81c98d8 Content-free commit: only remove trailing whitespace 2000-05-11 05:06:00 +00:00
Tim Vanderhoek
18bd6f9514 The accept() function is a call, not an argument. Also, add: serial
comma, missing-hyphen, and a word-erase character.
2000-05-11 05:04:30 +00:00
John Baldwin
bde8875a06 Finish moving all IEEE fp types to be the same on all arch's. 2000-05-10 19:41:40 +00:00
David E. O'Brien
317e99beec Add FreeBSD Id tags. 2000-05-10 19:04:57 +00:00