Commit Graph

754 Commits

Author SHA1 Message Date
Andrey A. Chernov
38aa46cdf0 Rename collate_range_cmp to __collate_range_cmp for internal usage
inside libc. Add collate_range_cmp as alias to __collate_range_cmp
for temp. backward compatibility.
collate_range_cmp will be replaced with direct code for each
external program for compatibility with the rest of world
1996-10-31 04:25:14 +00:00
Poul-Henning Kamp
f3f639a106 If you run with option Z and malloc fails, memset gets called
with a NULL pointer (archie)
Explain that minsize is also the smallest alignment.

Submitted by:	Archie Cobbs <archie@whistle.com>
1996-10-29 20:35:39 +00:00
Joerg Wunsch
55e0d3b7cf Fix an off-by-one error in getvfsent().
Detected by: phkmalloc :)
1996-10-26 21:53:21 +00:00
Alexander Langer
90a720bc0d Note that streams are now flushed on abort.
Change standards section to reflect POSIX 1003.1-1990 conformance.
1996-10-26 18:14:44 +00:00
Poul-Henning Kamp
7bd7818f1c Various cosmetics
Improve chances of troublefree 64bit operation. [imp]

Noticed by:	Warner Losh <imp@village.org>
1996-10-26 08:19:07 +00:00
Alexander Langer
a3f90e9bd5 POSIX requires stdio buffers be flushed on abort.
Obtained from:	OpenBSD, Thorsten Lockert <tholo@OpenBSD.ORG>
1996-10-26 01:42:33 +00:00
Andrey A. Chernov
3deeb59da9 GNU-style changes:
1) Rename FNM_ICASE to FNM_CASEFOLD
2) Add FNM_LEADING_DIR
Add proper (unsigned char) casts to tolower().
Use 'char' function argument for proper sign extension
1996-10-23 16:40:20 +00:00
Andrey A. Chernov
967a5cb181 Simplify debug output
Simplify collate_range_cmp for ASCII-compatible collate we have now
1996-10-23 15:35:46 +00:00
Joerg Wunsch
a098bfd775 Fix a potential memory leak i've introduced with my recent patch.
Reviewed by:	bde
1996-10-21 23:56:23 +00:00
Wolfram Schneider
95e4966c47 add flag FNM_ICASE for case insensitve search
Reviewed by: ache
1996-10-20 15:15:59 +00:00
Poul-Henning Kamp
2e7c91ff16 malloc_pages should be static.
Add progname to warning/error message layout. (joerg)
Remove inline assembler, no speed impact, not need for the obfuscation (bde)
Remove on the fly calculation of parameters, no longer critical.
Make D & U flags valid even if we don't support them.
Don't call imalloc until we're done initializing.
Zap contents on free() if we have "Junk" set. [*]
Various nitpicking.

[*] As a sideeffect of this change, if you are worried about
sensitive data lingering in memory, you can use the 'Junk' option
now to make sure phkmalloc zaps memory when it is returned.  add
	char * malloc_options = "J";
to your source.  Obviously there is a performance impact.
1996-10-20 13:20:57 +00:00
Joerg Wunsch
5fae0297db Remove the arbitrary limit for the line length in /etc/ttys, and make
the buffer dynamic.

Closes PR # misc/1838: getttyent() arbitrary 100...
1996-10-19 16:29:10 +00:00
Peter Wemm
ba8f828b88 Back out most of the last backout. :-) Guido removed the 1.1.1.1->1.1.1.2
changes from the vendor branch as well, backing the db-1.82 changes.

This file should now be the same as it was in rev 1.1.1.2.
1996-10-19 01:34:25 +00:00
Guido van Rooij
c3449f0d2b Backout bzero patch.
Somehow, I also managed to get quite some other changes in this file at
the same time. All I did was checkout the file and  made a single change.
If someone has an explanation how these PURIFFY defines got in...
1996-10-18 19:56:51 +00:00
Guido van Rooij
102b3fa4c8 When freeing buffers in the db routines, also zeroize them
This should solve the bug where a coredumping ftpd reveals
encrypted passwords.
Obtained from: OpenBSD
1996-10-17 18:27:58 +00:00
Peter Wemm
0d4453d303 Corrently null-terminate the path being passed to the opendir() calls,
malloc() does is not defined to return a zeroed buffer leading to
"strange" problems.

Submitted by: Karl Denninger <karl@mcs.com>, PR#1826
1996-10-17 00:40:04 +00:00
Jordan K. Hubbard
a0735deb48 Bring back ns_* routines; we need them for ifconfig and route. 1996-10-16 19:38:51 +00:00
Andrey A. Chernov
1642f84deb Save half of space in LC_COLLATE and remove unneded code.
This change is not compatible with previous variant, however proper
error code returned in both cases.
Colldef changes will follows.
1996-10-15 21:53:23 +00:00
Garrett Wollman
318a4f9fc3 Require that a timezone specified via the TZ envariable be a regular
file (and not a directory or a device which might also be readable).
Closes PR#1740.
1996-10-09 17:39:37 +00:00
Andrey A. Chernov
40f8b70da6 Improve seeding, the random sequence did not vary match
with the seed. Old variant will be available via libcompat soon.
1996-10-09 15:59:04 +00:00
John Polstra
d3281e16c2 Fix an error in the description of "h_errno". Add "const" to a few
declarations to make them agree with the actual prototypes in <netdb.h>.
1996-10-08 22:30:08 +00:00
Wolfram Schneider
e83201b43a delete doubled words, e.g.: "the the" -> "the" 1996-10-05 22:27:30 +00:00
Paul Traina
beddb20c7a Skip results that have unexpected lengths 1996-10-01 03:45:06 +00:00
Wolfram Schneider
4347915c16 perror () does not prepend ": " for the non-NULL argument "". close PR 1492
Submitted by: Kent Vander Velden <graphix@iastate.edu>
Reviewed by:
Submitted by:
Obtained from:
1996-09-30 15:39:18 +00:00
Bruce Evans
38c429d5bc Made this about as (in)complete as sysctl.8.
- removed references to nonexistent pathconf-related variables.
- document everything in CTL_MACHDEP(more than in sysctl.8) and
  80% of the things in CTL_KERN (same as in sysctl.8).
