Commit Graph

2636 Commits

Author SHA1 Message Date
des
5da7367e68 Fix style issues in execl(), and make execle() vfork()-safe.
Reviewed by:	bde
Approved by:	jkh
1998-10-15 17:14:15 +00:00
msmith
ec7528e7a1 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
ken
0f5f3303a7 Fix a couple of potential buffer overrun cases.
Submitted by:	imp
1998-10-14 23:28:26 +00:00
des
52bfe6c7ac Correct braino in previous commit. I get the pointy hat again. 1998-10-14 20:23:40 +00:00
des
332e24c258 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
jkh
239077d867 correct prototype. 1998-10-14 11:04:36 +00:00
ken
9ca5d88dce Add man pages for many of the functions in the CAM library. This covers
most of the open/close routines, and the buffer/cdb parsing routines
derived from the old scsi(3) library.

The cam_cdbparse(3) man page borrows from the old scsi(3) man page, so the
copyright and history section reflect that.

The many scsi_* functions and other functions that are pulled in from the
kernel aren't documented yet, but will be eventually.
1998-10-14 06:20:36 +00:00
bde
6489b7e927 Updated library order and comments about it. This fixes libm not
being built before libf2c and libmd not being built before libatm.
1998-10-13 16:48:43 +00:00
des
d55d163bcc Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
ken
be31f39110 Add a "dummy light" (actually two dummy lights) to catch people who don't
have the passthrough device configured in their kernel.

This will hopefully reduce the number of people complaining that they can't
get {camcontrol, xmcd, tosha, cdrecord, etc.} to work.

Reviewed by:	gibbs
1998-10-12 21:54:13 +00:00
des
3a59a5e55b Avoid the "Cannot allocate memory" problem that appears on heavily
loaded systems by retrying the sysctl() with a larger buffer if it
fails with ENOMEM. For good measure, allocate 10% more memory than
sysctl() claims is necessary.

PR:		8275
Reviewed by:	David Greenman <dg@freebsd.org>
1998-10-12 20:36:33 +00:00
ken
d8f01a38a0 Fix a curses bug exposed by the ":numbers" display of systat -iostat.
This bug showed up when you had more than 3 devices displayed.  (thus
requiring a second line of display)

Here's a quote From the PR:

 When wrefresh() is called with a subwindow as argument, __set_subwin
 might be called with reversed arguments if wrefresh() decides to calls
 quickch().  This may cause use of negative array indexes, with a
 resulting segfault.

 Since quickch() manipulates the line structures belonging to curscr,
 it looks like all subwindows of curscr should be updated.

PR:		bin/8086
Submitted by:	Tor Egge <Tor.Egge@fast.no>
1998-10-12 16:32:32 +00:00
jdp
633c1a27a5 Eliminate nested comment warning.
Submitted by:	lh@aus.org
1998-10-11 17:14:56 +00:00
bde
d7823cd8d1 Fixed removing of obsolete shared libraries:
- the directory was wrong if ${SHLIBDIR} != ${LIBDIR}.  It's still wrong
  if the installation of the obsolete library was done before /aout was
  appended to LIBDIR.
- the version would have become wrong when the default in ../Makefile.inc
  is changed from 2.0.
- the comment mostly described moving of libraries to /usr/lib/compat, but
  we don't do that.
1998-10-11 16:33:02 +00:00
peter
5aa94a5905 Avoid the need for calling functions that malloc after a vfork(). 1998-10-11 14:11:51 +00:00
peter
2df0ed4426 libopie also depends on libmd. Programs using libopie shouldn't have to
know about libopie's internals in order to use it.
1998-10-11 04:45:50 +00:00
peter
0e86dbf891 libf2c.so.* depends on libm.so. I'm not sure that this matters in this
case because I expect the f2c front-end should add the -lm automatically.
1998-10-11 04:44:12 +00:00
peter
482b9ff53d libatm uses libmd; add it to the dependency list so that programs using
libatm are not forced to know the internals of it's implementation.
1998-10-11 04:41:43 +00:00
peter
09ddcb3f05 Deal with /usr/lib/compat/aout, and that we've been installing things
in the wrong places for a while.
Also, the the libtermlib.so -> libtermcap.so manually for elf, otherwise
the hard link follows the symlink and the result looks rather wierd.  The
*.a files are still hard linked under elf as before.
1998-10-11 04:39:56 +00:00
peter
31fda80aa3 Don't build elf libresolv.so*, no elf freebsd binaries have used it ever.
Also, the a.out compat version is supposed to go into /usr/lib/compat/aout.
Try and clean up the mess left behind in /usr/lib/compat.
1998-10-11 04:21:56 +00:00
peter
25045514dd Don't install an elf libgnumalloc.so* in /usr/lib/compat.. No elf binaries
have been linked against it.  Try and clean up the leftovers.  Also, put
the a.out libs in /usr/lib/compat/aout since that's where the default
a.out ldconfig compat path points to.
1998-10-11 04:18:30 +00:00
peter
51822ce892 Don't install an elf liby.so[.2] in /usr/lib/compat. We have never had
any elf binaries linked against it.  Try and clean up the mess left over..
1998-10-11 04:10:14 +00:00
bde
af6b179886 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
85ade76806 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
dt
0af6de3235 Fix some bugs in pthread scheduler:
make pthread_yield() more reliable,
  threads always (I hope) preempted at least every 0.1 sec, as intended.

