kernal page table may need to be extended. But while growing the
kernel page table (pmap_growkernel()), newly allocated kernel page
table pages are entered into every process' page directory. For
proc0, the page directory is not allocated yet, and results in a
page fault. Eventually, the machine panics with "lockmgr: not
holding exclusive lock".
PR: 5458
Reviewed by: phk
Submitted by: Luoqi Chen <luoqi@luoqi.watermarkgroup.com>
it was. Add a FILE_WAIT state and queue threads waiting for a FILE
lock. Start using the sys/queue.h macros instead of the way that MIT
pthreads did it.
Add a thread name to the private thread structure and a non-POSIX
function to set this. This helps (me at least) when sending a SIGINFO
to a threaded process to get a /tmp/uthread.dump to see what the
<expletive deleted> threads are doing this time. It is nice to be
able to recognise (yes, I spell that with an 's' too) which threads
are which.
Change the FILE locking to support kernel threads when linked with
libpthread (which you haven't see yet). This requires that libc become
thread-safe and thread-aware, testing __isthreaded before attempting
to do lock/unlock calls. The impact on non-threaded programs is minor.
This change works with libc_r, so it's the best compromise.
test for __isthreaded before calling the lock/unlock functions to
try to save some performance. The _THREAD_SAFE case should become the
default, but since it tests for a global variable in libc, people won't
be able to build -current on pre-3.0 systems unless the default leaves
it out. Such is life.
libc to determine if locking is required. This is needed in libc
for use with kernel threads, but until a thread is created, we don't
really want to bother locking things. The variable was added here
because the crt code calls exit(main()) so all programs will get the
variable.
magic number byte ordering for FreeBSD. This makes "file" describe
our object files as "FreeBSD/i386 object" instead of as NetBSD
object files. In case this seems drastic and risky, Bruce points
out that the "ld -r -x" step that is done on every object file when
building libraries fixes the byte ordering in the same way. I have
been running with this patch for over a month and have seen no
problems.
Use config flags 0x1000 to enable LBA mode. It should be enabled in
the BIOS too to avoid geometry confusion.
One catch though, I'm not sure all BIOS's uses the 64head/63secs
translation, all mine does but....
With -O3, egcs generates such forward references.
PR: gnu/6055
Reviewed by: jdp
Submitted by: Dmitrij Tejblum <tejblum@arc.hq.cti.ru> in slightly different form
that `fsck -p' doesn't check multiple slices on the same drive
concurrently. Don't invoke undefined behaviour when searching for
the drive number in strange device names.
PR: 6129
Reviewed by: phk
Submitted by: Yuichi MATSUTAKA <matutaka@osa.att.ne.jp>, but rewritten
by me.
an error if it gets a link (like it does if it gets a socket). The
implications of letting users try and do file operations on symlinks
themselves were too worrying.
(because we can :-). This means you can open a link file (or pseudo-file
in the case of short links where the data is stored in the inode rather
than disk blocks) and read the contents.
However, trap any writes from the user as it's difficult to do the right
thing in all cases. A link may be short and the user may be trying to
extend it beyond the limit and so on. Although.. being able to re-target
a symlink without deleting it first might have been nice.
This stuff is a bit perverse since symlink() and readlink() calls can
end up actually being implemented as read/write vnode ops.
Reviewed by: phk
to not follow symlinks, but to open a handle on the link itself(!).
As strange as this might sound, it has several useful applications
safe race-free ways of opening files in hostile areas (eg: /tmp, a mode
1777 /var/mail, etc). It also would allow things like fchown() to work
on the link rather than having to implement a new syscall specifically for
that task.
Reviewed by: phk
stat() the file being followed and do a close/reopen if the file has been
renamed and/or rotated. This is damn useful for leaving running on files
in /var/log when newsyslog(8) rotates them.
ints. Remove some no longer needed casts. Initialize the per-cpu
global data area using the structs rather than knowing too much about
layout, alignment, etc.