Commit Graph

2617 Commits

Author SHA1 Message Date
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
jb
3abf25de7a 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
jb
63437559be 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
jb
38b43562a8 NULL a pointer after it is freed to avoid trying to free it again. 1998-09-30 06:24:57 +00:00
jb
f462ccb1ac - 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
jb
cacbe3ac3d 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
jkoshy
7091025f49 `kern.maxproc' is not changeable from sysctl(8).
Reminded by:	Bruce Evans <bde@zeta.org.au>
1998-09-29 05:16:45 +00:00
jkh
980a28fb84 Allow minigzip to be invoked more like gzip, checking to see
if we're being called as gunzip as well as dealing with the -c
flag.
Submitted by:	jhay
1998-09-29 04:56:30 +00:00
eivind
b2b9eb9194 Document that we will core-dump on getting a NULL pointer. 1998-09-28 15:34:24 +00:00
des
79d86f49fa Bring the man page more or less up to date with the code. 1998-09-26 20:42:44 +00:00
dfr
cdfdc86cee Don't cast int pointers to long pointers when reading labels from
/etc/disktab.
1998-09-26 14:44:06 +00:00
jkh
77d2c6daa4 /usr/lib/compat -> /usr/lib/compat/aout
This change will need to be reviewed just as soon as we start generating
ELF compat libs, but for now it does the right thing for a.out libs.
1998-09-26 11:54:02 +00:00
dfr
efc49606e6 * Enable old UFS compatibility code for booting from Digital Unix formatted
disks.
* Fix a whole raft of warnings, printf and otherwise.
* Make zalloc work for alpha (just a case of using the right typedef).
* Add some (disabled) malloc debug printing to stand.h.
1998-09-26 10:48:50 +00:00
dillon
25867afc01 Fixed setting of mp_End in zextendPool(). A case was missing and mp_Size
no longer reflects the mp_End - mp_Base equivalent.
1998-09-26 03:24:14 +00:00
msmith
889c297c99 Replace the old and extremely icky Mach/NetBSD allocator with a similarly
compact and much better one donated by Matt Dillon.  Implement a simple
sbrk() which uses the existing setheap() api.

Remove the custom allocator from the UFS code.  It wasn't working quite
right, and it shouldn't be needed with the new allocator.

Fix a serious problem with changing the value of already-existent
environment variables.  Don't attempt to modify the supposedly-const
argument to putenv()

Fix an off-by-one sizing error in the zipfs code detected by the new
allocator.

Submitted by:	zmalloc from Matt Dillon <dillon@backplane.com>
1998-09-26 01:42:40 +00:00
obrien
1484c33523 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
dfr
140d266f2c Use unsigned chars instead of signed chars when extracting bits of the
inet address.
1998-09-23 21:35:40 +00:00
dfr
d00ce50aec Use 8k pagesize on alpha, not 4k. 1998-09-23 21:26:04 +00:00
jkh
cb6dc1f484 Include "stand.h", not <stand.h>. 1998-09-21 06:07:34 +00:00
dfr
454d5e748b Allocate disk buffers using a custom allocator. The standard allocator fragments
extremely badly if disk buffers are freed back into the main heap and the alpha
bootstrap has a restricted address space which just ran out :-(.
1998-09-20 21:42:20 +00:00