marcel [Thu, 31 Aug 2006 19:16:47 +0000 (19:16 +0000)]
TLS fixes:
o The TLS pointer (r2) points 0x7000 after the *end* of the TCB.
o _rtld_allocate_tls() gets a pointer to the current TCB, not the
current TLS pointer.
o _rtld_free_tls() gets the size of the TCB structure.
obrien [Thu, 31 Aug 2006 16:55:08 +0000 (16:55 +0000)]
Import of LukeM's ftpd taken from the NetBSD CVS repo on 31-Aug-2006.
+ Add PAM and LOGIN_CAP support. Mostly from FreeBSD.
+ Implement option "-D", for running ftpd in standalone mode (daemon).
+ NLST should return 450 instead of 550 upon error, per RFC 959.
+ Add recvbufsize configuration option
+ Remove unreachable code (res could never be NULL here), Coverity CID 712.
+ Set file to NULL after calling fclose(), Coverity CID 2669.
+ Make sure that "su" is initialized before dereferencing it, Coverity CID 1075.
+ Cleanup utmp and utmpx support.
brooks [Wed, 30 Aug 2006 15:14:00 +0000 (15:14 +0000)]
When generating localhost entries in /etc/hosts, put localhost before
localhost.domain so that naive users of gethost* think 1:: and 127.0.0.1
are "localhost" which is what the user expects. This also matches the
sample hosts file in src/etc/hosts.
delphij [Wed, 30 Aug 2006 08:20:34 +0000 (08:20 +0000)]
In rev. 1.2 we have introduced a fallback handler for files with unknown
extensions. This seems to be unnecessary and prevents less(1) from being
able to detect file changes, so remove the part.
Submitted by: Eric Huss <e-huss netmeridian com>
PR: bin/102624
Discussed with: des
MFC After: 3 days
jhb [Tue, 29 Aug 2006 20:36:33 +0000 (20:36 +0000)]
The _sx_assert() prototype should exist if either of INVARIANTS or
INVARIANT_SUPPORT is defined so you can build a kernel with
INVARIANT_SUPPORT, but build a module with just INVARIANTS on.
brueffer [Tue, 29 Aug 2006 19:15:59 +0000 (19:15 +0000)]
Forced commit (a little late) to note that the last revision also
removed the references to the README. All information the references
refer to are actually more up to date in out manpages.
ru [Tue, 29 Aug 2006 09:20:48 +0000 (09:20 +0000)]
Comment out lines that use example addresses and example.com names so
that local changes can be made more easily (without having to comment
these lines, and making the diff more readable).
kientzle [Tue, 29 Aug 2006 04:59:25 +0000 (04:59 +0000)]
When skipping data, track the position in the bytestream correctly.
Without this, tar -r breaks badly; new entries overwrite the
middle of the archive instead of being added at the end.
imp [Mon, 28 Aug 2006 17:26:38 +0000 (17:26 +0000)]
Import on vendor branch two files that have been tweaked to unbreak
the build. The openbsm folks are free to fix it in any other way they
see fit once they resurface.
Basically, make everything always be const char **, even though const
char ** usually should be 'const char * const *' in most cases. This
makes the three different definitions consistant and allows world to
build.
dougb [Mon, 28 Aug 2006 06:41:50 +0000 (06:41 +0000)]
1. Attempt to take one bullet out of the foot-shooting gun by silently
ignoring errors when sourcing rc.conf* files. The most common error
occurs when users put a command of some sort into those files.
(ifconfig is a popular choice)
2. Make the file rotation logic simpler by starting one down from
the "top" of the list, rather than at the top.
3. Try to make file rotation more secure by calling unlink(1) on all
new file names before rotating an old file to the new name, rather than
merely calling 'rm -f' on any files that exceed the number of files
to save.
davidxu [Mon, 28 Aug 2006 04:52:50 +0000 (04:52 +0000)]
Use umutex APIs to implement pthread_mutex, member pp_mutexq is added
into pthread structure to keep track of locked PTHREAD_PRIO_PROTECT mutex,
no real mutex code is changed, the mutex locking and unlocking code should
has same performance as before.
davidxu [Mon, 28 Aug 2006 04:24:51 +0000 (04:24 +0000)]
This is initial version of POSIX priority mutex support, a new userland
mutex structure is added as following:
struct umutex {
__lwpid_t m_owner;
uint32_t m_flags;
uint32_t m_ceilings[2];
uint32_t m_spare[4];
};
The m_owner represents owner thread, it is a thread id, in non-contested
case, userland can simply use atomic_cmpset_int to lock the mutex, if the
mutex is contested, high order bit will be set, and userland should do locking
and unlocking via kernel syscall. Flag UMUTEX_PRIO_INHERIT represents
pthread's PTHREAD_PRIO_INHERIT mutex, which when contention happens, kernel
should do priority propagating. Flag UMUTEX_PRIO_PROTECT indicates it is
pthread's PTHREAD_PRIO_PROTECT mutex, userland should initialize m_owner
to contested state UMUTEX_CONTESTED, then atomic_cmpset_int will be failure
and kernel syscall should be invoked to do locking, this becauses
for such a mutex, kernel should always boost the thread's priority before
it can lock the mutex, m_ceilings is used by PTHREAD_PRIO_PROTECT mutex,
the first element is used to boost thread's priority when it locked the mutex,
second element is used when the mutex is unlocked, the PTHREAD_PRIO_PROTECT
mutex's link list is kept in userland, the m_ceiling[1] is managed by thread
library so kernel needn't allocate memory to keep the link list, when such
a mutex is unlocked, kernel reset m_owner to UMUTEX_CONTESTED.
Flag USYNC_PROCESS_SHARED indicate if the synchronization object is process
shared, if the flag is not set, it saves a vm_map_lookup() call.
The umtx chain is still used as a sleep queue, when a thread is blocked on
PTHREAD_PRIO_INHERIT mutex, a umtx_pi is allocated to support priority
propagating, it is dynamically allocated and reference count is used,
it is not optimized but works well in my tests, while the umtx chain has
its own locking protocol, the priority propagating protocol are all protected
by sched_lock because priority propagating function is called with sched_lock
held from scheduler.
No visible performance degradation is found which these changes. Some parameter
names in _umtx_op syscall are renamed.
alc [Sun, 27 Aug 2006 19:50:13 +0000 (19:50 +0000)]
Refactor vm_page_sleep_if_busy() so that the test for a busy page is
inlined and a procedure call is made in the rare case, i.e., when it is
necessary to sleep. In this case, inlining the test actually makes the
kernel smaller.
netchild [Sun, 27 Aug 2006 18:51:32 +0000 (18:51 +0000)]
Fix video playing and network connections in realplayer (and most likely
other stuff) in the osrelease=2.6.16 case:
- implement CLONE_PARENT semantic
- fix TLS loading in clone CLONE_SETTLS
- lock proc in the currently disabled part of CLONE_THREAD
I suggest to not unload the linux module after testing this, there are
some "<defunct>" processes hanging around after exiting (they aren't
with osrelease=2.4.2) and they may panic your kernel when unloading the
linux module. They are in state Z and some of them consume CPU according
to ps. But I don't trust the CPU part, the idle threads gets too much CPU
that this may be possible (accumulating idle, X and 2 defunct processes
results in 104.7%, this looks to much to be a rounding error).
Noticed by: Intron <mag@intron.ac>
Submitted by: rdivacky (in collaboration with Intron)
Tested by: Intron, netchild
Reviewed by: jhb (previous version)
netchild [Sun, 27 Aug 2006 08:56:54 +0000 (08:56 +0000)]
Add the linux statfs64 call. This allows Tivoli backup to proceed a little
but further on -current (still not successful, but a step into the right
direction).
Sponsored by: Google SoC 2006
Submitted by: rdivacky
Tested by: Paul Mather <paul@gromit.dlib.vt.edu>
csjp [Sat, 26 Aug 2006 20:13:35 +0000 (20:13 +0000)]
Fix panic associated with file creation via RPC/NFS when the MLS policy
is loaded. This problem stems from the fact that the policy is not properly
initializing the mac label associated with the NFS daemon.
rwatson [Sat, 26 Aug 2006 17:59:31 +0000 (17:59 +0000)]
Allow the user process to query the kernel's notion of a maximum
audit record size at run-time, which can be used by the user
process to size the user space buffer it reads into from the audit
pipe.
marius [Sat, 26 Aug 2006 16:28:19 +0000 (16:28 +0000)]
Fix another bug introduced with rev. 1.204; in vfs_donmount() if
the 'vfs_getopt(optlist, "errmsg", (void **)&errmsg, &errmsg_len)'
call fails, 'errmsg' is left uninitialized, making the later tests
against NULL meaningless, and the uses bogus. Thus initialize
'errmsg' to NULL beforehand. [1]
While at it, remove the superfluous assignment of 0 to 'errmsg_len'
if the above mentioned call fails as it's already initialized to 0.