Commit Graph

1636 Commits

Author SHA1 Message Date
Dmitrij Tejblum
7307d07db6 Added functions fseeko() and ftello() (from susv2).
Fixed fgetpos() and fsetpos() for offsets > 2GB.

PR:		8637
Submitted by:	 Dan Nelson <dnelson@emsphone.com> (adjusted by me a little)
1999-02-08 21:32:38 +00:00
Alexander Langer
255f294aa6 Document type for 'req' argument to clnt_control. 1999-01-31 16:13:25 +00:00
Joseph Koshy
8ad8dc79db Typo: kern.somaxconn' -> kern.ipc.somaxconn'
PR:		docs/9717
Submitted by:	Nathan Dorfman <nathan@rtfm.net>
1999-01-27 05:13:17 +00:00
Joseph Koshy
221188c6cb Clarify format of exit status code. Note when a return code of -1 can
be expected.

PR:		docs/9701
Submitted by:	Marc van Kempen <marc@bowtie.nl>
1999-01-27 03:54:09 +00:00
Julian Elischer
2907af2a96 Mostly remove the VM_STACK OPTION.
This changes the definitions of a few items so that structures are the
same whether or not the option itself is enabled. This allows
people to enable and disable the option without recompilng the world.

As the author says:

|I ran into a problem pulling out the VM_STACK option.  I was aware of this
|when I first did the work, but then forgot about it.  The VM_STACK stuff
|has some code changes in the i386 branch.  There need to be corresponding
|changes in the alpha branch before it can come out completely.

what is done:
|
|1) Pull the VM_STACK option out of the header files it appears in.  This
|really shouldn't affect anything that executes with or without the rest
|of the VM_STACK patches.  The vm_map_entry will then always have one
|extra element (avail_ssize).  It just won't be used if the VM_STACK
|option is not turned on.
|
|I've also pulled the option out of vm_map.c.  This shouldn't harm anything,
|since the routines that are enabled as a result are not called unless
|the VM_STACK option is enabled elsewhere.
|
|2) Add what appears to be appropriate code the the alpha branch, still
|protected behind the VM_STACK switch.  I don't have an alpha machine,
|so we would need to get some testers with alpha machines to try it out.
|
|Once there is some testing, we can consider making the change permanent
|for both i386 and alpha.
|
[..]
|
|Once the alpha code is adequately tested, we can pull VM_STACK out
|everywhere.
|

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 02:49:52 +00:00
Julian Elischer
88c5ea4574 Enable Linux threads support by default.
This takes the conditionals out of the code that has been tested by
various people for a while.
ps and friends (libkvm) will need a recompile as some proc structure
changes are made.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 02:38:12 +00:00
Andrew Gallatin
f0f3d5af23 gethostbyname2() was broken for lookups via NIS on FreeBSD/alpha
due to _gethostbynis() setting h.h_length to sizeof(u_long), which
works out to 8 on alphas.  And 8!= NS_INADDRSZ.
1999-01-25 03:26:45 +00:00
Bruce Evans
57687b2e1f Backed out most of previous commit to go with backing out support for
revoke() on non-device files.
1999-01-24 06:43:30 +00:00
Garrett Wollman
6efae010ca Merge from vendor branch: timezone file structure changes and doco.
Fix localtime.c to deal with new magic number field.

Obtained from: ftp://elsie.nci.nih.gov/pub/tzcode1999a.tar.gz
1999-01-21 17:22:59 +00:00
John Polstra
83068b622c Install man page link for strtok_r. 1999-01-19 23:45:48 +00:00
John Polstra
32150a6766 Spell check and minor grammar fix. 1999-01-19 23:42:44 +00:00
Don Lewis
3146a70d74 Document the errno return if the restrictions on the fcntl(F_SETOWN, ...)
argument implemented by the security patch in PR kern/7899 are violated.
PR:		kern/7899
1999-01-19 09:33:14 +00:00
Joseph Koshy
8425e985b7 revoke(2) is supported on regular files under current. Change wording
in manual page that indicated otherwise.

PR:		docs/9517
Submitted by:	David Malone <dwmalone@maths.tcd.ie>
1999-01-18 02:37:03 +00:00
Dag-Erling Smørgrav
a135bdb9a0 Use the correct type for uid and gid in struct passwd. Document it. 1999-01-18 02:14:20 +00:00
Dag-Erling Smørgrav
eec1dbe6ce Make the implementation and documentation agree. Specifically:
- document that sysctl() and sysctlbyname() return 0 on success

 - if the provided buffer is too small, set errno to ENOMEM and return -1
   instead of returning ENOMEM.
1999-01-06 18:11:53 +00:00
Dmitrij Tejblum
de16000123 Make ctime_r, asctime_r, gmtime_r, and localtime_r available in libc. 1999-01-04 20:45:20 +00:00
Garrett Wollman
600c04ff93 Add STANDARDS section.
s/bytes/characters/g to be consistent with Standard C terminology.
Update date and add RCS Id.
1999-01-03 01:07:41 +00:00
Garrett Wollman
5b9e6e493e Fix grammar in the description of timegm() by totally rewriting it. Remove
a potentally inflammatory comment from BUGS, and add a more useful comment
about the lack of reentrancy in the timezone-setting interface.
1999-01-03 00:35:31 +00:00
Bruce Evans
2e4513990b Ignore the fs_spec entry for "/" in /etc/fstab if the device which
is actually mounted on "/" can be determined using statfs() and is
in /dev.  This fixes fsck operating on the wrong device when the
fs_spec entry is only an alias.  The aliased case became more
dangerous when the ROOTSLICE_HUNT hack was committed in mount(8).
ROOTSLICE_HUNT may be unnecessary now.
1999-01-01 14:14:44 +00:00
Bruce Evans
d82478ba84 Updated type of ss_size in struct sigaltstack.
Removed bogus prerequisite <sys/types.h>.
1999-01-01 12:22:11 +00:00
Doug Rabson
6b387220be [This is a null commit to supply the correct log entry]
Rename 'cerror' to '.cerror' so that programs which have a function or
global variable named 'cerror' don't completely break the syscall error
reporting mechanism.
1998-12-23 11:55:42 +00:00
Doug Rabson
b7f762137a Implement fpsetmask() and other fp*() functions. Programs should use
#include <ieeefp.h>

