Commit Graph

635 Commits

Author SHA1 Message Date
Bruce Evans
f35a53bf11 Restored the (buggy) historical behaviour of getdomainname().
Negative name lengths for getdomainname() and setdomainname() were
converted to large positive ones by misdeclaring the args struct.
1995-11-12 07:04:30 +00:00
Bruce Evans
d2d3e8751c Included <sys/sysproto.h> to get central declarations for syscall args
structs and prototypes for syscalls.

Ifdefed duplicated decentralized declarations of args structs.  It's
convenient to have this visible but they are hard to maintain.  Some
are already different from the central declarations.  4.4lite2 puts
them in comments in the function headers but I wanted to avoid the
large changes for that.
1995-11-12 06:43:28 +00:00
Bruce Evans
c484c256a5 Updated machine-generated files. 1995-11-12 04:29:37 +00:00
Bruce Evans
93915a2ac4 Fixed the args list for mount(). We're not ready for the BSD4.4lite2/
NetBSD interface.

Increased the bogusness of the args list for mmap().  The args lists for
most of the memory mapping functions are bogus.  The args lists in
syscalls.master are a little better than the ones in the args structs
currently being used, but the improvement for mmap() changed the object
code and I don't want to worry about that now.

Increased the bogusness of the args list for fcntl.  BSD4.4lite2/NetBSD
uses `void *' instead of int for the third arg.  This has the advantage
of working when `void *'s are longer than ints, but requires extra bogus
casts that I hope to avoid.

Fixed the args list for uname.  `struct outsname' seems to be a typo,
not an old interface.

Added comments about bogus args lists for open, mount, msync, munmap,
mprotect, madvise, mincore, fcntl, semsys, msgsys and shmsys.
1995-11-12 04:24:53 +00:00
Bruce Evans
7147b19de5 Fixed the type of readv(). An args struct member name conflicted with the
machine-generated one in <sys/sysproto.h>.
1995-11-11 06:57:34 +00:00
Bruce Evans
82970b81a9 Fixed type of setsid(). It used used the bogus `getsid_args'. 1995-11-11 06:53:08 +00:00
Bruce Evans
b2f9e8b1ee Removed unreachable code.
Changed `#if defined()' back to `#ifdef' to finish removing COMPAT_IBCS2.
1995-11-11 05:49:22 +00:00
Bruce Evans
cf7e5eab8b Fixed types of rtprio(), osetrlimit() and setrlimit(). The args struct
tag and/or member names conflicted with the machine generated ones in
<sys/sysproto.h>.
1995-11-11 01:48:17 +00:00
Bruce Evans
2635f86c68 Fixed types of ogethostid() and osethostid(). The args struct names
conflicted with the machine generated ones in <sys/sysproto.h>.

Fixed type of oquota().  It didn't even use an args struct.
1995-11-11 01:04:42 +00:00
Bruce Evans
ceba6236e0 Fixed type of vfs_free_netcred().
Removed redundant declaration of insmntque().
1995-11-11 00:27:00 +00:00
Bruce Evans
3c8e79dd2b Fixed type of sysctl_order_cmp().
KNFized sysctl_order_cmp().
Staticized definition of kern_sysctl() to match its declaration.
1995-11-11 00:09:21 +00:00
Poul-Henning Kamp
69feb38841 Fix a minor buglet. 1995-11-10 16:22:41 +00:00
Poul-Henning Kamp
6ff1bbebdf convert more sysctl variables. 1995-11-10 09:58:53 +00:00
Poul-Henning Kamp
b8da239623 Make the old compat functions use the sysctl front door, rather than
crashing through the walls.
This should save Peters blood pressure and netscapes uname call.
1995-11-09 20:22:12 +00:00
Bruce Evans
5739bf963a Introduced lkm_nullcmd(), which will be used instead of nosys() in
some places to fix type mismatches.

