summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix some bugs in pthread scheduler:dt1998-10-096-18/+36
| | | | | | | | 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>
* Now take stdio.h out of files that don't require it.jkh1998-10-099-17/+10
|
* Update docs to match interface change.jkh1998-10-091-4/+4
|
* o move path in libutil.h to paths.hjkh1998-10-093-10/+11
| | | | | o make property_read() take a fd instead to avoid stdio.h mess o update auth to new interface.
* Take the path spec back out.jkh1998-10-091-4/+1
|
* All these have to include stdio.h now.jkh1998-10-094-4/+8
|
* remove stdio.h include; I forgot Bruce's cardinal rule that header filesjkh1998-10-081-2/+1
| | | | | | 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!).
* Add some rudimentary documentation for my new functions.jkh1998-10-084-2/+182
|
* Correct a build error that got past my build test somehow.jkh1998-10-082-0/+3
|
* Add a simple mechanism for reading property lists from files (whichjkh1998-10-074-2/+300
| | | | | | | 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
* Add strcasecmp source file required for dosfs operation.msmith1998-10-071-0/+74
|
* Fix a memory leakjulian1998-10-071-15/+25
| | | | | | | | | | | 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!
* Enable the DOS filesystem. This allows reading from various DOS filesystemsmsmith1998-10-063-10/+9
| | | | | | | (FAT12/16/32, VFAT). Make a private copy of strcasecmp, as the "real" one uses the system ctype header, which introduces locale poisoning.
* Teach libdisk about alpha boot blocks.dfr1998-10-064-4/+51
|
* 64bit portability fixes.dfr1998-10-051-11/+11
| | | | Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
* Don't build with -g.msmith1998-10-041-2/+2
|
* program written under FreeBSD -> programs written under FreeBSDeivind1998-10-031-2/+2
| | | | Noticed by: Alex Nash <nash@mcs.net>
* Prune unused zalloc components as recommended by Matt Dillon. Extra debuggingmsmith1998-10-015-348/+30
| | | | code is still enabled (it's not very expensive).
* Add libdisk back to alpha build.jkh1998-10-011-3/+2
|
* Eliminate unaligned access on Alpha and also neaten up this code a little.jkh1998-09-302-8/+38
| | | | Submitted by: dfr
* Debug when an environment variable set, no when it is unset.dt1998-09-302-4/+4
|
* Revise test code for sigwait and add test code for sigsuspend.jb1998-09-302-0/+281
| | | | Submitted by: Daniel M. Eischen <eischen@vigrid.com>
* Revise test code for sigwait and add test code for sigsuspend.jb1998-09-304-18/+116
| | | | Submitted by: Daniel M. Eischen <eischen@vigrid.com>
* Fix a comment.jb1998-09-301-1/+1
|
* Cosmetic cleansing. This code requires extra work to keep the garbagejb1998-09-303-6/+9
| | | | collector thread running after a fork.
* Move the cleanup code that frees memory allocated for a dead thread fromjb1998-09-3020-390/+700
| | | | | | | | | | | | | | 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.
* Use snprintf instead of sprintf to avoid long source file paths fromjb1998-09-303-36/+93
| | | | | | | 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.
* Implementation of an additional state called SIGWAIT (with the previousjb1998-09-3012-204/+348
| | | | | | one renamed to SIGSUSPEND) to fix sigwait(). Submitted by: Daniel M. Eischen <eischen@vigrid.com>
* NULL a pointer after it is freed to avoid trying to free it again.jb1998-09-303-0/+6
|
* - Fix the debug macros.jb1998-09-303-12/+63
| | | | | | | | | | | - 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.
* Delete the XXX comments that refer to spinlock recursion. The malloc/free/jb1998-09-301-15/+1
| | | | | | | | | 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.
* `kern.maxproc' is not changeable from sysctl(8).jkoshy1998-09-291-1/+1
| | | | Reminded by: Bruce Evans <bde@zeta.org.au>
* Allow minigzip to be invoked more like gzip, checking to seejkh1998-09-291-2/+12
| | | | | | if we're being called as gunzip as well as dealing with the -c flag. Submitted by: jhay
* Document that we will core-dump on getting a NULL pointer.eivind1998-09-281-0/+4
|
* Bring the man page more or less up to date with the code.des1998-09-261-23/+54
|
* Don't cast int pointers to long pointers when reading labels fromdfr1998-09-261-6/+9
| | | | /etc/disktab.
* /usr/lib/compat -> /usr/lib/compat/aoutjkh1998-09-261-2/+2
| | | | | 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.
* * Enable old UFS compatibility code for booting from Digital Unix formatteddfr1998-09-266-7/+46
| | | | | | | 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.
* Fixed setting of mp_End in zextendPool(). A case was missing and mp_Sizedillon1998-09-261-2/+3
| | | | no longer reflects the mp_End - mp_Base equivalent.
* Replace the old and extremely icky Mach/NetBSD allocator with a similarlymsmith1998-09-2613-338/+1118
| | | | | | | | | | | | | | | | | 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>
* Apply patch to properly sscanf(3) when there is whitespace in the formatobrien1998-09-251-7/+2
| | | | | | | | | | | | | 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
* Use unsigned chars instead of signed chars when extracting bits of thedfr1998-09-231-1/+1
| | | | inet address.
* Use 8k pagesize on alpha, not 4k.dfr1998-09-231-1/+5
|
* Include "stand.h", not <stand.h>.jkh1998-09-211-1/+1
|
* Allocate disk buffers using a custom allocator. The standard allocator ↵dfr1998-09-201-11/+45
| | | | | | | 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 :-(.
* Use a simple version of inet_ntoa(). The libc one uses inet_ntop which is toodfr1998-09-201-0/+65
| | | | complicated.
* Back out part of previous commit (even though it's technically correct).alex1998-09-201-1/+17
| | | | | | | | | | | 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.
* Change the devstat generation number from an int to a long. The int-sizedken1998-09-203-23/+24
| | | | | | | | | | generation was causing unaligned access faults on the Alpha. I have incremented the devstat version number, since this is an interface change. You'll need to recompile libdevstat, systat, iostat, vmstat and rpc.rstatd along with your kernel. Partially Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
* Correctly back out of free if a recursive call into malloc.c is detected.alex1998-09-191-8/+7
| | | | | | Set malloc_func *after* grabbing the thread lock. Noticed by: Simon Coggins <simon@oz.org>
* Nuke prototype for strerror, consumers get it from <string.h>msmith1998-09-182-4/+2
| | | | Fix overlooked nullopen() implementation.
OpenPOWER on IntegriCloud