PR:		bin/7744
Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1998-10-09 19:01:30 +00:00
jkh
e7ff8169c7 Now take stdio.h out of files that don't require it. 1998-10-09 11:24:20 +00:00
jkh
6ed47f8f93 Update docs to match interface change. 1998-10-09 07:33:58 +00:00
jkh
2486be61d7 o move path in libutil.h to paths.h
o make property_read() take a fd instead to avoid stdio.h mess
o update auth to new interface.
1998-10-09 07:32:38 +00:00
jkh
6f4401a7cb Take the path spec back out. 1998-10-09 07:28:14 +00:00
jkh
f0d295b433 All these have to include stdio.h now. 1998-10-09 00:39:09 +00:00
jkh
6400200a8d remove stdio.h include; I forgot Bruce's cardinal rule that header files
shouldn't include other ones (which, unfortunately, is also a hellish
rule since he broke interfaces like sysctl this way by requiring undocumented
header files to be included just in order to be able to use them now - SIGH!).
1998-10-08 23:10:41 +00:00
jkh
2a6fa6f4e3 Add some rudimentary documentation for my new functions. 1998-10-08 06:53:32 +00:00
jkh
094c23829c Correct a build error that got past my build test somehow. 1998-10-08 01:56:49 +00:00
jkh
96e3bb84cc Add a simple mechanism for reading property lists from files (which
I'll convert sysinstall to use shortly) and a simple call which uses
this mechanism to implement an /etc/auth.conf file.  I'll let Mark Murray
handle the format and checkin of the sample auth.conf file.
Reviewed by:	markm
1998-10-07 17:32:49 +00:00
msmith
05e3f5e74b Add strcasecmp source file required for dosfs operation. 1998-10-07 13:50:17 +00:00
julian
c0d6ea9555 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
msmith
04d837af32 Enable the DOS filesystem. This allows reading from various DOS filesystems
(FAT12/16/32, VFAT).

Make a private copy of strcasecmp, as the "real" one uses the system ctype
header, which introduces locale poisoning.
1998-10-06 19:23:57 +00:00
dfr
e01c61b501 Teach libdisk about alpha boot blocks. 1998-10-06 11:57:08 +00:00
dfr
3889ff9459 64bit portability fixes.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-10-05 18:35:04 +00:00
msmith
5d1da8c2b7 Don't build with -g. 1998-10-04 08:10:29 +00:00
eivind
eb4ad40171 program written under FreeBSD -> programs written under FreeBSD
Noticed by:	Alex Nash <nash@mcs.net>
1998-10-03 16:17:30 +00:00
msmith
b55ff7af33 Prune unused zalloc components as recommended by Matt Dillon. Extra debugging
code is still enabled (it's not very expensive).
1998-10-01 17:35:08 +00:00
jkh
0ef213ede7 Add libdisk back to alpha build. 1998-10-01 14:49:57 +00:00
jkh
6e4324cb4b Eliminate unaligned access on Alpha and also neaten up this code a little.
Submitted by:	dfr
1998-09-30 21:40:51 +00:00
dt
393632f09d Debug when an environment variable set, no when it is unset. 1998-09-30 19:17:51 +00:00
jb
bd80c186a2 Revise test code for sigwait and add test code for sigsuspend.
Submitted by: Daniel M. Eischen <eischen@vigrid.com>
1998-09-30 07:14:02 +00:00
jb
3d6ff09f8f Revise test code for sigwait and add test code for sigsuspend.
Submitted by: Daniel M. Eischen <eischen@vigrid.com>
1998-09-30 07:08:09 +00:00
jb
376c5036ba Fix a comment. 1998-09-30 06:42:29 +00:00
jb
f83e5589d8 Cosmetic cleansing. This code requires extra work to keep the garbage
collector thread running after a fork.
1998-09-30 06:41:16 +00:00
jb
f1dac2e4d8 Move the cleanup code that frees memory allocated for a dead thread from
the thread kernel into a garbage collector thread which is started when
the fisrt thread is created (other than the initial thread). This
removes the window of opportunity where a context switch will cause a
thread that has locked the malloc spinlock, to enter the thread kernel,
find there is a dead thread and try to free memory, therefore trying
to lock the malloc spinlock against itself.

The garbage collector thread acts just like any other thread, so
instead of having a spinlock to control accesses to the dead thread
list, it uses a mutex and a condition variable so that it can happily
wait to be signalled when a thread exists.
1998-09-30 06:36:56 +00:00