Jeff Roberson [Thu, 22 Aug 2002 07:01:52 +0000 (07:01 +0000)]
(forced commit to get the correct log message)
- Remove unsafe and dead code from getnewvnode().
- Fixup vclean() so that it grabs the VOP_LOCK before calling VOP_GETATTR()
and grabs interlock afterwards.
Jeff Roberson [Thu, 22 Aug 2002 06:58:11 +0000 (06:58 +0000)]
- Fix interlock handling in vn_lock(). Previously, vn_lock() could return
with interlock held in error conditions when the caller did not specify
LK_INTERLOCK.
- Add several comments to vn_lock() describing the rational behind the code
flow since it was not immediately obvious.
Jeff Roberson [Thu, 22 Aug 2002 06:51:06 +0000 (06:51 +0000)]
- Fix interlock handling in vn_lock(). Previously, vn_lock() could return
with interlock held in error conditions when the caller did not specify
LK_INTERLOCK.
- Add several comments to vn_lock() describing the rational behind the code
flow since it was not immediately obvious.
Marcel Moolenaar [Thu, 22 Aug 2002 03:56:57 +0000 (03:56 +0000)]
Fix a nasty memory corruption bug caused by having a bogus pointer
for the DT_IA64_PLT_RESERVE dynamic table entry. When a shared object
does not have any PLT relocations, the linker apparently doesn't find
it necessary to actually reserve the space for the BOR (Bind On
Reference) entries as pointed to by the DTE. As a result, relocatable
data in the PLT was overwritten, causing some unexpected control flow
with annoyingly predictable outcome: coredump.
To reproduce:
% echo 'int main() { return 0; }' > foo.c
% cc -o foo foo.c -lxpg4
Mike Barcroft [Thu, 22 Aug 2002 00:28:24 +0000 (00:28 +0000)]
Make __clock_t use `unsigned long' rather than a fixed 32-bit integer
so that it changes to the correct size in IP32L64 mode. Other
architectures don't have this issue.
Joerg Wunsch [Wed, 21 Aug 2002 20:54:45 +0000 (20:54 +0000)]
For scripts that are called in non-login environments (in particular
mail filters), the /usr/bin/perl dummy fails since it assumes that the
installed package could be reached via the existing $PATH. Also,
since we are obviously looking for a perl installed by a package, we
should make sure that at least the default package bindir is being
searched.
Julian Elischer [Wed, 21 Aug 2002 20:03:55 +0000 (20:03 +0000)]
Revert some suspension/sleep/signal code from KSE-III
We need to rethink a bit of this and it doesn't matter if
we break the KSE test program for now as long
as non-KSE programs act as expected.
Submitted by: David Xu <bsddiy@yahoo.com>
(this guy's just asking to get hit with a commit bit..)
Mike Barcroft [Wed, 21 Aug 2002 16:20:02 +0000 (16:20 +0000)]
o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
macros, which are only MD because of gratuitous differences between
architectures.
o Change all headers to make use of this. This mainly involves
changing:
#ifdef _BSD_FOO_T_
typedef _BSD_FOO_T_ foo_t;
#undef _BSD_FOO_T_
#endif
to:
#ifndef _FOO_T_DECLARED
typedef __foo_t foo_t;
#define _FOO_T_DECLARED
#endif
Fix a few typos, among them s/builtin/built-in/ (except for the ref
to the builtin(1) man page.) This is for consistency with the spelling
both proposed by ispell as well as IEEE Std 1003.1-2001.
Robert Drehmel [Wed, 21 Aug 2002 12:45:36 +0000 (12:45 +0000)]
- Define the macro _KERNEL to pretend we are compiling a kernel.
This is required by recent changes to <sys/pcpu.h>, which uses
the #error preprocessor directive to keep non-kernel
applications from using it.
_KERNEL is defined below the #include <stand.h>, because <stand.h>
removes the definition of _KERNEL.
- Move the inclusion of <sys/queue.h> above the inclusion of
<sys/linker.h> to avoid syntax errors.
Don Lewis [Wed, 21 Aug 2002 11:57:12 +0000 (11:57 +0000)]
Create new functions in_sockaddr(), in6_sockaddr(), and
in6_v4mapsin6_sockaddr() which allocate the appropriate sockaddr_in*
structure and initialize it with the address and port information passed
as arguments. Use calls to these new functions to replace code that is
replicated multiple times in in_setsockaddr(), in_setpeeraddr(),
in6_setsockaddr(), in6_setpeeraddr(), in6_mapped_sockaddr(), and
in6_mapped_peeraddr(). Inline COMMON_END in tcp_usr_accept() so that
we can call in_sockaddr() with temporary copies of the address and port
after the PCB is unlocked.
Fix the lock violation in tcp6_usr_accept() (caused by calling MALLOC()
inside in6_mapped_peeraddr() while the PCB is locked) by changing
the implementation of tcp6_usr_accept() to match tcp_usr_accept().
Jeff Roberson [Wed, 21 Aug 2002 08:34:48 +0000 (08:34 +0000)]
- Document two cases, one in vget and the other in vn_lock, where the state
of interlock on exit is not consistent. There are probably several bugs
relating to this.
Jeff Roberson [Wed, 21 Aug 2002 06:40:34 +0000 (06:40 +0000)]
- If vn_lock fails with the LK_INTERLOCK flag set, interlock will not be
released. vcanrecycle() failed to unlock interlock under this condition.
- Remove an extra VOP_UNLOCK from a failure case in vcanrecycle().
Jeff Roberson [Wed, 21 Aug 2002 06:19:29 +0000 (06:19 +0000)]
- Add two new debugging macros: ASSERT_VI_LOCKED and ASSERT_VI_UNLOCKED
- Use the new VI asserts in place of the old mtx_assert checks.
- Add the VI asserts to the automated lock checking in the VOP calls. The
interlock should not be held across vops with a few exceptions.
- Add the vop_(un)lock_{pre,post} functions to assert that interlock is held
when LK_INTERLOCK is set.
Warner Losh [Wed, 21 Aug 2002 05:31:04 +0000 (05:31 +0000)]
Treat IBSS the same as ADHOC in wi_get_cur_ssid. This makes ifconfig
work better, but might not make ibss actually work on the prism2 cards
that I have (this is the first time I've tried ibss in a long time).
Archie Cobbs [Tue, 20 Aug 2002 18:57:11 +0000 (18:57 +0000)]
When declaring local variables in macros, always use "_name" instead
of "name" to avoid ugly problems when the containing code already has
a variable named "name".
Hajimu UMEMOTO [Tue, 20 Aug 2002 16:38:05 +0000 (16:38 +0000)]
Previous commit of adding ut to xterm entry broke kterm-color entry.
3 bytes (ut:) seems too long for kterm-color. There is a limitation
of buffer size within 1024 bytes in our ncurses.
Submitted by: mistral@imasy.or.jp
Reviewed by: matusita
MFC after: 1 day
Yaroslav Tykhiy [Tue, 20 Aug 2002 14:56:06 +0000 (14:56 +0000)]
Clean up hostname and hostinfo handling in inithosts():
o check getaddrinfo(3) return value, not result pointer
o getaddrinfo(3) returns int, not pointer
o don't leak memory allocated for hostnames and hostinfo structures
o initialize pointers that will be checked for NULL somewhere
Be consistent about quoting things.
Be (somewhat) prepared for things to change size under us.
Recognize a empty attribute name as magic and print the list of attributes.
Use <err.h> for code clarity.
Deal with zero length returns.
Marcel Moolenaar [Tue, 20 Aug 2002 00:24:33 +0000 (00:24 +0000)]
Add support for the R_IA64_IPLTLSB relocation in non-PLT context.
This relocation creates a function descriptor at the specified
address and is commonly used for C++ to create virtual function
tables.
Peter Wemm [Mon, 19 Aug 2002 23:58:37 +0000 (23:58 +0000)]
de-count atkbdc. I have more extensive patches to make properly dynamic,
but since pc hardware only allows one AT-style keyboard controller, this
doesn't seem particularly urgent. (I do not know what the old sunriver
remote keyboard/mouse/vga cards do, that might be an exception).
Peter Wemm [Mon, 19 Aug 2002 23:56:01 +0000 (23:56 +0000)]
de-count schistory.c. The handling of NSC was rather bogus here and was
little more than a place holder, because nothing actually counted the
number of 'sc' units to compare it against NSC. A bit more work here
is needed so that the scaling of SC_MAX_HISTORY_SIZE and extra_history_size
goes up when more sc units are added. But, it does not appear that we can
have more than one console yet, so it does not seem particularly urgent.
Warner Losh [Mon, 19 Aug 2002 20:54:00 +0000 (20:54 +0000)]
When login tries to do the chmod/chflags on a read only file system,
it complains that it can't do it because the filesystem is readonly.
Assume that when the user has a readonly /dev that they don't care if
login can't change the permissions/flags. While this does break a few
things like msgs, we'll assume that the user setting up the read only
system knows what they are doing.
All this change does is to stop the complaint when the file system is
read only. It also adds comments as to why EROFS and EOPNOTSUPP are
ignored.
This allows one to have a read-only / w/o a /dev MFS and have a
relatively warning-free existence. /etc/rc still complains when it
can't chown/chflags/chmod things, but that's easy to ignore/tweak.