Commit Graph

495 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Wolfram Schneider
acd8019083 Sort cross references. 1998-08-31 16:41:09 +00:00
Doug Rabson
744857bc1c Update to use the new elf headers. 1998-08-17 08:47:19 +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
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
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
Peter Wemm
f3f4b57ac9 Make nlist() understand elf unconditionally 1998-06-12 15:02:03 +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
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
86af3ff9b0 Implement compile time debug mode for thread locks. 1998-06-09 08:32:23 +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
5239c0a5dd Mention that tftpd(8) also uses syslog(3). 1998-06-05 09:20:19 +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