Commit Graph

2591 Commits

Author SHA1 Message Date
Jordan K. Hubbard
eed80d041b correct prototype. 1998-10-14 11:04:36 +00:00
Kenneth D. Merry
01a4eb824c 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
Bruce Evans
47acf5563c 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
Dag-Erling Smørgrav
1fd98d7d88 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
Kenneth D. Merry
621a60d46b 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
Dag-Erling Smørgrav
b2d3d0f097 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
Kenneth D. Merry
13a5277c23 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
John Polstra
0651835dae Eliminate nested comment warning.
Submitted by:	lh@aus.org
1998-10-11 17:14:56 +00:00
Bruce Evans
a9d7016af5 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 Wemm
0c372549f6 Avoid the need for calling functions that malloc after a vfork(). 1998-10-11 14:11:51 +00:00
Peter Wemm
b550818d8d 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 Wemm
78c6a7e037 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 Wemm
85a6383125 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 Wemm
5cc7d6a524 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 Wemm
29b678437f 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 Wemm
94614a780f 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 Wemm
46cc15fe3d 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
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
Dmitrij Tejblum
4b12016bab 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
Jordan K. Hubbard
8b1ef8d464 Now take stdio.h out of files that don't require it. 1998-10-09 11:24:20 +00:00
Jordan K. Hubbard
475ae25ac1 Update docs to match interface change. 1998-10-09 07:33:58 +00:00
Jordan K. Hubbard
50dfa596d3 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
Jordan K. Hubbard
72671863e8 Take the path spec back out. 1998-10-09 07:28:14 +00:00
Jordan K. Hubbard
b8c11ec197 All these have to include stdio.h now. 1998-10-09 00:39:09 +00:00
Jordan K. Hubbard
146c3cf45c 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
Jordan K. Hubbard
3b29c89296 Add some rudimentary documentation for my new functions. 1998-10-08 06:53:32 +00:00
Jordan K. Hubbard
69761016be Correct a build error that got past my build test somehow. 1998-10-08 01:56:49 +00:00
Jordan K. Hubbard
b704025f3c 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
Mike Smith
745f11adb6 Add strcasecmp source file required for dosfs operation. 1998-10-07 13:50:17 +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
Mike Smith
40fd46f77d 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
Doug Rabson
5b4c313702 Teach libdisk about alpha boot blocks. 1998-10-06 11:57:08 +00:00
Doug Rabson
e0ce825e94 64bit portability fixes.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-10-05 18:35:04 +00:00
Mike Smith
3f9423cca2 Don't build with -g. 1998-10-04 08:10:29 +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
Mike Smith
31a014da28 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
Jordan K. Hubbard
e886e3bd22 Add libdisk back to alpha build. 1998-10-01 14:49:57 +00:00
Jordan K. Hubbard
55ff249dd5 Eliminate unaligned access on Alpha and also neaten up this code a little.
Submitted by:	dfr
1998-09-30 21:40:51 +00:00
Dmitrij Tejblum
60abf62bfa Debug when an environment variable set, no when it is unset. 1998-09-30 19:17:51 +00:00
John Birrell
cffdbf7096 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
John Birrell
058716097d 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
John Birrell
f51ea46d24 Fix a comment. 1998-09-30 06:42:29 +00:00
John Birrell
d3bb66886d 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
John Birrell
dc3a8b52c0 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
John Birrell
05f3e91279 Use snprintf instead of sprintf to avoid long source file paths from
launching an application into space when someone tries to debug it.

The dead thread list now has it's own link pointer, so use that when
reporting the grateful dead.
1998-09-30 06:29:54 +00:00
John Birrell
54059e9f3f Implementation of an additional state called SIGWAIT (with the previous
one renamed to SIGSUSPEND) to fix sigwait().

Submitted by: Daniel M. Eischen <eischen@vigrid.com>
1998-09-30 06:27:31 +00:00
John Birrell
92ce833722 NULL a pointer after it is freed to avoid trying to free it again. 1998-09-30 06:24:57 +00:00
John Birrell
a247f83316 - Fix the debug macros.
-  Add support of a thread being listed in the dead thread list as well
   as the thread list.
-  Add a new thread state to make sigwait work properly. (Submitted by
   Daniel M. Eischen <eischen@vigrid.com>)
-  Add global variable for the garbage collector mutex and condition
   variable.
-  Delete a couple of prototypes that are no longer required.
-  Add a prototype for the garbage collector thread.
1998-09-30 06:22:07 +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