1996-09-29 18:12:52 +00:00
Bruce Evans
b027a2a70d Updated the descriptions of the limits related to EAGAIN.
Changed the error name width for rfork to match fork.
1996-09-29 17:47:46 +00:00
Wolfram Schneider
ac8ef33789 .Os NetBSD -> .Os FreeBSD.
The pages are not NetBSD specific and FreeBSD is not a child of NetBSD.
1996-09-28 22:46:35 +00:00
Bruce Evans
35ecc2f917 .DV -> .Dv (SOCK_STREAM was invisible). 1996-09-28 13:32:35 +00:00
Bruce Evans
246537139a .DV -> .Dv (FOPEN_MAX was invisible). 1996-09-28 13:18:12 +00:00
Poul-Henning Kamp
fab94ac15b Don't use malloc, pessimize to use sbrk.
fix sbrk manpage while we're at it.
1996-09-27 15:34:19 +00:00
Søren Schmidt
fa19f8481a Fix a typo.
Reviewed by:	 phk
1996-09-25 16:29:15 +00:00
Poul-Henning Kamp
ed3d429586 A number of minor bogons and portability things from jdp.
Submitted by:	jdp
1996-09-25 08:30:46 +00:00
Wolfram Schneider
e0e5145ce6 add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
Poul-Henning Kamp
1f05a9e73a phkmalloc/3
Various neat features added.  More documentation in the manpage.
If your machine has very little RAM, I guess that would be < 16M
these days :-(,  you may want to try this:
	ln -fs 'H<' /etc/malloc.conf
check the manpage.
1996-09-23 19:26:39 +00:00
Alexander Langer
97ea6d475a Fix typo from previous commit (tsvsec --> tv_sec). 1996-09-23 03:54:53 +00:00
Wolfram Schneider
374fc79d70 fix .Xr macro 1996-09-21 15:08:10 +00:00
Peter Wemm
a4f6eb33dd ".Xr chflags 1," -> ".Xr chflags 1 ," 1996-09-21 06:28:55 +00:00
Poul-Henning Kamp
5767b83cd3 Add the utrace syscall. 1996-09-20 13:55:25 +00:00
Nate Williams
34eeb76411 ts_sec -> tv_sec
ts_nsec -> tv_nsec
1996-09-20 06:06:28 +00:00
Poul-Henning Kamp
89e3b80fa2 Fix a very rare error condition: The code to free VM back to the kernel
as done after a quasi-recursive call to free() had modified what we
thought we knew about the last chunk of pages.
This bug manifested itself when I did a "make obj" from src/usr.sbin/lpr,
then make would coredump in the lpd directory.
1996-09-17 19:50:23 +00:00
Andrey A. Chernov
cb07d7668c Add comment explaining what function does
Cover strcoll return 0 case too
1996-09-17 19:27:06 +00:00
Bruce Evans
eaa86f9d7f Don't use __dead or __pure in user code. They were obfuscations
for gcc >= 2.5 and no-ops for gcc >= 2.6.  Converted to use __dead2
or __pure2 where it wasn't already done, except in math.h where use
of __pure was mostly wrong.
1996-09-14 03:00:32 +00:00
Paul Traina
e295af15d1 fwopen() argument type mis-described
Obtained from: NetBSD lib/2751 (der Mouse)
1996-09-13 19:14:12 +00:00
Peter Wemm
863a1dba3a Resync statfs struct with sys/mount.h. 1996-09-07 21:50:31 +00:00
Bill Paul
78cf917e3d Apply patch to fix +group YP overrides and prevent SEGV on badly
formatted groups (foo:*).
1996-09-05 12:27:24 +00:00
Andrey A. Chernov
98d7138100 Describe POSIX saved IDs behaviour better 1996-09-03 11:32:01 +00:00
Andrey A. Chernov
64839956f6 Describe current behaviour (_POSIX_SAVED_IDS are ON),
traditional BSD4.4 behavior (_POSIX_SAVED_IDS are OFF) was described
before.
Add some hooks to easily change this text when
POSIX_SAVED_IDS model will be changed.
1996-09-01 22:42:13 +00:00
Bruce Evans
e0c95ed947 Fixed the easy cases of const poisoning in the kernel. Cosmetic. 1996-08-31 16:52:44 +00:00
Bruce Evans
09a8dfa260 Don't depend in the kernel on the gcc feature of doing arithmetic on
pointers of type `void *'.  Warn about this in future.
1996-08-31 14:48:13 +00:00
Peter Wemm
f991bb5181 Sigh, back out the last bright idea I had here about compiling the res_*
routines from contrib/bind directly.  There were too many problems,
including having to add -DUSE_OPTIONS_H to the entire libc source in
order for the contrib code to pick up it's options, and so on.

Instead, I've merged the changes, libc is now self contained again.
1996-08-30 21:13:42 +00:00
Peter Wemm
bc7413d0a3 back out last two changes, this caused the mandoc pages to be replaced by
man pages.  I'll fold in the real changes in a seperate commit.
1996-08-30 19:40:05 +00:00
Peter Wemm
a4c5661fb7 oops, brain-lapse caused undefined symbol 1996-08-30 00:26:49 +00:00
Peter Wemm
fdf4c7af04 The last commit failed part-way through, re-add the generated
resolver man pages.
1996-08-29 22:13:00 +00:00
Peter Wemm
d72ca8598d Revert change to build the reolver man pages on the fly, install the
machine-generated versions
1996-08-29 22:06:51 +00:00
Wolfram Schneider
28eac3d225 function appeared in Version 7 AT&T UNIX
Obtained from: ftp://netlib.att.com/netlib/att/cs/v7man/man2
1996-08-29 21:24:19 +00:00
Peter Wemm
5ce1c533c7 Merge in bind-4.9.4-P1 resolver... 1996-08-29 20:08:19 +00:00
Bruce Evans
1f403fcfbf Cleaned up interrupt masking by declaring the state variable in a
machine-dependent macro and passing it to all machine-dependent
macros.

Eliminated the state variable for the GUPROF case.
1996-08-28 20:15:32 +00:00
Mike Pritchard
6c65d95969 Some minor man page cleanup. 1996-08-23 20:52:53 +00:00
Mike Pritchard
7a5396c1b0 Typo police. 1996-08-23 00:26:01 +00:00
Mike Pritchard
7bdf80e571 Correctly use .Fn instead of .Nm to reference function names
in a bunch of man pages.

Use the correct .Bx  (BSD UNIX) or .At (AT&T UNIX) macros
instead of explicitly specifying the version in the text
in a bunch of man pages.
1996-08-22 23:31:07 +00:00
Mike Pritchard
bf5a138ec4 Update a bunch of man pages to use .Fn instead
of .Nm when referencing funciton names.
1996-08-22 22:05:59 +00:00
Mike Pritchard
d9cd459bc6 List all of the include files required for getpeername and getsockname.
Closes PR# 1170.

Submitted by:	James Raynard <jraynard@dial.pipex.com>
1996-08-22 20:49:57 +00:00
Julian Elischer
5eaf55414c Submitted by: john birell (jb@cimlogic.com.au)
fixups for makefiles
and for Thread-safe sycalls
1996-08-22 04:25:09 +00:00
Julian Elischer
e0d898b48e Some cleanups to the callout lists recently added.
note that at_shutdown has a new parameter to indicate When
during a shutdown the callout should be made. also
add a RB_POWEROFF flag to reboot "howto" parameter..
tells the reboot code in our at_shutdown module to turn off the UPS
and kill the power. bound to be useful eventually on laptops
1996-08-22 03:50:33 +00:00
Mike Pritchard
a2d402aa3c Update some more man pages to use the .Fx macro. 1996-08-21 22:10:36 +00:00
Mike Pritchard
7b4e5796b9 Correctly document when getopt returns EOF and '?', and some other
minor cleanup.
1996-08-21 19:48:50 +00:00
Andrey A. Chernov
9d6a993656 Add Id
Move comment up to place
1996-08-20 21:16:53 +00:00
Andrey A. Chernov
a540d32bde Add isblank attr to non-break space
Add comment describing how upper half of table made
1996-08-20 14:43:58 +00:00
Andrey A. Chernov
59460dc4ff Remove isgraph attr from non-break space 1996-08-20 14:27:26 +00:00
Julian Elischer
0f7d684755 Submitted by: John Birrell <cimaxp1!jb@werple.net.au>
Here are the diffs for libc_r to get it one step closer to P1003.1c
These make most of the thread/mutex/condvar structures opaque to the
user. There are three functions which have been renamed with _np
suffixes because they are extensions to P1003.1c (I did them for JAVA,
which needs to suspend/resume threads and also start threads suspended).

I've created a new header (pthread_np.h) for the non-POSIX stuff.

The egrep tags stuff in /usr/src/lib/libc_r/Makefile that I uncommented
doesn't work. I think its best to delete it. I don't think libc_r needs
tags anyway, 'cause most of the source is in libc which does have tags.

also:

Here's the first batch of man pages for the thread functions.
The diff to /usr/src/lib/libc_r/Makefile removes some stuff that was
inherited from /usr/src/lib/libc/Makefile that should only be done with
libc.

also:

I should have sent this diff with the pthread(3) man page.
It allows people to type

make -DWANT_LIBC_R world

to get libc_r built with the rest of the world. I put this in the
pthread(3) man page.  The default is still not to build libc_r.


also:
The diff attached adds a pthread(3) man page to /usr/src/share/man/man3.
The idea is that without libc_r installed, this man page will give people
enough info to know that they have to build libc_r.
1996-08-20 08:22:01 +00:00
Sujal Patel
1bbb22c82e Reflect the removal of the kernel's FD_SETSIZE limit. 1996-08-20 07:26:20 +00:00
Wolfram Schneider
eddc44c480 A pipe function call appeared in Version *3* AT&T UNIX, not
Version 6. Close PR #1490

Obtained from: Peter H. Saulus in `A Quarter Century of UNIX', page 50
1996-08-18 11:28:16 +00:00
Mike Pritchard
53cd648388 Don't claim to be POSIX compliant, since our alarm function isn't. 1996-08-15 21:12:49 +00:00
Mike Pritchard
05bdf2ff0b NCARGS is defined as 65536 in the released system, not 20480. 1996-08-15 21:04:29 +00:00
Andrey A. Chernov
5feb86a405 Add Id 1996-08-14 19:47:02 +00:00
Peter Wemm
1ec21d5930 Fix nasty bracketing/precedence bug. Every time something read (and
refilled) a file that was either line- or un-buffered, all files were
flushed.  According to the code comment, the flush (according to ANSI)
is supposed to happen on write + line buffered output files, not _all_
files.

Obtained from: OpenBSD / Theo de Raadt, possibly from proven@cygnus.com
1996-08-13 17:49:45 +00:00
Andrey A. Chernov
c2bfae006a Back out fallback approximation changes, they are not so right to live 1996-08-13 17:03:18 +00:00
Andrey A. Chernov
2c4b0dffec Back out minor bumping per Peter suggestion 1996-08-13 14:37:53 +00:00
Andrey A. Chernov
83d8106e1a simplify/speedup/extend 1996-08-13 13:38:35 +00:00
Andrey A. Chernov
ce78364150 Bump minor number - new function added 1996-08-13 10:00:35 +00:00
Andrey A. Chernov
b339a4060f Remove old version hooks 1996-08-12 19:18:47 +00:00
Andrey A. Chernov
79deb12410 Convert to newly aded collate compare function 1996-08-12 18:49:54 +00:00
Andrey A. Chernov
883a3266d1 There is so many places where range comparation (using collate)
needed (much more than I think initially), so I forced to add
new user-visible non-standard function to libc.
1996-08-12 18:38:49 +00:00
Peter Wemm
ce70b6caf8 clear sockaddr_in's on stack before use
set sin_len
close one ftp port bounce attack
have rresvport() use bindresvport() rather than duplicate the code,
  rresvport() is a superset of bindresvport().

Obtained from: OpenBSD / Jason Downs / Theo de Raadt, minor tweaks by me.
1996-08-12 14:14:09 +00:00
Peter Wemm
cf2fcd35dd Use the more robust and more efficient reserved port allocation mechanism
now built into bind(2).

Obtained from: OpenBSD / Jason Downs / Theo de Raadt
1996-08-12 14:09:46 +00:00
Peter Wemm
54edc0bbbf clear various struct sockaddr_in's on stack, set sin_len.
(Noticed when comparing to OpenBSD source)
1996-08-12 14:00:26 +00:00
Andrey A. Chernov
36a00a4b79 Use collate for alpha character ranges 1996-08-12 04:03:50 +00:00
Andrey A. Chernov
c73ac73fb4 Remove static collcmp, use new internal function now 1996-08-12 03:51:16 +00:00
Andrey A. Chernov
89ec343a7f Remove static collcmp, ise new internal function now 1996-08-12 03:45:53 +00:00
Andrey A. Chernov
2eecfbac3a Add internal function __collcmp once instead of adding it statically
to many places in the libc
1996-08-12 03:40:37 +00:00
Andrey A. Chernov
b92a8919d1 Use collate for alpha character ranges 1996-08-12 02:00:56 +00:00
Andrey A. Chernov
5c551438ec Use collate data for national alpha character ranges like [a-z] 1996-08-11 16:08:17 +00:00
Andrey A. Chernov
3073507540 Short value is better for hash due to easy overflow in 8bit characters 1996-08-11 11:49:23 +00:00
Andrey A. Chernov
b5363c4a3b Use locale for character classes instead of hardcoded values
Misc 8bit cleanup
1996-08-11 11:42:03 +00:00
Mike Pritchard
2ce08cb20b Remove some hardcode *roff font change escape codes from
this man page to prevent half of it from coming out with underlines.

This man page needs to be gone over to fully convert it to mdoc format.

This closes PR#1440.

Submitted by:	Jens Schweikhardt <schweikhardt@rus.uni-stuttgart.de>
1996-08-06 22:42:23 +00:00
Mike Pritchard
47cc13c104 Correct the paramter type of the second argument to fgets.
Obtained from: NetBSD-bugs mailing list
1996-08-06 22:34:44 +00:00
Bruce Evans
66ff54bd17 Document that the relevant clock ticks are for the statistics clock
and that the statistics clock has a frequency of sysconf(_SC_CLK_TCK).
1996-07-30 17:32:49 +00:00
Bruce Evans
e96009446d Document that clock ticks are for the profiling clock and that the
clock frequency is stored in the gmon header.
1996-07-30 17:26:34 +00:00
Bruce Evans
446ee8014f Fixed description of _SC_CLK_TCK. Both the clock and the units
were wrong.
1996-07-30 17:15:09 +00:00
Bruce Evans
7d334687be Fixed comment about ru_maxrss. This field isn't an integral. 1996-07-30 17:06:44 +00:00
Peter Wemm
ef1c2ba16f Fix some of the problems that bde pointed out to me some time ago.
- buffer expansions were not working right due to a return code botch.
 - signed types instead of size_t's meant somebody else went and put
   casts in, I've changed the types to what they should have been.
1996-07-28 16:16:11 +00:00
Garrett Wollman
94b2b83ad5 Refer to the ASCII character 000 by its proper name, `NUL', and not
`NULL' (which should only be used in reference to null pointers).  Also
fix a cross-reference.
1996-07-25 18:31:08 +00:00
Garrett Wollman
2b3a38f6e5 Finish rename of KERN_DOMAINNAME to KERN_NISDOMAINNAME.
Suggested by: Keith Bostic
1996-07-25 18:03:53 +00:00
Paul Traina
8618ef52a2 Bring in fixes to db 1.85 from NetBSD. These fixes have been documented as
being sent back to Bostic by the NetBSD crew.
Obtained from: NetBSD-current
1996-07-21 02:23:13 +00:00
John Dyson
343999a1b9 Document madvise(2) as it is in FreeBSD. 1996-07-20 04:37:26 +00:00
Mike Pritchard
b4176c89f9 The previous change to alarm.3 to improve the wording
was still somewhat confusing and poorly worded.  So I took
the alarm.3 man page from NetBSD, which looked much
better all around.

Obtained from: NetBSD
1996-07-19 22:19:08 +00:00
Garrett Wollman
fe463a8fa7 Revert to old version of strftime.c; the new one doesn't work right. 1996-07-19 15:17:44 +00:00
Adam David
9584a298e4 the previous text was absurd, and wrong 1996-07-19 13:07:42 +00:00
Garrett Wollman
1ecaa8a894 Merge the recently-imported tzcode96h distribution (libc portion). The
part that does zic(8)/zdump(8) is still yet to be imported (but the old
zic and zdump will work just fine with these header files and the
data format has not changed).
1996-07-18 18:53:15 +00:00
Bill Paul
56d18eda29 In _yp_dobind(), if we find ourselves required to contact the local ypbind
directly in order to obtain binding information, check that the local
ypbind is using a reserved port and return YPERR_YPBIND if it isn't.
We should not trust any ypbind running on a port >= IPPORT_RESERVED;
it may have been started by a malicious user hoping to trick us into
talking to a bogus ypserv.

Note that we do not check the ypserv port returned to us from ypbind.
It is assumed that ypbind has already done a reserved port test (or not,
depending on whether or not it was started with -s); if we trust the
authenticity of the local ypbind, we should also trust its judgement.

Obtained from: OpenBSD
1996-07-13 20:23:13 +00:00
Garrett Wollman
fba5b1cc97 Include the proper header file (<unistd.h>) and declare [gs]etdomainname()
with the correct return type.  This does not include the renaming
of KERN_DOMAINNAME to KERN_NISDOMAINNAME.

Pointed-out-by: Keith Bostic
1996-07-12 19:55:20 +00:00
Jordan K. Hubbard
51295a4d3e General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 18:57:58 +00:00
Wolfram Schneider
e02dc2ce2b add references lstat(2), readlink(2), symlink(7) in section SEE ALSO 1996-07-07 12:52:51 +00:00
Poul-Henning Kamp
0d3f1a2a53 Isolated all the crap for thread-safe so I can see what goes on again... 1996-07-03 05:03:07 +00:00
Mike Pritchard
e9c032def8 Describe the "file pointer" in lseeks' man page a bit better
so that it is less likely someone will confuse it with a
"FILE *" type pointer.

Submitted by:	Based on James Raynard's patch
1996-07-03 02:55:10 +00:00
Mike Pritchard
8ae7d6b0cb Document the "sig" function parameter.
Submitted by:	James Raynard
1996-07-03 02:44:04 +00:00
Bruce Evans
95c715795a Fixed comparisons so that preposterously large (>= 0x80000000) brk values
aren't silently converted to minbrk.  This stops malloc(INT_MAX) from
dumping core.  Small values are still silently converted.  They should
be an error.  sbrk() doesn't do any range checking or conversions or
overflow checking.

Moved PIC_EPILOGUE invocation to a more natural place where it
obviously doesn't interfere with the comparison.
1996-06-25 18:54:42 +00:00
Gary Palmer
7dd9508fc2 Specify that daemon(3) returns int, and standardise the
phrasing in the ERRORS section a bit, as well as now specifying
the return status.
1996-06-22 23:46:00 +00:00
James Raynard
d748173277 Submitted by: Wolfram Schneider <wosch@cs.tu-berlin.de>
Document the fact that the tracefile argument must lead to a regular file.

Also took the opportunity to remove the spurious "Errors" entry
relating to filenames with the high-order bit set and add $Id$.

(More of the same to follow if there are no objections).
1996-06-22 18:05:15 +00:00
James Raynard
ce51cf0392 Suggested by: Bruce Evans, Jeffrey Hsu, Gary Palmer
Added $Id$'s to files that were lacking them (gpalmer), made some
cosmetic changes to conform to style guidelines (bde) and checked
against NetBSD and Lite2 to remove unnecessary divergences (hsu, bde)

One last code cleanup:-

Removed spurious casts in fseek.c and stdio.c.
Added missing function argument in fwalk.c.
Added missing header include in flags.c and rget.c.
Put in casts where int's were being passed as size_t's.
Put in missing prototypes for static functions.
Changed second args of __sflags() inflags.c and writehook() in vasprintf.c
from char * to const char * to conform to prototypes.

This directory now compiles with no warnings with -Wall under
gcc-2.6.3 and with considerably less warnings than before with the
ultra-pedantic script I used for testing. (Most of the remaining ones
are due to const poisoning).
1996-06-22 10:34:15 +00:00
Julian Elischer
6ede0fb59d Submitted by: archie@whistle.com
This program should COMPLAIN about uids > 65K but not abort.. they are after
all legal, and some of us NEED them!
1996-06-20 19:19:29 +00:00
Joshua Peck Macdonald
fc3be6aea0 I hate to read a man page that almost has useful information
but falls a little short.  I added a comment on the null
termination of struct group's gr_mem field.

Reviewed by:	jkh
1996-06-20 14:13:15 +00:00
Garrett Wollman
5900c00709 Add RCS Id and fix date. 1996-06-17 20:12:53 +00:00
Garrett Wollman
010b7c6c74 Cross-reference addr2ascii(3). 1996-06-17 20:11:12 +00:00
Garrett Wollman
276ea05394 Correct date and add $Id$ to reflect previous modification. 1996-06-17 20:04:06 +00:00
Garrett Wollman
538e87685f Cross-reference addr2ascii(3) and inlcude a note about how those
functions are preferred but are not widely available as yet.
1996-06-17 20:01:05 +00:00
Garrett Wollman
724ad64676 It would help if I actually added the source code for these routines. 1996-06-13 20:45:42 +00:00
Garrett Wollman
ffd1512db6 Add an independent implementation of addr2ascii(3) and ascii2addr(3)
following the API of the INRIA IPv6 implementation.
1996-06-13 20:45:05 +00:00
James Raynard
e2f892a7e7 Code cleanup:-
The usual stuff, adding missing function prototypes, argument types,
return values, etc.
1996-06-12 23:02:53 +00:00
James Raynard
45f6af0252 Code cleanup:-
The usual stuff, adding missing function prototypes, argument types,
return values, etc.

This directory now compiles with no warnings with -Wall on gcc2.6.3!
1996-06-12 22:59:55 +00:00
James Raynard
b83100194d Code cleanup:-
The usual stuff, adding missing function prototypes, argument types,
return values, etc. In mktemp.c, convert pid from u_int to pid_t, and
get rid of "extern int errno".
1996-06-12 22:58:21 +00:00
James Raynard
9915c09cf9 Code cleanup:-
The usual stuff, adding missing function prototypes, argument types,
return values, etc.
1996-06-12 22:56:41 +00:00
James Raynard
b2843ce288 Code cleanup:
Fixed a couple of nitpick warnings, plus one that slipped through the
net earlier.

This directory now compiles without any warnings with -Wall! (Until
the next gcc upgrade...)
1996-06-11 17:22:51 +00:00
James Raynard
f12d1a5dd0 Code cleanup:
1.  Added missing function prototypes.
2.  Added missing function return types.
3.  Added missing function argument types.
4.  Added missing headers for system function prototypes.
5.  Corrected format specifier in printf().
6.  Added extra parentheses around assignment used as truth value.
7.  Added missing "default" cases in switch statements.
8.  Added casts for function pointers.
9.  Did *not* change int declarations of uid and gid to uid_t/gid_t
    because I don't know if that would affect the protocol. Put in
    explicit casts to int instead, to make things more obvious.
10. Moved declarations of variables that are only used if YP is
    defined inside the '#ifdef YP' conditionals.
1996-06-10 20:13:09 +00:00
Poul-Henning Kamp
49f94c2dec Update man to tell that <sys/types.h> is needed.
Submitted by:	"Philippe Charnier" <charnier@lirmm.fr>
1996-06-10 15:48:07 +00:00
Bill Paul
2f5fc074d9 Remove extraneous '+' that looks like it was left in by mistake. This
module compiles now.

Reported by: Stephen Hocking
1996-06-10 04:59:05 +00:00
James Raynard
7d6a21b4d7 Code cleanup (part two):
1. Added missing function prototypes.
2. Added missing function return types.
3. Added missing function argument types.
4. Added missing headers for system function prototypes.
5. Corrected casts in select() args.
6. Got rid of more "extern int errno" rubbish.
7. Added extra parentheses around assignment used as truth value.
8. Fixed bug in clnt_{tcp, udp}create() where pointers could be free'd
    even if they hadn't been successfully malloc()'d.
1996-06-10 00:49:19 +00:00
Wolfram Schneider
17f47987b3 update sticky bit documentation 1996-06-09 20:53:00 +00:00
Andrey A. Chernov
45110ccfce Use better approximation if collate info not available.
Fix bug: strxfrm+strcmp != strcoll, if collate info not available
1996-06-09 14:56:08 +00:00
Andrey A. Chernov
2127ab9a07 Localize it.
(it was NOT localized initially, it does some trick instead!)
1996-06-09 13:31:06 +00:00
Joerg Wunsch
d230d4275a Reword the sentence about the required space for the result string.
Closes PR # 1303.-
1996-06-09 06:48:42 +00:00
James Raynard
c124f3bdfc Code cleanup (part one):
1. Added missing function prototypes.

2. Added missing function return types.

3. Added missing function argument types.

4. Added missing headers for system function prototypes.

5. Got rid of "extern int errno" rubbish.
1996-06-08 22:54:59 +00:00
Alexander Langer
1f16ebd9a2 Rephrase some things as suggested by Bruce. 1996-06-08 15:59:43 +00:00
James Raynard
1638d6b6d5 Oops, replace a rather important line that was lost in transit 8-( 1996-06-08 15:28:11 +00:00
Alexander Langer
79020cf23f Document that truncate can also be used to extend the size of a file,
but doing so is not truly portable.
1996-06-07 01:34:47 +00:00
James Raynard
b487e9d356 Submitted by: (based on code in "Advanced Programming in the Unix Environment"
by W.Richard Ste vens. EINTR handling suggested by bde@freebsd.org).

Code cleanup:

1. Add missing return type.
2. Replace 'union wait' by int.
3. Use Posix-style signal handling instead of signal().
4. Use fork() instead of deprecated vfork().
5. Block signals before fork()'ing, instead of after.
6. Return -1 if fork() fails, instead of 0.
7. Add EINTR handling for waitpid() call.

Also add claim of Posix conformance to man page.
1996-06-05 00:08:54 +00:00
James Raynard
ccbcef60f5 Code clean up:
Changed type of pid from int to pid_t. (Missed one!)
1996-06-04 17:35:15 +00:00
James Raynard
e75ad74a88 Code clean up:
Changed type of pid from int to pid_t.
1996-06-03 13:19:10 +00:00
James Raynard
0eb3435311 Code clean up:
Added missing headers for system functions.
1996-06-03 13:16:53 +00:00
Joerg Wunsch
d6c9f122c8 Minor corrections. The second parameter is actually of type int
(though only char will be used), and our implementation is not really
worse than the SysV one, so there's no need to claim so in the BUGS
section.
1996-06-03 10:40:39 +00:00
Bill Paul
a230877213 Make _yp_dobind() a litle smarter:
Now that we preserve RPC handles instead of rebuilding them each time
a ypcln function is called, we have to be careful about keeping our sockets
in a sane state. It's possible that the caller may call a ypclnt
function, and then decide to close all its file descriptors. This would
also close the socket descriptor held by the yplib code. Worse, it
could re-open the same descriptor number for its own use. If it then calls
another ypclnt function, the subsequent RPC will fail because the socket
will either be gone or replaced with Something Completely Different. The
yplib code will recover by rebinding, but it doing so it may wreck the
descriptor which now belongs to the caller.

To fix this, _yp_dobind() needs to label the descriptor somehow so
that it can test it later to make sure it hasn't been altered between
ypclnt calls. It does this by binding the socket, thus associating a port
number with it. It then saves this port number in the dom_local_port member
of the dom_binding structure for the given domain. When _yp_dobind() is
called again (which it is at the start of each ypclnt function), it checks
to see if the domain is already bound, and if it is, it does a getsockname()
on the socket and compares the port number to the one it saved. If the
getsockname() fails, or the port number doesn't match, it abandons the
socket and sets up a new client handle.

This still incurs some syscall overhead, which is what I was trying to
avoid, but it's still not as bad as before.
1996-06-01 05:08:31 +00:00
Bill Paul
217ae63218 Improve NIS performace of getservbyname() and getservbyport(). Both these
functions are implimented as wrappers around getservent(), which means it's
up to getservent() to do all the work. The NIS support in getservent()
only allows it to scan through the services.byname map one entry at a
time until it finds the requested service name/port. This can be painfully
slow due to the overhead involved (lots and lots of successive RPCs).

To fix this, we allow getservbyname() and getservbyport() to signal
getservent() that if NIS is turned on (there's a '+' in /etc/services),
the usual yp_first()/yp_next() linear search should be abandoned and
yp_match() used instead. This causes getservent() to immediately
locate the requested entry instead of wasting time groping through the
whole map.

The downside is that this trick is accomplished by exporting a couple of
pointers from getservent.c which getservbyname.c and getservbyport.c can
preset in order to tell getservent() what to do. If all three functions
were in the same source module, then the extra cruft could be delcared
static to avoid poluting the global symbol space. Maybe they should be
combined anyway. For now I've settled on prepending lots of underscores.
1996-06-01 04:40:42 +00:00
Peter Wemm
3ccd4a12e8 Use the setsockopt for IP_PORTRANGE to cause rresvport() to allocate a
privileged port within a single bind(), rather than looping through
attempts to bind over and over again over progressively lower ports.

This should speed up rlogin/rsh etc, and will probably cure some of the
strange rlogin hangs that have been reported in the past where rresvport()
managed to bind() to a port address that it shouldn't have.
1996-05-31 04:00:21 +00:00
Jordan K. Hubbard
941fbd30eb Fix bogus MLINKS line from vasprintf change. 1996-05-29 05:00:12 +00:00
Wolfram Schneider
01fc74a034 add manpage links
asprintf.3 -> printf.3
vasprintf -> printf.3
1996-05-29 01:00:00 +00:00
Wolfram Schneider
17753d1780 add manpage links:
des_setkey.3 -> crypt.3
des_cipher.3 -> crypt.3
err_set_exit.3 -> err.3
err_set_file.3 -> err.3
strunvis.3 -> unvis.3
1996-05-29 00:57:19 +00:00
Poul-Henning Kamp
8e3fab403b Use ld -O insted of ld -o + mv. 1996-05-28 16:24:53 +00:00
Peter Wemm
15aa00d597 Add an implementation of the gnu-ish asprintf() and vasprintf(). They are
not based on gpl'ed code, just prototype and usage.  I'm not 100% certain
they behave the same while the system is in trouble (eg: malloc() failing)
but in those circumstances all bets would be off anyway.

These routines work like sprintf() and vsprintf(), except that instead of
using a fixed buffer, they allocate memory and return it to the user
and it's the user's responsibility to free() it.  They have allocate as
much memory as they need (and can get), so the size of strings it can deal
with is limited only by the amount of memory it can malloc() on your
behalf.

There are a few gpl'ed programs starting to use this interface, and it's
becoming more common with the scares about security risks with sprintf().
I dont like the look of the code that the various programs (including
cvs, gdb, libg++, etc) provide if configure can't find it on the system.

It should be possible to modify the stdio core code to provide this
interface more efficiently, I was more worried about having something
that worked and was secure.  :-)  (I noticed that there was once intended
to be a smprintf() routine when our stdio was written for 4.4BSD, but it
looks pretty stillborn, and it's intended interface is not clear).  Since
Linux and gnu libc have this interface, it seemed silly to bring yet
another one onto the scene.
1996-05-27 10:49:43 +00:00
Marc G. Fournier
6859875c81 Removed false copyrights... 1996-05-27 06:54:03 +00:00
Marc G. Fournier
b0d57629f6 Added in appropriate Berkeley copyright and RCS Id: string
Closes PR#doc/536
1996-05-27 04:10:28 +00:00
Peter Wemm
b8953cdb9f Document that the superuser cannot override link() and unlink() on
directories, and mention that it was historical practice.
1996-05-24 16:32:11 +00:00
Mike Pritchard
712dc76e87 Fixed various problems: typos, grammer, missing include files
wrong function type declarations, and wrong argument type
declarations.
1996-05-23 01:05:25 +00:00
Bill Paul
dfe8e51c4d - Fix _listmatch() to close PR #1207.
Fix submitted by: Alan Cox <alc@cs.rice.edu>

- Nuke yet another free(result) that isn't needed. (This one I found
  without phkmalloc's help. :)
1996-05-21 16:11:27 +00:00
Garrett Wollman
6335830372 Fix for vfsload(3):
- Don't allow non-root users to specify LKMDIR.
- Don't allow any users to specify TMPDIR.
- Call /sbin/modload using execl() rather than execlp().
1996-05-17 15:35:13 +00:00
Bill Paul
2694f9b9a8 - Patch around amd core dump problem: don't allow yp_unbind() or _yp_unbind()
to call clnt_destroy() on a potentially NULL RPC handle. Somebody should
  bang on this a bit to make sure the problem is really gone; I seem to
  have difficulty reproducing it. Patch provided by Peter Wemm and
  slightly tweaked by me.

- Don't call _yp_unbind() in individual ypclnt functions unless we encounter
  an RPC error while making a clnt_call().
1996-05-16 18:01:17 +00:00
John Polstra
cbdc4399d2 Fix a bug caused by the collision of a local assembler label with another
use of the same label in a recently-introduced PIC_PROLOGUE.  This
should solve the recent core dumps from pdksh.
1996-05-11 13:28:11 +00:00
Peter Wemm
7f11212ef1 Fix a bogon in the pic + threadsafe version of cerror, it was missing
a PIC_EPILOGUE (leaving an extra long on the stack).

Submitted by: John Polstra <jdp@polstra.com>
1996-05-10 16:43:47 +00:00
John Polstra
08f4fc1aa8 Clarify the description of the FNM_PERIOD flag. 1996-05-10 00:28:34 +00:00
Poul-Henning Kamp
31d4757546 Make rules reentrant. 1996-05-09 11:30:51 +00:00
Wolfram Schneider
9fb933075e `mv'' -> `mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
1996-05-07 23:19:49 +00:00
Bill Paul
03cee47d84 Grrrr... yet another variation on Murphy's Law: the best way to find
bugs in your code is to put it in the -stable branch. (Corollary: the
day you discover the bug is the day the Internet decides to route your
telnet session to the repository box via Zimbabwe.)

Remove one bogus free(result) (from _havemaster()) that slipped by me.

Flagged by: phkmalloc
Pointed out to me by: Stefan Esser
1996-05-07 20:51:52 +00:00
Peter Wemm
f1703dfbaa Add support to enable libc to be compiled in ELF format. (#ifdef __ELF__)
In a nutshell, this macroizes the local/global symbol scoping rules
that are different in a.out and ELF.  It also makes the i386 assembler
stubs conform to i386 PIC calling conventions - the a.out ld.so didn't
object, but the ELF one needs it as it implements PIC jumps via PLT's as
well as calls.  The a.out rtld only worked because it was accidently
snooping the grandparent calling function's return address off the stack..

This also affects the libc_r code a little, because of cpp macro nesting.
1996-05-05 07:56:21 +00:00
Bill Paul
a169c9b1f9 NIS client-side performance tweak:
Each of the ypclnt functions does a _yp_dobind() when it starts and then
a _yp_unbind() when it finishes. This is not strictly necessary and it
wastes cycles: it means we do a new clnt_create() and clnt_destroy()
for each yp_whatever() call. In fact, you can do multiple clnt_call()s
using a single RPC client handle returned by clnt_create(). Ideally we only
have to create a handle to ypserv once (the first time we call a ypclnt
function) and then destroy it and rebind only if a call to ypserv fails.

- Modify _yp_dobind() so that it only creates a new RPC client handle
  when establishing a new binding or when one of the ypclnt calls
  invalidates an existing binding and calls _yp_dobind() to establish
  a new one.

- Modify the various ypclnt functions to only call _yp_unbind() if a
  call to ypserv fails.
1996-05-02 15:44:53 +00:00
Poul-Henning Kamp
0e51b8b85d Use PAGE_SIZE instead of NBPG 1996-05-02 08:43:37 +00:00
Poul-Henning Kamp
d71458ee72 Cache the result of getpagesize() so we only make one syscall.
Use getpagesize instead of CLBYTES.
1996-05-02 08:43:05 +00:00
Mike Pritchard
a251b9e77e Convert the time2posix man page to mdoc format. This still
needs some other cleanup, but it is good enough for now.
1996-05-01 23:17:27 +00:00
Mike Pritchard
417349c472 Fix a typo. 1996-05-01 22:49:36 +00:00
Mike Pritchard
eea782bac2 Remove a redundant description of the EMFILE error, and fix a typo.
Submitted by:	James Raynard <jraynard@dial.pipex.com>
1996-05-01 22:20:40 +00:00
Bruce Evans
50e9e20943 Fixed incomplete or wrong lists of prerequisite #includes related to
<sys/types.h>.
1996-05-01 01:45:23 +00:00
Bruce Evans
9c6e4f2a7c Fixed incomplete or wrong lists of prerequisite #includes related to
<sys/types.h>.
1996-05-01 01:40:04 +00:00
Bruce Evans
3a880d5ded Fixed a wrong prerequisite #include and a missing function-arg type. 1996-05-01 01:18:43 +00:00
Bruce Evans
6c0be88a57 Fixed misformatted #include (.Ft -> .Fd). 1996-05-01 01:04:44 +00:00
Bruce Evans
cdd84b0211 Fixed longstanding namespace convolution involving rune_t vs wchar_t.
If _ANSI_SOURCE or _POSIX_SOURCE is defined, then <ctype.h> had to
be included before <stddef.h> or <stdlib.h> to get rune_t declared.
Now rune_t is declared perfectly bogusly in all cases when <ctype.h>
is included.

This change breaks similar (but more convoluted) convolutions in the
stddef.h in gcc distributions.  Ports of gcc should avoid using the
gcc headers.
1996-05-01 00:40:10 +00:00
Bill Paul
88ce2dd1ef Very minor tweak:
In __initdb(), a failure to open the local password database is supposed
to result in a warning message being syslog()ed. This warning is only
supposed to be generated as long as the 'warned' flag hasn't been yet;
once the warning is generated, the flag should be set so that the message
is only syslog()ed once. However, while the state of the flag is checked
properly, the flag's state is never changed, so you always get multiple
warnings instead of just one.

Pointed out by: Peter Wemm
1996-04-29 14:48:47 +00:00
Bruce Evans
e0150c8ff7 Removed bogus includes of <sys/types.h> from synopses.
This commit covers the man pages for most of the ANSI library functions.
A few others such as strtol.3 have to mention <sys/types.h> because they
mix ANSI interfaces with less well designed extensions.
1996-04-19 19:00:26 +00:00
Bruce Evans
8a4599117b Don't include <sys/types.h> when it isn't used.
This commit covers most of the ANSI library functions. Many others only
need <sys/types.h> because they use u_xxx.
1996-04-19 18:40:25 +00:00
Bruce Evans
6da47fa518 Added `const' to types of sys_siglist and sys_signame. 1996-04-19 14:07:44 +00:00
Bruce Evans
6a59f3db1a Added `const' to types of sys_errlist and sys_nerr.
Use .Va instead of .Fa to describe these variables.

Say a little about inconsistent declarations of sys_errlist in the BUGS
section.
1996-04-19 14:02:03 +00:00
Sujal Patel
ea8c29e94b Fix the man page to reflect the recent addition of RFNOWAIT and the removal of
Plan9 specific flags.
1996-04-18 23:36:41 +00:00
Andrey A. Chernov
c0ea8ed12f Fix error in wcstombs: byte count not counted
Remove unneded casts in sgetrune/sputrune
Submitted by: wcstombs fix by Mihoko Tanaka <m_tonaka@pa.yokogawa.co.jp>
1996-04-18 07:01:46 +00:00
Joerg Wunsch
aed8797028 Document the possible EPERM return.
Submitted by:	imp@village.org (Warner Losh)
1996-04-17 20:49:29 +00:00
Bill Paul
94c53e1fb5 NIS cleanups and fixes, the next generation.
getnetgrent.c:

- Catch one bogon that snuck by: in _listmatch(), check for '\0'
  rather than '\n'; strings returned from yp_match() are terminated
  with a nul, not a newline.

getpwent.c:

- Rip out all of the +inclusion/-exclusion stuff from before and
  replace it with something a little less grotty. The main problem
  with the old mechanism was that it wasted many cycles processing
  NIS entries even after it already knew they were to be exlcuded
  (or not included, depending on your pointof view). The highlights
  of these changes include:

  o Uses an in-memory hash database table to keep track of all the
    -@netgroup, -user, and -@group exclusions.

  o Tries harder to duplicate the behavior normally obtained when using
    NIS inclusions/exclusions on a flat /etc/passwd file (meaning things
    come out in much the same order).

  o Uses seperate methods for handling getpwent() and getpwnam()/getpwuid()
    operations instead of trying to do everything with one general
    function, which didn't work as well as I thought it would.

  o Uses both getnetgrent() and innetgr() to try to save time where
    possible.

  o Use only one special token in the local password database
    (_PW_KEYYPBYNUM) instead of seperate tokens to mark + and -
    entries (and stop using the counter tokens too). If this new
    token doesn't exist, the code will make due with the standard
    _PW_KEYBYNUM token in order to support older databases that
    won't have the new token in them.

  All this is an attempt to make this stuff work better in environments
  with large NIS passwd databases.
1996-04-16 00:22:41 +00:00
Bill Paul
cbe78b44aa Fix a few NIS-related bogons:
- Clear the _yp_innetgr flag immediately after calling setnetgrent() from
  innetgr(). We only need the flag set to temporarily alter setnetgrent()'s
  behavior. Previously, it was being cleared too late.

- When in NIS-only mode, innetgr() was wasting time doing unecessary
  extra processing after it had already found a match.

- Remember to free memory allocated by the NIS functions during innetgr()
  searches.
1996-04-15 16:17:04 +00:00
Mike Pritchard
59f00bcdd9 Update the description of strncat to accurately describe how many
bytes are copied to the destination string.  Closes PR#1000.

Submitted by:	Dave Glowacki <dglo@ssec.wisc.edu>
1996-04-09 22:00:39 +00:00
Mike Pritchard
20631f47f1 Correct a minor typo. Fixes part of PR#1000.
Submitted by:	Dave Glowacki <dglo@ssec.wisc.edu>
1996-04-09 21:48:21 +00:00
Mike Pritchard
e40f3f85d4 Do not install the now unsupported netns and netiso
related man pages.  Comment out cross references to those man
pages from other man pages.
1996-04-08 05:15:09 +00:00
Mike Pritchard
edf0e5b3f8 Correct some man page xrefs, and some other minor changes to bring some
man pages up to mdoc guidelines and fix some minor formatting glitches.
Also fixed a number of man pages to not abuse the .Xr macro to
display functions and path names and a lot of other junk.
1996-04-08 04:18:31 +00:00
Mike Pritchard
906c1e27fc Correct some man page cross references and file location references. 1996-04-07 00:06:21 +00:00
Joerg Wunsch
29d221cde6 Mention other possible errors that could be caused by the F_[GS]ETOWN
commands.
1996-04-06 09:55:07 +00:00
Joerg Wunsch
9cb8a1050f Xref clocks(7). 1996-04-05 08:53:38 +00:00