Added prototypes and bogus casts.
1995-11-09 09:43:32 +00:00
Bruce Evans
f57e65478d Introduced a type `vop_t' for vnode operation functions and used
it 1138 times (:-() in casts and a few more times in declarations.
This change is null for the i386.

The type has to be `typedef int vop_t(void *)' and not `typedef
int vop_t()' because `gcc -Wstrict-prototypes' warns about the
latter.  Since vnode op functions are called with args of different
(struct pointer) types, neither of these function types is any use
for type checking of the arg, so it would be preferable not to use
the complete function type, especially since using the complete
type requires adding 1138 casts to avoid compiler warnings and
another 40+ casts to reverse the function pointer conversions before
calling the functions.
1995-11-09 08:17:23 +00:00
Poul-Henning Kamp
787d58f201 Fix some of the sysctl broke, and add a lot more to it. 1995-11-08 08:48:36 +00:00
John Dyson
5e527f652f This is a modification missed by me in the msync fixes a few days ago. 1995-11-07 05:09:43 +00:00
Poul-Henning Kamp
2e21099372 On working the new sysctl vars a bit I realized that I needed more generality.
This is here now.  We can now access (the new) sysctl variables from the
kernel too and using functions to handle access is more sane now.
I will now attack sysctl variables in the rest of the kernel and get them
all converted to newspeak.
1995-11-06 16:18:52 +00:00
David Greenman
c52007c2cc All:
Changed vnodep -> vp for consistency with the rest of the kernel, and
changed iparams -> imgp for brevity.

kern_exec.c:
   Explicitly initialized some additional parts of the image_params struct
