Garrett Wollman [Mon, 15 Dec 1997 03:09:59 +0000 (03:09 +0000)]
Add support for poll(2) on files. vop_nopoll() now returns POLLNVAL
if one of the new poll types is requested; hopefully this will not break
any existing code. (This is done so that programs have a dependable
way of determining whether a filesystem supports the extended poll types
or not.)
The new poll types added are:
POLLWRITE - file contents may have been modified
POLLNLINK - file was linked, unlinked, or renamed
POLLATTRIB - file's attributes may have been changed
POLLEXTEND - file was extended
Note that the internal operation of poll() means that it is impossible
for two processes to reliably poll for the same event (this could
be fixed but may not be worth it), so it is not possible to rewrite
`tail -f' to use poll at this time.
Tor Egge [Mon, 15 Dec 1997 02:18:35 +0000 (02:18 +0000)]
Add support for low resolution SMP kernel profiling.
- A nonprofiling version of s_lock (called s_lock_np) is used
by mcount.
- When profiling is active, more registers are clobbered in
seemingly simple assembly routines. This means that some
callers needed to save/restore extra registers.
- The stack pointer must have space for a 'fake' return address
in idle, to avoid stack underflow.
John Birrell [Mon, 15 Dec 1997 02:12:42 +0000 (02:12 +0000)]
Fix recursion problem which occurs when a signal is received during
a malloc. The signal handler creates a thread which requires a malloc...
For now, the only thing to do is to block signals. When we move user
pthreads to use the kernel threads, mutexes will be implemented in kernel
space and then malloc can revert.
John Polstra [Sun, 14 Dec 1997 19:36:24 +0000 (19:36 +0000)]
Make gzipped dynamically linked executables work again. There was
an old bug here that failed to copy the a.out header into memory
properly. It didn't matter until changes were made recently to
the dynamic linker.
Mike Smith [Sun, 14 Dec 1997 03:17:54 +0000 (03:17 +0000)]
As described by the submitter:
- emulate Linux IP_HDRINCL behaviour in sendto(): byte order fixed
Note that we do an extra getsockopt() on every sendto()
to check if the option is set because we don't keep state
in the emulator code. Is there a better way to implement
this?
- correct a bug (value of "name" not passed) with
getsockopt()
Mike Smith [Sun, 14 Dec 1997 03:15:21 +0000 (03:15 +0000)]
As described by the submitter:
... fix a bug with orecvfrom() or recvfrom() called with
the MSG_COMPAT flag on kernels compiled with the COMPAT_43 option.
The symptom is that the fromaddr is not correctly returned.
John Dyson [Sun, 14 Dec 1997 02:11:23 +0000 (02:11 +0000)]
After one of my analysis passes to evaluate methods for SMP TLB mgmt, I
noticed some major enhancements available for UP situations. The number
of UP TLB flushes is decreased much more than significantly with these
changes. Since a TLB flush appears to cost minimally approx 80 cycles,
this is a "nice" enhancement, equiv to eliminating between 40 and 160
instructions per TLB flush.
Changes include making sure that kernel threads all use the same PTD,
and eliminate unneeded PTD switches at context switch time.
Bruce Evans [Sat, 13 Dec 1997 13:49:59 +0000 (13:49 +0000)]
Fixed EOF handing.
1. SS_CANTRCVMORE was initially set on the wrong socket, so reads
when there has never been a writer on the socket did not return 0.
Note that such reads are only possible if the fifo was opened in
(O_RDONLY | O_NONBLOCK) mode.
2. SS_CANTSENDMORE was initially set on the wrong socket, but this
was harmless because the wrong socket is never sent from and there
is no need to set the flag initially on the right socket (since open
in (O_WRONLY | O_NONBLOCK) mode fails if there is no reader...).
3. SS_CANTRCVMORE was cleared when read() returns. This broke the
case where read() returns 0 - subsequent reads are supposed to
return 0 until a writer appears. There is no need to clear the
flag when read() returns, since it is cleared correctly when a
writer appears.
Bruce Evans [Sat, 13 Dec 1997 12:58:09 +0000 (12:58 +0000)]
Restored fifo_pathconf() from rev.1.32. vop_stdpathconf() is too
general to be of much use. Using it here weakened the _PC_MAX_CANON,
_PC_MAX_INPUT and _PC_VDISABLE cases.
fifo_pathconf() is not quite correct either. _PC_CHOWN_RESTRICTED
and _PC_LINK_MAX should be handled by the host file system. For
directories, the host file system should let us handle _PC_PIPE_BUF.
Bruce Evans [Sat, 13 Dec 1997 12:30:34 +0000 (12:30 +0000)]
Restored ufs_pathconf() from rev.1.61. vop_stdpathconf() is too
general to be of much use. Using it here broke the _PC_NAME_MAX,
_PC_NO_TRUNC and _PC_PATH_MAX cases, and weakened the _PC_MAX_CANON,
_PC_MAX_INPUT and _PC_VDISABLE cases.
Wolfgang Helbig [Sat, 13 Dec 1997 11:51:16 +0000 (11:51 +0000)]
Delete "typedef ... date" (see style(9)).
In the man page Use ".Pp" instead of blank lines, adopt English
and stress that the Julian->Gregorian switch took place at
different dates in different countries.
Suggested by: Garrett.
Mike Smith [Sat, 13 Dec 1997 09:57:48 +0000 (09:57 +0000)]
This framework builds the 'minigzip' sample program supplied with
libz. It is a non-GPL-polluted minimal implementation of the 'gzip'
command, yielding a 12k executable (vs ~100k for gzip).
Sean Eric Fagan [Sat, 13 Dec 1997 03:13:49 +0000 (03:13 +0000)]
Change the ioctls for procfs around a bit; in particular, whever possible,
change from
ioctl(fd, PIOC<foo>, &i);
to
ioctl(fd, PIOC<foo>, i);
This is going from the _IOW to _IO ioctl macro. The kernel, procctl, and
truss must be in synch for it all to work (not doing so will get errors about
inappropriate ioctl's, fortunately). Hopefully I didn't forget anything :).
Brian Somers [Sat, 13 Dec 1997 02:37:33 +0000 (02:37 +0000)]
Allow random IP number allocation to peer.
Validate the peers suggested IP by attempting to make a routing table
entry.
Give up IPCP negotiation if the peer NAKs us with an unusable IP.
Always SIOCDIFADDR then SIOCAIFADDR when configuring the tun device.
Using SIOCSIFDSTADDR allows duplicate dst addresses (which we don't
want)!!!
Allow up to 200 interface names (was 50) (now that ppp can play server
properly).
Up the version number (1.5 -> 1.6).
Cosmetic:
Log unexpected CCP packets in the CCP log rather than the ERROR log.
Log unexpected Config Reqs in the appropriate LCP/IPCP/CCP log rather
than the ERROR log.
Log failed route additions and deletions with WARN, not TCPIP.
Log the option id and length for unrecognised IPCP options.
Change some .Sq to .Ar in the man page.
Bruce Evans [Fri, 12 Dec 1997 17:58:31 +0000 (17:58 +0000)]
MF22 (oops, I committed it to the wrong tree yesterday).
Changed lots of %ld's in format strings back to %d. %ld was right
when daddr_t was long, but Lite2 changed daddr_t to int32_t which
is implemented as `int' on i386's.
Peter Wemm [Fri, 12 Dec 1997 14:08:50 +0000 (14:08 +0000)]
I've been using these tweaks to enable the sound driver to talk to the
(mutant) Crystal CSS4236 chip on the Intel PR440FX SMP motherboard.
XXX this uses some rather ugly PnP bootstrap code that is *NOT* compatable
with 'controller pnp0' or *ANY* other PnP devices. If you use some other
PnP devices, enabling css0 will burn your house down. :-] The
"simplified" PnP init sequence directly blats your config(8) settings onto
the chip. I'm pretty sure 'css0' will conflict with 'mss0', this whole
area desperately needs a cleanup.
I have been using the following with some success on the PR440FX:
controller snd0
device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08 vector adintr
device opl0 at isa? port 0x388
device mpu0 at isa? port 0x330 irq 10 vector mpuintr
John Dyson [Fri, 12 Dec 1997 04:00:59 +0000 (04:00 +0000)]
We have had support for running the kernel daemons as threads for
quite a while, but forgot to do so. For now, this code supports
most daemons running as kernel threads in UP kernels, and as
full processes in SMP. We will soon be able to run them as
threads in SMP, but not yet.
Sean Eric Fagan [Fri, 12 Dec 1997 03:33:43 +0000 (03:33 +0000)]
Fix a problem with procfs_exit() that resulted in missing some procfs
nodes; this also apparantly caused a panic in some circumstances.
Also, since procfs_exit() is getting rid of the nodes when a process
exits, don't bother checking for the process' existance in procfs_inactive().
Eivind Eklund [Wed, 10 Dec 1997 17:52:49 +0000 (17:52 +0000)]
Merge from OpenBSD:
> Error out if someone tries to mv a mount point. Old behavior was to
> move all files contained in the mounted filesystem to the dest. dir
> which could be quite nasty. Personally, I think rename(2) should
> return EPERM or EINVAL instead of EXDEV.
Obtained from: OpenBSD mv.c rev 1.6 by Todd Miller <millert@openbsd.org>
Sean Eric Fagan [Tue, 9 Dec 1997 05:03:41 +0000 (05:03 +0000)]
Code to prevent a panic caused by procfs_exit(). Note that i don't know
what is teh root cause -- but, sometimes, a procfs vnode in pfshead is
apparantly corrupt (or a UFS vnode instead). Without this patch, I can
get it to panic by doing (in csh)
while (1)
ps auxwww
end
and it will panic when the PID's wrap. With it, it does not panic.
Yes -- I know that this is NOT the right way to fix it. But I haven't
been able to get it to panic yet (which confuses me). I am going to
be looking into the vgone() code now, as that may be a part of it.
Steve Passe [Mon, 8 Dec 1997 22:59:39 +0000 (22:59 +0000)]
The improvements to clock statistics by Tor Egge
Wrappered and enabled by the define BETTER_CLOCK (on by default in smpyests.h)
apic_vector.s also contains a small change I (smp) made to eliminate
the double level INT problem. It seems stable, but I haven't the tools
in place to prove it fixes the problem.
Reviewed by: smp@csn.net
Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
Sean Eric Fagan [Mon, 8 Dec 1997 22:09:39 +0000 (22:09 +0000)]
A couple of fixes from bruce: first of all, psignal is a void (stupid
me; unfortunately, also makes it hard ot check for errors); second, I had
managed to forget a change to PIOCSFL (it should be _IOW, not _IOR) I had
in my local copy, and Bruce called me on it.
Garrett Wollman [Mon, 8 Dec 1997 21:42:35 +0000 (21:42 +0000)]
This is a hack. Decode IEEE 802.1Q VLAN tagging so that we can decode
tagged traffic according to the encapsulated protocol. It needs in
addition modifications to the filter generator which would deal with
checking the ethertype and vlan header as required.
Brian Somers [Mon, 8 Dec 1997 20:22:12 +0000 (20:22 +0000)]
Deal with inflate() returning avail_in == avail_out == 0
We must call inflate again in case there's any pending output
despite our input buffer being empty. If the output buffer
is in fact already flushed, inflate() returns Z_BUF_ERROR.
There isn't really an error !
Kazutaka YOKOTA [Mon, 8 Dec 1997 11:54:42 +0000 (11:54 +0000)]
Explicitly state that the -t option is required only when the
moused command is not able to detect the appropriate protocol for the
give mouse automatically.
Nate Williams [Mon, 8 Dec 1997 06:35:07 +0000 (06:35 +0000)]
- Changed strcmp to strncmp for checking the CIS manufacturer strings,
since we only store CIS_MAXSTR data, and the users may stick the
'entire' CIS string returned from the card in /etc/pccard.conf and
cause the comparison to (bogusly) fail.
Sean Eric Fagan [Mon, 8 Dec 1997 01:06:36 +0000 (01:06 +0000)]
Use at_exit() to invoke procfs_exit() instead of calling it directly.
Note that an unload facility should be used to call rm_at_exit() (if
procfs is being loaded as an LKM and is subsequently removed), but it
was non-obvious how to do this in the VFS framework.
John Dyson [Mon, 8 Dec 1997 00:59:08 +0000 (00:59 +0000)]
Various of the ISP users have commented that the 1.41 version of the
nfs_bio.c code worked better than the 1.44. This commit reverts
the important parts of 1.44 to 1.41, and we will fix it when we
can get a handle on the problem.
Brian Somers [Sun, 7 Dec 1997 23:55:29 +0000 (23:55 +0000)]
Fix PAP, CHAP & LQR req (I broke the byte ordering when
I did the deflate re-org).
Make PAP & CHAP negotiation prettier in the log file.
If both PAP & CHAP are `enabled' and the peer NAKs CHAP
suggesting PAP, be friendly and REQ PAP the next time.
This is in line with the rfc.
Garrett Wollman [Sun, 7 Dec 1997 19:53:44 +0000 (19:53 +0000)]
Added some advice to avoid typedef'ing structures, as this breaks
information-hiding. Also recommended against naming typedefs to end
in _t unless POSIX or ANSI requires it, and in favor of using queue(3)
macros to generate lists rather than rolling one's own.