to access these functions instead of the i386 specific

	#include <machine/floatingpoint.h>

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-12-23 11:50:52 +00:00
Wes Peters
a8e94191e8 Added documenation for the existing implementation of asctime_r,
ctime_r, gmtime_r, and localtime_r.
1998-12-20 06:22:06 +00:00
Julian Elischer
6626c6045c Reviewed by: Luoqi Chen, Jordan Hubbard
Submitted by:	 "Richard Seaman, Jr." <lists@tar.com>
Obtained from:	linux :-)

Code to allow Linux Threads to run under FreeBSD.

By default not enabled
This code is dependent on the conditional
COMPAT_LINUX_THREADS (suggested by Garret)
This is not yet a 'real' option but will be within some number of hours.
1998-12-19 02:55:34 +00:00
Eivind Eklund
70efdda93d Note that dying on NULL is an implementation detail. 1998-12-17 17:13:47 +00:00
Eivind Eklund
630dc76f4e Restore old semantics (broken in rev 1.47's buffer overflow fix). 1998-12-17 16:31:02 +00:00
Bruce Evans
d529713846 Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This is
an unimprovement here.  I thought it would be an improvement, as in libkvm,
but here we can access the strings directly.

Use sysctlbyname() instead of sysctl() and trust it to give a nonzero
address if it succeeds.
1998-12-16 17:34:05 +00:00
Warner Losh
81e4e6a2d6 Add reminder to return memory allocated by this call.
Obtained from: OpenBSD
1998-12-16 04:39:23 +00:00
Wes Peters
b1e12513fa Reviewed by: JKH
Submitted by:	Wes Peters

Added strtok_r (reentrant) function and man page.
1998-12-14 05:11:26 +00:00
Steve Price
4c1a815f94 Commit out caveat about hardlinks to directories since they are
no longer possible.

PR:		8337
1998-12-13 23:35:01 +00:00
Matthew Dillon
9a0d08d599 PR: docs/9050
Add reference to required include file #include <stdlib.h> for
    getloadavg(3) function call.
1998-12-13 02:34:56 +00:00
John Birrell
b6776b7488 CALL -> PCALL for sigaltstack for libc_r. 1998-12-10 20:36:24 +00:00
Bruce Evans
0fe8d9f3dd Removed unused include of <kvm.h>. It was alarming for libc to apparently
depend on libkvm.

Removed obsolete `#define _NEW_VFSCONF'.
1998-12-07 11:26:28 +00:00
Nate Williams
738006fa2c - Fix modulo bug that was masked by the correct code in libgcc.a which is
used in almost all programs unless a shared library specifically
  ignores libgcc.a.
1998-11-30 20:25:37 +00:00
Joseph Koshy
2d08e623c1 Enable aio_read(2). 1998-11-24 08:15:08 +00:00
Joseph Koshy
5f67a9c8a1 Don't mention exit(3) in explanation; _exit(2) is a better choice. 1998-11-23 03:23:14 +00:00
Joseph Koshy
cbffe59841 Man page for aio_read(2).
Submitted by:	Terry Lambert <terry@whistle.com> on the -doc lists.
1998-11-19 04:07:55 +00:00
Jacques Vidrine
90d1ac3b67 Update to reflect reality.
PR:		kern/8629
1998-11-16 03:49:39 +00:00
Joseph Koshy
bee0365a4a Fix a .Nm -> .Fn fix that was missed in the previous commit.
Pointed-out-by:	Bruce Evans
1998-11-09 06:52:46 +00:00
David Greenman
adcac26551 Added info about non-blocking support. 1998-11-06 19:35:58 +00:00
Joseph Koshy
41a3e3b022 Update manual page to reflect changes in rev 1.12 of
"src/lib/libc/gen/popen.c" --- popen() in the child
now closes any copies of popen()'ed descriptors in the parent.
1998-11-06 07:09:22 +00:00
David Greenman
eff8678df3 Added a manual page for sendfile(2). 1998-11-05 14:43:29 +00:00
Robert Nordier
8d2c3c32bd Include mergesort() in description of errors. 1998-11-04 09:27:03 +00:00
Robert Nordier
df5a1b840e Drop unused labels. 1998-11-04 09:22:07 +00:00
Robert Nordier
7fb5f2bae4 Handle a zero elements argument.
PR:		8566
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-11-04 08:55:34 +00:00
Peter Wemm
86854f0360 A feeble attempt at kld compatability. The mount_* programs assume that
they cannot mount a filesystem that they cannot see in getvfsbyname().
Part 1 of this is a hack, make vfsisloadable() always return true - the
ultimate decider of whether it's loadable or not is kldload() or mount().
Part 2 of this is to have vfsload() call kldload(2) and return success if
it works.  This means that we will use a viable kld module in preference
to an LKM!
Ultimately, the thing to do is remove the hacks to do a vfsload in all the
mount_* commands and let the kernel do it by itself in mount(2).
1998-11-03 15:02:29 +00:00
Jean-Marc Zucconi
65f14a74bd Typo. 1998-10-30 23:50:48 +00:00
Mike Smith
ebed2088fe Prevent buffer overflow in getpwnam()
PR:		bin/8176
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-10-29 23:16:24 +00:00
Robert Nordier
30af884929 Clarify processing of the string argument by psignal(). 1998-10-29 22:17:46 +00:00
Robert Nordier
4a3bc52a9c (Whoops: make it better instead of worse this time). Clarify
processing of the string argument by perror().
1998-10-29 22:08:59 +00:00
Robert Nordier
94cc971811 Clarify processing of the string argument by perror(). 1998-10-29 21:59:38 +00:00
Robert Nordier
e524a581b1 Check for a zero-length as well as a NULL string argument. 1998-10-29 14:40:20 +00:00
Robert Nordier
d223b5868e The man page implies that the string argument to psignal() may be
NULL, in line with perror(3).  However, the code presently checks only
for a zero-length string.  Check for both.
1998-10-29 11:39:39 +00:00
John Polstra
76a2643efb Handle ELF symbols better. This fixes "vmstat -i" for the case
where "/var/db/kvm_kernel.db" doesn't exist.
1998-10-28 06:37:49 +00:00
Bill Fenner
551677729e ('): and ('); -> (:') and (;') 1998-10-26 19:36:38 +00:00
David E. O'Brien
2100aed918 Slight style police.
Add some content from objformat(1).
1998-10-25 13:29:57 +00:00
Andrey A. Chernov
a4beee718b fix unsigned overflow
PR: 8437
1998-10-25 05:06:42 +00:00
Dima Ruban
964b832929 Fix types. 1998-10-21 09:48:35 +00:00
Peter Wemm
ed1bbda829 Revert last change. mkstemp() wasn't to blame, it's nvi. However,
mkstemp() is not behaving as documented.
1998-10-20 15:33:21 +00:00
Peter Wemm
eb356f9af0 Stop mk*temp() from being pathologically stupid in the face of a umask(0);
There are other ways to fix this than wrapping _gettemp(), but this was
the most convenient.

Discovered by: bde
1998-10-20 12:36:36 +00:00
Dag-Erling Smørgrav
af806462dc Fix style issues in execl(), and make execle() vfork()-safe.
Reviewed by:	bde
Approved by:	jkh
1998-10-15 17:14:15 +00:00
Mike Smith
26c51fb453 Conform to POSIX and close any copies of popen() descriptors inherited by a
popen()ed child.

PR:		misc/7810
Submitted by:	Wayne Scott <wscott@ichips.intel.com>
1998-10-15 01:47:40 +00:00
Dag-Erling Smørgrav
7ea577e550 Correct braino in previous commit. I get the pointy hat again. 1998-10-14 20:23:40 +00:00
Dag-Erling Smørgrav
dea625c872 Make execl() vfork()-safe. This should fix potential bugs in rcp,
telnet and tip, and probably a few other apps.

Reviewed by:	bde
Approved by:	jkh
1998-10-14 18:53:36 +00:00
Peter Wemm
0c372549f6 Avoid the need for calling functions that malloc after a vfork(). 1998-10-11 14:11:51 +00:00
Bruce Evans
0890dc6f44 vfork -> fork. The child calls execl() which calls malloc(), so
vfork() can't be used.  We could use alloca() in execl() so that
it can be called between vfork() and execve(), but a "portable"
popen() shouldn't depend on this.  Calling execle() instead of
execl() should be fairly safe, since execle() is supposed to be
callable from signal handlers and signal handlers can't call
malloc().  However, execle() is broken.
1998-10-10 19:30:45 +00:00
Eivind Eklund
b41c848d46 Remove the description of EBADF (that's an implementation detail if I
ever saw one), and move the description of NULL behaviour out to a
'NOTES' section, with an extra note that programs should not rely up
on it.

Kinda-approve-by:	bde (by not replying to the mail with the diff)
1998-10-10 13:31:32 +00:00
Julian Elischer
29595ffd90 Fix a memory leak
PR: 7923
Submitted by: Archie Cobbs <archie@whistle.com>

        The scandir() function returns -1 if it fails.
	In many cases when this happens, it does not free
	the memory that it allocated, resulting in a memory
	leak, or close the directory opened with opendir().
	BAD DOG, BAD!
1998-10-07 01:30:02 +00:00
Doug Rabson
e0ce825e94 64bit portability fixes.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-10-05 18:35:04 +00:00
Eivind Eklund
aef1f383cf program written under FreeBSD -> programs written under FreeBSD
Noticed by:	Alex Nash <nash@mcs.net>
1998-10-03 16:17:30 +00:00
John Birrell
a0aa389007 Delete the XXX comments that refer to spinlock recursion. The malloc/free/
realloc functions check for recursion within the malloc code itself. In
a thread-safe library, the single spinlock ensures that no two threads
go inside the protected code at the same time. The thread implementation
is responsible for ensuring that the spinlock does in fact protect malloc.
There was a window of opportunity in which this was not the case. I'll fix
that with a commit RSN.
1998-09-30 06:13:59 +00:00
Joseph Koshy
7669e9013b `kern.maxproc' is not changeable from sysctl(8).
Reminded by:	Bruce Evans <bde@zeta.org.au>
1998-09-29 05:16:45 +00:00
Eivind Eklund
8bd4c21699 Document that we will core-dump on getting a NULL pointer. 1998-09-28 15:34:24 +00:00
Doug Rabson
f0a3692000 Don't cast int pointers to long pointers when reading labels from
/etc/disktab.
1998-09-26 14:44:06 +00:00
David E. O'Brien
5846581c2e Apply patch to properly sscanf(3) when there is whitespace in the format
string.  From the submitted patch:

Credit for patch:	Chris Torek <torek@bsdi.com>
			Tod Miller  <millert@openbsd.org>

This makes us in line with SunOS 4.1.3_U1, Solaris 2.6, OpenBSD 2.3,
HP-UX 10.20, Irix 5.3.  The previous behavior was in line with Ultrix 4.4.

PR:		bin/7970
Submitted by:	Niall Smart nialls@euristix.ie
1998-09-25 12:20:27 +00:00
Doug Rabson
cea1d019fe Use 8k pagesize on alpha, not 4k. 1998-09-23 21:26:04 +00:00
Alexander Langer
d988805a1f Back out part of previous commit (even though it's technically correct).
Our spinlock implementation allows a particular thread to obtain a lock
multiple times, but release the lock with a single unlock call.  Since
we're detecting recursion, we know the lock is already owned by the
current thread in a previous call and must not be released in the
current call.  This is really far too dependent on this particular
spinlock implementation, so I've added commented out calls to
THREAD_UNLOCK in the appropriate places.  We can activate this code when
spinlock is taught to count each lock operation.
1998-09-20 01:07:50 +00:00
Alexander Langer
366248e086 Correctly back out of free if a recursive call into malloc.c is detected.
Set malloc_func *after* grabbing the thread lock.

Noticed by:	Simon Coggins <simon@oz.org>
1998-09-19 20:55:36 +00:00
Luoqi Chen
ae45749a50 Simplify implementation and eliminate a register preservation problem.
Reviewed by:	Bruce Evans <bde@zeta.org.au>
1998-09-18 05:50:52 +00:00
Poul-Henning Kamp
8d54281ce7 s/yellow pages/NIS/
PR:		7949
Reviewed by:	phk
Submitted by:	Norihiro Kumagai <kuma@jp.freebsd.org>
1998-09-17 08:29:16 +00:00
Joseph Koshy
0a843f2afb Sort table and descriptions.
Pointed out by: bde
1998-09-16 07:25:34 +00:00
Warner Losh
e8420087b0 Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
1998-09-16 04:17:47 +00:00
Warner Losh
e70c6df958 o Don't reference non-existant function freealloc.
o Properly order things

Pointed out by: bde
1998-09-16 04:07:31 +00:00
Warner Losh
9a5722f2e8 Fix style problems noted by Bruce:
o No copyright on reallocf.
	o Order makefile list correctly.
	o indent reallocf properly.
1998-09-16 03:16:06 +00:00
Dmitrij Tejblum
b5acd0014e Don't initialize NIS until it is really necessary. Now, in case of network
or NIS server problems, local user can login without a pause.

Also, -Wsomething cleanup.
1998-09-15 16:22:30 +00:00
Joseph Koshy
61a4defd54 Turn off replies to ICMP echo requests for broadcast and multicast
addresses by default.

Add a knob "icmp_bmcastecho" to "rc.network" to allow this
behaviour to be controlled from "rc.conf".

Document the controlling sysctl variable "net.inet.icmp.bmcastecho"
in sysctl(3).

Reviewed by: dg, jkh
Reminded on -hackers by: Steinar Haug <sthaug@nethelp.no>
1998-09-15 10:49:03 +00:00
Garrett Wollman
75a21a3859 Replace accidentally-deleted `x' which caused warnx() to misbehave. 1998-09-15 01:49:32 +00:00
Joseph Koshy
6e2affc98f Correct a typo that I noticed. 1998-09-15 00:24:19 +00:00
Warner Losh
b8a328fc74 o use strncpy safely
o Only allow options and domain name to be set when we aren't running
  setuid.

Obtained from: OpenBSD
1998-09-14 21:13:06 +00:00
Warner Losh
94ad719cf4 Add reallocf to the library. This function is simliar to realloc, but
when it returns NULL to indicate failure, it will also free the memory
that was passed to it, if that was non-null.

This does not change the semantics of realloc.

A second commit will be done to commit the conversion of those places in
the code that can safely use this to avoid memory leaks when confronted
with low memory situations.

Beaten-to-death-but-finally-approved-in: -current
1998-09-14 20:34:34 +00:00
Luoqi Chen
02bc6ef2c8 Fix a cut 'n paste mistake. 1998-09-13 20:32:45 +00:00
Dmitrij Tejblum
deb9688ae1 In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an alias
to fork. It is difficult to do real vfork in libc_r, since almost every
operation with file descriptsor changes _thread_fd_table and friends.

popen(3) works much better with this change.
1998-09-12 22:03:20 +00:00
Garrett Wollman
48f4157055 Document the fact that shutdown(2) is expected to comply with Posix.1g,
when it happens.
1998-09-12 21:38:30 +00:00
Dmitrij Tejblum
f0cefaccae Change return type of strptime from const char* to char*.
const char* was wrong and nonstandard.
1998-09-12 21:13:29 +00:00
Garrett Wollman
b4b4fb871e A small last-minute iitem for 3.0:
- Fix some style errors I made back in 1995.

- Add a new flavor of the err(3) family, which takes an explicit
  errno argument rather than implicitly examining errno.  This
  will make it easier to use these functions in conjunction with
  modern library interfaces that return an errno value explicitly.
1998-09-12 21:02:22 +00:00
Joseph Koshy
05e13b1b5d Use ellipsis in synopsis.
Requested by: bde
1998-09-12 01:27:34 +00:00
Warner Losh
aa1b326112 $@ -> ${.TARGET} 1998-09-11 05:34:37 +00:00
Warner Losh
df196cc87c Change obsolete $@ to ${.TARGET}. 1998-09-11 05:31:45 +00:00
Warner Losh
77740e7e34 Don't trust TMPDIR if we're setuid root. This is used only for the
backing file for an anonymous (memory based) btree, and I don't think
that any setuid programs actually use it, but it is better to be safe
than sorry.  This has been in my tree for a long time, maybe a year or
more...

Inspired by: Similar changes in OpenBSD, if memory serves (like nearly
a year ago)
1998-09-11 05:29:47 +00:00
Brian Somers
8456d89b54 Mention which system interface functions are signal-safe.
Suggested on -current by: Terry Lambert <tlambert@primenet.com>
1998-09-09 20:44:51 +00:00
Guy Helmer
b697833cb3 Document a number of VM sysctl variables with help from old emails
written by John Dyson.
1998-09-09 18:36:14 +00:00
KATO Takenori
d22114bfb8 Change i386 in a few paths to ${MACHINE} to support MACHINE=pc98. 1998-09-09 11:22:28 +00:00
Joseph Koshy
3d2b8efaa1 Add $Id$, remove quoting for `...'.
Requested by: bde
1998-09-09 01:30:25 +00:00
John Polstra
cfa4d73988 Add a new library function getobjformat(). It checks all the
standard places ("/etc/objformat", ${OBJFORMAT}, argv) for an
indication of the user's preferred object file format.  This
consolidates some code that was starting to be duplicated in more
and more places.

Use the new function in ldconfig.

Note: I don't think that gcc should use getobjformat(), even though
it could.  The compiler should limit itself to functions that are
widespread, to ease porting and cross-compilation.
1998-09-09 01:21:25 +00:00
David E. O'Brien
c304ad8a23 Add support for the RPC 64-bit integer type ``hyper''. 1998-09-08 17:33:12 +00:00
Andrey A. Chernov
7f41a65ede restore rev 1.23 to give clear SIGALRM handling example, 68 years
are too long to affect real code
1998-09-08 09:44:46 +00:00
Joseph Koshy
434f577807 Use ellipsis in the synopsis, and an appropriate explanation in
the text of the manual page.

Suggested by: bde
1998-09-08 02:02:50 +00:00
Matthew Dillon
49d6409ac7 Reviewed by: Andrey A. Chernov <ache@nagual.pp.ru>, Doug Rabson <dfr@nlsystems.com>
Rewrote sleep() to remove int/long typing assumptions between the argument
    to the function and the timespec structure.
1998-09-06 09:11:06 +00:00
Joseph Koshy
fe6894b6dc Use a varargs style prototype in the manual page, with accompanying
explanation in the text.
1998-09-06 08:50:49 +00:00
John Birrell
ae59c2591e Use INT_MAX instead of LONG_MAX since the variable being compared
is an int, not a long.
1998-09-05 08:01:26 +00:00
John Birrell
9b801a0d86 Change a test for NETBSD_SYSCALLS to __alpha__. We're not ready to
do profiling on alpha yet.
1998-09-05 07:57:43 +00:00
John Birrell
683728f17d Change the profile data file name from gmon.out to progname.gmon
where progname comes from __progname in crt0 or crt1.
1998-09-05 07:56:36 +00:00
John Polstra
cb690d1f0b Implement the weak aliases for private entry points in the inet_*
and res_* modules in a way that works for ELF.  I moved the aliases
out of res_stubs.c and into the individual modules where the entry
points are defined.  Weak aliases don't work in ELF unless that is
the case.  (Actually, I'm surprised it worked for a.out.)

This should fix the undefined "inet_addr" and related symbols in
various applications that fail to include <arpa/inet.h> or
<resolv.h> as they are supposed to do.
1998-09-02 00:53:17 +00:00
Wolfram Schneider
acd8019083 Sort cross references. 1998-08-31 16:41:09 +00:00
Joseph Koshy
1380f780e0 Typo fix. 1998-08-28 04:36:21 +00:00
Steve Price
93bb6f1172 Describe what constitues an exceptional condition.
PR:		7666
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-08-24 01:09:34 +00:00
Doug Rabson
744857bc1c Update to use the new elf headers. 1998-08-17 08:47:19 +00:00
John Birrell
b4869285da Remove support for NetBSD syscalls. 1998-08-17 03:46:10 +00:00
John Birrell
4f27f01e1d Remove the comment about how to get NetBSD syscalls since there are
now programs built on alpha that _must_ use FreeBSD syscalls to work.
1998-08-17 03:35:09 +00:00
Poul-Henning Kamp
38a0ff129f Add missing #include of <sys.types.h> 1998-08-15 20:53:34 +00:00
Poul-Henning Kamp
7a55a3c230 I have added the support for BIG5 encoding into libc/libxpg4/mklocale.
the diff is attached below. This is done on the 3.0 source-tree.
I have test this on 2.2-stable before, but I don't have a 3.0 machine
right now.

This patch is mainly to make libc support BIG5 encoding, thus add
zh_TW.BIG5 locale to 3.0.

Submitted by:	Chen Hsiung Chan <frankch@waru.life.nthu.edu.tw>
1998-08-15 12:51:49 +00:00
John Birrell
57eec98d62 If using FreeBSD syscalls, handle the syscalls that don't require
default asm code the same way as on i386.
1998-08-08 02:25:46 +00:00
John Birrell
2a957ed7cc Include FreeBSD's syscall.h if not using NetBSD syscalls. 1998-08-08 02:24:03 +00:00
John Birrell
dc43d96540 Allow for the fact that NetBSD syscalls are no longer the default. Call
sigaltstack by default if using FreeBSD syscalls.
1998-08-08 02:20:24 +00:00
John Birrell
920ee4896e Make NetBSD compatibility conditional on NETBSD_SYSCALLS being defined.
This is no longer the default.
1998-08-08 02:18:07 +00:00
John Birrell
61020cc681 References to NetBSD syscalls changed to just a comment about what to
add to /etc/make.conf to use FreeBSD's libc with a NetBSD/Alpha kernel.

From now on, FreeBSD/Alpha is just FreeBSD.
1998-08-08 02:14:45 +00:00
Bruce Evans
90afb6a523 Fixed bitrot in prototypes in synopsis. 1998-08-03 17:52:27 +00:00
Bruce Evans
71101898e8 Fixed missing header in synopsis. 1998-08-03 16:29:31 +00:00
Bruce Evans
8023e3dd93 isnetworktty -> isnettty. ttyent.h has already gone through 3
revisions to match the confusing spelling in getttyent.c (1 to
break it to match the man page and 1 in each of 2 branches to fix
it).  This function seems to be orphaned and unused.
1998-08-03 15:35:41 +00:00
Bruce Evans
92f896a9cc Fixed printf format errors. 1998-08-02 14:41:34 +00:00
Bruce Evans
5b632b56e5 Fixed disordering in previous commit. 1998-07-29 13:43:06 +00:00
Tim Vanderhoek
542f2aacfa Add missing period. We don't allow maternity leaves. 1998-07-29 05:13:39 +00:00
Jonathan Lemon
525187f914 u_int --> unsigned int, remove (now unneeded) <sys/types.h> 1998-07-28 15:22:51 +00:00
Jonathan Lemon
8d0517cffd oops, forgot to do ``cvs add'' first. 1998-07-28 03:39:04 +00:00
Jonathan Lemon
f88a03565a Add wrappers for i386_*_ioperm, i386_vm86 so userland code does
not have to call sysarch() directly.
Added man pages for above, as well as sysarch()
1998-07-28 03:33:27 +00:00
Andrey A. Chernov
dfb1b7aea6 Provide meaningful errno value on error return 1998-07-14 18:27:43 +00:00
Bruce Evans
37889b394a Changed to the C9x draft spelling of the (unsigned) integral type
suitable for holding object pointers (ptrint_t -> uintptr_t).
Added corresponding signed type (intptr_t).  Changed/added
corresponding non-C9x types for function pointers to match.  Don't
use nonstandard types to implement these types, and don't comment
on them in <machine/types.h>.
1998-07-14 05:09:48 +00:00
Bruce Evans
930a642372 Oops, fptrint_t still needs to be declared in <machine/profile.h> in the
!KERNEL case.  The kludge to get it declared in libc/gmon/mcount.c wasn't
sufficient because fptrint_t is used in <sys/gmon.h>.
1998-07-10 09:26:41 +00:00
Bruce Evans
2e480d34aa Added a kernel-only typedef (ptrint_t) giving an integral type that is
least unsuitable for holding an object pointer.  This should have been
used to fix warnings about casts between pointers and ints on alphas.

Moved corresponding existing general typedef (fptrint_t) for function
pointers from the i386 <machine/profile.h> to a kernel-only typedef
in <machine/types.h>.  Kludged libc/gmon/mcount.c so that it can
still see this typedef.
1998-07-10 02:27:16 +00:00
Joseph Koshy
2177df3cd2 Correct wording on range of addresses examined by `msync(2)'.
PR: 7180
1998-07-09 06:16:22 +00:00
Dmitrij Tejblum
9b003a4c74 Add lockf(). 1998-07-08 15:42:57 +00:00
Dmitrij Tejblum
abe2fe8a8b Make this look more FreeBSDish. 1998-07-08 15:38:06 +00:00
Dmitrij Tejblum
f1f57565d4 This commit was generated by cvs2svn to compensate for changes in r37510,
which included commits to RCS files with non-trunk default branches.
1998-07-08 15:28:56 +00:00
Dmitrij Tejblum
6975deff55 An implementation of lockf() function call.
Obtained from:	NetBSD (author: Klaus Klein)
1998-07-08 15:28:56 +00:00
Peter Wemm
64a965e707 Replace my original asprintf() and vasprintf() hacks with something
more cleanly integrated with stdio.  This should be faster and cleaner
since it doesn't memcpy() the data into a seperate buffer.  This lets
stdio allocate and manage the buffer and then hand it over to the user.

Obtained from: Todd Miller <Todd.Miller@courtesan.com> via OpenBSD
1998-07-08 00:44:56 +00:00
Poul-Henning Kamp
8a507b98ab fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro that
references sp. The free needs to follow ISSET

PR:		7148
Reviewed by:	phk
Submitted by:	Ken Mayer <kmayer@freegate.com>
1998-07-03 08:21:05 +00:00
Eivind Eklund
38cf631922 Cross-reference to sysconf(3). 1998-06-30 22:56:39 +00:00
Bruce Evans
a7f8e53079 Fixed printf format errors. 1998-06-30 17:30:22 +00:00
Bruce Evans
2a29b52b98 Fixed scanf format errors. The error handling is not quite bug for bug
compatible.  I think small negative uids are handled compatibly but
other out of bounds ones are truncated differently for certain sizes of
uid_t.
1998-06-30 17:21:48 +00:00
Bruce Evans
c6966b0c4a Fixed printf format errors. Don't assume so many things about time_t.
Obtained from:	partial merge of ADO version tzcode96h (was fully merged
                in 1.10 but backed out in 1.11; the FreeBSD code for %s
		was earlier, prettier but buggier).
1998-06-30 16:49:47 +00:00
Guido van Rooij
7d0cc08e7f Fix btree problems. This passes regressions tests.
PR:	7009
Obtained from: http://www.sleepycat.com/update/patch.185.html, patches 1.2,
		1.3 and 1.4
1998-06-25 18:50:06 +00:00
Peter Wemm
2f92c56cc3 preserve errno across the readlink() calls. There is no value in trashing
errno during a successful malloc() call.
1998-06-18 09:13:16 +00:00
Peter Wemm
02a93d74e0 Don't compile in the use of poll() when building libc_r. This isn't
so much a "fix", rather a bandaid to buy time to fix it properly
within the thread engine.
1998-06-14 11:25:46 +00:00
Bruce Evans
ef2e5f62e3 Document EINVAL return value. 1998-06-14 08:22:05 +00:00
Peter Wemm
f3f4b57ac9 Make nlist() understand elf unconditionally 1998-06-12 15:02:03 +00:00
Peter Wemm
14b93edab3 Update the resolver parts to bind-8.1.2 level. I have not touched the
getXXXXbyYYYY() interfaces yet.

Obtained from: diff relative to bind-8.1.2 sources
1998-06-11 09:03:02 +00:00
John Polstra
63b7c21cc3 Move ftok() from libcompat to libc, so that it can be closer to its
friend shmget().

PR:		closes misc/6763
1998-06-10 16:20:21 +00:00
Daniel O'Callaghan
9b0662e646 Fix grammar, "null" -> "NUL" 1998-06-10 12:37:45 +00:00
John Polstra
363e8996d7 This is a null commit to log the fact that I have done a repository
copy to bring these files into libc from libcompat.  I will enable
them and kill off the libcompat versions on the main branch soon.

PR:		step one toward closing misc/6763
1998-06-10 04:24:21 +00:00
John Birrell
4bc711423a Remove __NETBSD_SYSCALLS from CFLAGS now that it is set in sys.mk. 1998-06-09 22:59:16 +00:00
John Birrell
0b0ae157f8 Rename calls when building libc_r. 1998-06-09 22:57:34 +00:00
John Birrell
f4086bc0cb Make this thread-safe in both libc as well as libc_r. 1998-06-09 22:56:24 +00:00
John Birrell
9e0370f742 Rename when building libc_r. 1998-06-09 22:45:39 +00:00
John Birrell
929140ffab Add rename support for libc_r. 1998-06-09 22:43:34 +00:00
Bill Paul
55e07e869f Fix potential resource leak: when call to des_crypt_1() fails, remember
to destroy the RPC CLIENT handle before returning.
1998-06-09 17:38:33 +00:00
John Birrell
6fe173c87b Implement compile time thread lock debug. 1998-06-09 08:37:35 +00:00
John Birrell
bc99dd746b Rename fstat as _thread_sys_fstat if being built into libc_r. 1998-06-09 08:35:42 +00:00
John Birrell
3b6533a024 Implement thread support for libc_r. Make the lseek syscall directly
to avoid recursive locking.
1998-06-09 08:34:35 +00:00
John Birrell
86af3ff9b0 Implement compile time debug mode for thread locks. 1998-06-09 08:32:23 +00:00
John Birrell
3d853e107e Add support for thread lock debug. No impact of the malloc code. 1998-06-09 08:30:32 +00:00
John Birrell
f374bfcd3c Implement compile time debug support for spinlocks.
Simplify the atomic lock prototype, removing the lock value.

Delete the unlock prototypes that are not required.
1998-06-09 08:28:49 +00:00
Steve Price
e110cb41dd Fix this so that it compiles in the !__STDC__ case.
Also be consistent about usage of #if ...

Pointed out by:	bde
1998-06-06 18:52:43 +00:00
Joseph Koshy
9c727d2ca9 Spelling corrections.
PR: 6868
Submitted by: Josh Gilliam <josh@quick.net>
1998-06-06 05:50:53 +00:00
Joseph Koshy
aae2142e5f Spelling nits.
Pointed out by: Sue Blake <sue@welearn.com.au>
1998-06-06 04:56:13 +00:00
Andrey A. Chernov
0ea569ff6f Fix handling more than 1 char with non-C locale
Misc. cleanup
PR: 6825
Submitted by: Sergey Gershtein <sg@mplik.ru>
1998-06-05 09:49:51 +00:00
Joseph Koshy
5239c0a5dd Mention that tftpd(8) also uses syslog(3). 1998-06-05 09:20:19 +00:00
Steve Price
32c2131395 Fix a bunch of spelling errors.
PR:		6856
Submitted by:	Josh Gilliam <josh@quick.net>
1998-06-04 21:06:07 +00:00
Joseph Koshy
70e8940332 Correct wrong claim about `telldir()' cookie lifetimes.
PR: 4043
Submitted by: Joe Orthoefer <j_orthoefer@tia.net>
1998-06-03 06:54:24 +00:00
Mike Smith
d4a7e4ca5d Add a trivial mechanism for returning a useful default value if one is
available and the kernel MIB setting is zero.

Return the result from getpagesize() if the p1003_1b.pagesize MIB
value is zero.

Suggested by:		Joerg Schilling <schilling@fokus.gmd.de>
1998-06-01 20:58:03 +00:00
Steve Price
3f58cad638 Several sources including Unix98 say that semctl's fourth
parameter is optional except where:
	cmd == {IPC_SET || IPC_STAT || GETALL || SETVAL || SETALL}

PR:		2448
Reviewed by:	bde
Submitted by:	Tim Singletary <tsingle@sunland.gsfc.nasa.gov>
Minor tweaks by: steve
1998-05-31 04:09:09 +00:00
Steve Price
5b32180784 Remove references to getvfsbytype. Also remove getvfsbyname
as it has its own manpage.

Discussed with:	bde
1998-05-30 18:20:37 +00:00
Steve Price
14d8151513 Remove a couple style bugs from the code snippet that
slipped in on the previous commit.

Submitted by:	bde
1998-05-26 02:53:06 +00:00
Steve Price
de285a13cc Update code example to reflect current practice. 1998-05-25 21:42:51 +00:00
Bill Paul
65923d6bff The incorrect select() timeout calculation that I fixed in svc_tcp.c
also exists here (the timeout can expire much sooner than it's supposed
to).
1998-05-21 15:22:39 +00:00
Bill Paul
1ce4aec2b4 Change the sanity test here. It's not correct to assume that the record
size we receive here should fit into the receive buffer. Unfortunately,
there's no 100% foolproof way to distinguish a ridiculously large record
size that a client actually meant to send us from a ridiculously large
record size that was sent as a spoof attempt.

The one value that we can positively identify as bogus is zero. A
zero-sized record makes absolutely no sense, and sending an endless
supply of zeroes will cause the server to loop forever trying to
fill its receive buffer.

Note that the changes made to readtcp() make it okay to revert this
sanity test since the deadlock case where a client can keep the server
occupied forever in the readtcp() select() loop can't happen anymore.
This solution is not ideal, but is relatively easy to implement. The
ideal solution would be to re-arrange the way dispatching is handled
so that the select() loop in readtcp() can be eliminated, but this is
difficult to implement. I do plan to implement the complete solution
eventually but in the meantime I don't want to leave the RPC library
totally vulnerable.

That you very much Sun, may I have another.
1998-05-20 15:56:11 +00:00
Bill Paul
14afd12e8c Replace the getpublickey() stub with the real thing. 1998-05-18 21:59:15 +00:00
Bill Paul
a6e95b4420 Improve DoS avoidance in RPC stream oriented transports. The TCP transport
uses readtcp() to gather data from the network; readtcp() uses select(),
with a timeout of 35 seconds. The problem with this is that if you
connect to a TCP server, send two bytes of data, then just pause, the
server will remain blocked in readtcp() for up to 35 seconds, which is
sort of a long time. If you keep doing this every 35 seconds, you can
keep the server occupied indefinitely.

To fix this, I modified readtcp() (and its cousin, readunix() in svc_unix.c)
to monitor all service transport handles instead of just the current socket.
This allows the server to keep handling new connections that arrive while
readtcp() is running. This prevents one client from potentially monopolizing
a server.

Also, while I was here, I fixed a bug in the timeout calculations. Someone
attempted to adjust the timeout so that if select() returned EINTR and the
loop was restarted, the timeout would be reduced so that rather than waiting
for another 35 seconds, you could never wait for more than 35 seconds total.
Unfortunately, the calculation was wrong, and the timeout could expire much
sooner than 35 seconds.
1998-05-18 16:12:13 +00:00
Joseph Koshy
c38eceafa4 kill.1: Remove reference to obsolete sigvec(2) man page. Removed
self reference in sigaction(2) man page.

Submitted by: Josh Gilliam <josh@quick.net>
PR: 6617
1998-05-18 03:33:11 +00:00
Bill Paul
a9352e90f0 Patch RPC library to avoid possible denial of service attacks as described
recently in BUGTRAQ. The set_input_fragment() routine in the XDR record
marking code blindly trusts that the first two bytes it sees will in fact
be an actual record header and that the specified size will be sane. In
fact, if you just telnet to a listening port of an RPC service and send a
few carriage returns, set_input_fragment() will obtain a ridiculously large
record size and sit there for a long time trying to read from the network.

A sanity test is required: if the record size is larger than the receive
buffer, punt.
1998-05-15 22:57:31 +00:00
Bill Paul
9c69f26836 Patch RPC library to avoid possible denial of service attacks as described
recently in BUGTRAQ. If a stream oriented transport fails to properly decode
an RPC message header structure where there should be one, it should mark
the stream as dead so that the connection will be dropped.
1998-05-15 22:53:47 +00:00
John Birrell
4bf15af17e Remove a big hack after adding a small one to libc/gen/getcwd.c to
handle the lack of __getcwd syscall in NetBSD.
1998-05-15 12:01:06 +00:00
John Birrell
efda37108b NetBSD doesn't have a __getcwd syscall, so set have__getcwd to `no'
when building libc with NetBSD syscalls.
1998-05-15 11:59:00 +00:00
John Birrell
cfc1614a48 int -> long changes that reduce the diffs with the NetBSD version to
work in a 64-bit environment.
1998-05-14 21:45:18 +00:00
Andrey A. Chernov
01929df9e0 Remove reference to signanosleep 1998-05-14 14:39:58 +00:00
Peter Wemm
f202e67dfe Nuke signanosleep() 1998-05-14 11:36:16 +00:00
John Birrell
9a6a1cbee4 Cast a pointer to a long, not an int and make the arg passed to the function
a long too (it does have a proper prototype).
1998-05-11 09:10:38 +00:00
John Birrell
adaa81ba92 Cast a pointer to a long, not an int before masking it. 1998-05-10 21:22:47 +00:00
John Birrell
cc4473c104 Remove 'of type long' from a sentence talking about four 4-byte values
because that is wrong on alpha.
1998-05-10 21:21:01 +00:00
Bruce Evans
881b7b471b Fixed the usual missing dependencies on headers generated by rpcgen. 1998-05-10 15:54:22 +00:00
Bruce Evans
ee4b699da3 Fixed the usual missing dependencies on headers generated by rpcgen.
Use rpcgen's -C option, although using it for non-headers breaks K&R
support.  A local copy of yp.h is built to avoid adding
-I/usr/include/rpcsvc to CFLAGS.  This version of yp.h differed from
<rpcsvc/yp.h> only in not declaring prototypes.

Fixed style bugs.
1998-05-09 15:10:53 +00:00