to avoid bzeroing it. Rewrote the set-id code to reduce the number of
logical tests. The rewrite exposed a mostly benign bug in the algorithm:
traced set-id images would get ktracing disabled even if the set-id didn't
happen for other reasons.
1995-11-06 12:52:37 +00:00
Bruce Evans
8b25681eb5 Replaced bogus macros for dummy devswitch entries by functions.
These functions went away:

	enosys (hasn't been used for some time)
	enxio
	enodev
	enoioctl (was used only once, actually for a vop)

if_tun.c:
Continued cleaning up...

conf.h:
Probably fixed the type of d_reset_t.  It is hard to tell the correct
type because there are no non-dummy device reset functions.

Removed last vestige of ambiguous sleep message strings.
1995-11-06 00:36:19 +00:00
John Dyson
4dc4e0d228 Make MNT_ASYNC more effective for UFS. It should not be too much more
dangerous than the original MNT_ASYNC.  There might be some minor
security considerations due to data writes not being posted as promptly
as before.  Meta-data operations are still not quite as fast as Linux,
but streaming I/O is still higher.
1995-11-05 21:01:15 +00:00
John Dyson
aef922f514 Greatly simplify the msync code. Eliminate complications in vm_pageout
for msyncing.  Remove a bug that manifests itself primarily on NFS
(the dirty range on the buffers is not set on msync.)
1995-11-05 20:46:03 +00:00
Bruce Evans
286f8561e2 Replaced bogus macros for entry points to unconfigured line disciplines
by functions.

tty_conf.c:
Cleaned up formatting of tables.

Removed another ARGSUSED for consistency.

conf.h:
Introduced typedefs for line discipline functions.

Backed out most of previous revision (it is done elsewhere).
1995-11-05 20:25:59 +00:00
Bruce Evans
4fda91c705 Moved prototypes for devswitch functions from conf.c and driver sources
to <machine/conf.h>.  conf.h was mechanically generated by
`grep ^d_ conf.c >conf.h'.  This accounts for part of its ugliness.  The
prototypes should be moved back to the driver sources when the functions
are staticalized.
1995-11-04 13:25:33 +00:00
David Greenman
3956a1702c Return EINVAL if the number of groups is less than 1 in setgroups().
Obtained from:	4.4BSD-Lite2
1995-11-04 10:50:55 +00:00
Bruce Evans
046bc05396 Prototype getvnode() in the right place (where ibcs2_stat.c can see it). 1995-11-04 10:35:26 +00:00
Garrett Wollman
ff5c09da20 Make somaxconn (maximum backlog in a listen(2) request) and sb_max
(maximum size of a socket buffer) tunable.

Permit callers of listen(2) to specify a negative backlog, which
is translated into somaxconn.  Previously, a negative backlog was
silently translated into 0.
1995-11-03 18:33:46 +00:00
Peter Wemm
0839e0de72 Make putc and b_to_q deal with clists with no reserved blocks in a more
civilised manner than panicing.  This only happens as a result of another
state botch somewhere else, eg: from a tty driver calling putc or b_to_q
on a closed device.  Apparently, it's also been implicated in a panic
with a status (^T) event on ptys.

This change should pretty well be in it's final form now.
1995-11-02 08:37:22 +00:00
Peter Wemm
a317bc2c36 Clean up the previous commit I did on this file.
The Jury has not reached a verdict yet on this approach - a better fix
may be thought of, but for now this works.
1995-11-01 15:59:55 +00:00
Bruce Evans
bb1140a9a5 Fixed initialization of TS_CONNECTED bit in t_state. It wasn't
set in open() when CLOCAL is set unless carrier is present.

Fixed initialization of line discipline.  It lived across opens.
Lines that started with the wrong discipline probably didn't work
at all, because TS_ISOPEN is only set by TTYDISC.
1995-10-31 19:27:50 +00:00
Peter Wemm
e8c8f201ec Make a putc()/b_to_q() to a clist that hasn't had cblocks reserved
non-fatal.  I've make it return an appropriate error to the caller instead
of panic()ing.

Handling an error condition is inherently more friendly than exploding
the kernel.. :-)  The new behavior is a little closer to traditional
clists, potentially making porting a little simpler.

Suggested by: bde (many months ago, I've been using this for a while..)
1995-10-31 19:00:00 +00:00
Bruce Evans
7a6e2e527b Removed an annoying redundant declaration that I added in the previous
revision.
1995-10-30 17:16:55 +00:00
Poul-Henning Kamp
a98ca4699e Second batch of cleanup changes.
This time mostly making a lot of things static and some unused
variables here and there.
1995-10-29 15:33:36 +00:00
Poul-Henning Kamp
4ccc87c594 Remove unused functions and variables, make things static, and other cleanups. 1995-10-28 15:39:31 +00:00
Poul-Henning Kamp
3a34a5c3b8 Sorry, the last commit screwed up for me, this is the right one (I hope!)
Please refer to the previous commit message about sysctl variables.
1995-10-28 13:07:28 +00:00
Poul-Henning Kamp
b396cd832c Rewamp the way we make sysctl variables to be easier to cope with.
The goal is to make them "user-friendly" :-)

In the end this will allow a SNMP style "getnext" function, sysctl editing
in the boot-editor and/or debugger, LKMs can define sysctl vars when
they get loaded, and remove them when unloaded and other interesting
uses for dynamic sysctl variables.
1995-10-28 12:59:25 +00:00
Bruce Evans
e887950a45 Call vfs_unbusy() before error returns from sysctl_vnode(). This fixes
PR 795.

Set the size before one error return from sysctl_vnode() the same as before
the other.  The caller might want to know about the amount successfully
read although the current caller doesn't.
1995-10-28 08:50:08 +00:00
Bruce Evans
e2f15ca546 Fixed data loss in writes to pty masters. Data was almost always lost
at the end of each write for writes of more than 1K.

Fixed handling of residual count for early returns in writes to pty masters.
It was only adjusted in 2 out of 6 cases.

Added prototypes.
1995-10-25 18:23:58 +00:00
Bruce Evans
12bc45a8df Fix clist limits. They were usually one too low. E.g., for a limit of
TTYHOG = 1024 bytes, 10 cblocks were reserved.  This was thought to
provide 10 * CBSIZE = 1080 bytes of buffering, but if the head pointer
is at the end of a cblock, then it only provides 1 + 9 * CBSIZE = 973
bytes of buffering.  This caused serious data loss for ptys because the
flow control is deterministic and requires at least TTYHOG bytes of
buffering.  For ttys, if input flow control is used then there is
usually enough slop in the high watermark to avoid problems, and if
input flow control isn't used then a limit of 973 is not much different
from a limit of 1024.

Add prototypes.

Continue cleaning up new init stuff.
1995-10-25 17:59:58 +00:00
Steven Wallace
f23c6d682b Remove COMPAT_IBCS2 option.
Ibcs2 emulator no longer depends on owait() or any other hack to wait4().
1995-10-23 19:44:38 +00:00
Bruce Evans
8159bae9d0 Fix a sign extension bug that was unleashed by the previous change.
The total process time was sometimes 2^32 usec too large but that
wasn't a problem before because the time was bogusly truncated mod
2^32.
1995-10-23 19:05:50 +00:00
Bruce Evans
5fdb832498 Simplify the pseudo-argument removal changes by not optimizing for
the !COMPAT_43 case - use a common function even when there is no
`old' function.  The diffs for this are large because of code motion
to restore the function order to what it was before the pseudo-argument
changes.

Include <sys/sysproto.h> to get correct args structs and prototypes.
The diffs for this are large because the declarations of the args structs
were moved to become comments in the function headers.  The comments may
actually match the automatically generated declarations right now.

Add prototypes.
1995-10-23 15:42:12 +00:00
John Dyson
cd0402ec7a Interface change for the VOP_GETPAGES -- missed in previous commits. 1995-10-23 02:55:55 +00:00
David Greenman
d68a41903e Moved the filesystem read-only check out of the syscalls and into the
filesystem layer, as was done in lite-2. Merged in some other cosmetic
changes while I was at it. Rewrote most of msdosfs_access() to be more
like ufs_access() and to include the FS read-only check.

Obtained from: partially from 4.4BSD-lite2
1995-10-22 09:32:48 +00:00
Bruce Evans
725db531b8 Start including <sys/sysproto.h> to get the correct args structs and
prototypes for all syscalls.  The args structs are still declared in
comments as in VOP implementation functions.  I don't like the
duplication for this, but several more layers of changes are required
to get it right.  First we need to catch up with 4.4lite2, which uses
macros to handle struct padding.  Then we need to catch up with NetBSD,
which passes the args correctly (as void *).  Then we need to handle
varargs functions and struct padding better.  I think all the details
can be hidden in machine-generated functions so that the args structs
and verbose macros to reference them don't have to appear in the core
sources.

Add prototypes.

Add bogus casts to hide the evil type puns exposed by the previous
steps.  &uap[1] was used to get at the args after the first.  This
worked because only the first arg in *uap was declared.  This broke
when the machine- genenerated args struct declared all the args
(actually it declares extra args in some cases and depends on the
user stack having some accessible junk after the last arg, not to
mention the user args being on the stack.  It isn't possible to
declare a correct args struct for a varargs syscall).  The msgsys(),
semsys() and shmsys() syscall interfaces are BAD because they
multiplex several syscalls that have different types of args.
There was no reason to duplicate this sysv braindamage but now
we're stuck with it.  NetBSD has reimplemented the syscalls properly
as separate syscalls #220-231.

Declare static functions as static in both their prototype and their
implementation (the latter is optional, and this misfeature was used).

Remove gratuitous #includes.

Continue cleaning up new init stuff.
1995-10-21 19:50:00 +00:00
Bruce Evans
bcee717be5 Avoid overflow in calcru(). Fixes PR 788.
Submitted by:	imdave@synet.net (Dave Bodenstab)
1995-10-21 09:18:45 +00:00
David Greenman
079cc25b11 Killed a few gratuitous #include's. 1995-10-21 08:38:13 +00:00
John Dyson
6d875bf526 If we clear the B_CACHE flag because a buffer isn't composed fully of
valid bytes, we must also clear the B_DONE flag.  Some filesystems
depend on this (incl NFS) and is probably the cause of the biodone
error and subsequent crash.  Anyway this change needs to be made.
1995-10-19 23:48:25 +00:00
Steven Wallace
1e41c1b5d5 Implement SA_NODEFER sa_flag for sigaction():
Add SA_NODEFER define to signal.h
	Add ps_nodefer field to struct sigacts in signalvar.h.
	Add code to kern_sig.c to handle SA_NODEFER.

If flag is set, when the signal is delivered, it is not masked automatically
from receiving the same signal again.

Reviewed by:	 wollman, bde
1995-10-19 19:16:01 +00:00