Commit Graph

1802 Commits

Author SHA1 Message Date
ragge
b3574d3923 VAX logical page size increased to 4k. 1998-08-21 13:41:09 +00:00
thorpej
1083dcb6ca Back out previous. 1998-08-18 18:16:30 +00:00
thorpej
7cc905f5c8 Add some braces to make egcs happy (ambiguous else warning). 1998-08-18 06:27:01 +00:00
thorpej
84f8a722d2 Deal with a VERY BOGUS -Wuninitialized warning. (Again, appears to be
__noreturn__ related)
1998-08-18 06:26:30 +00:00
thorpej
f3d7e7e21c Add some braces to make egcs happy (ambiguous else warning). 1998-08-18 06:11:35 +00:00
thorpej
e00e495827 Add missing simple_unlock(), from Stefan Grefen, PR #5981. 1998-08-17 17:29:20 +00:00
mycroft
bf886f2029 Assign my copyrights to TNF. 1998-08-15 05:19:50 +00:00
mycroft
6d3d8a1350 Make copyright notices with my name consistent. 1998-08-15 03:02:31 +00:00
thorpej
09efdbb42d Oops, this got missed in the vm_offset_t -> vaddr_t change. 1998-08-13 19:15:33 +00:00
kleink
5350df2953 Per POSIX, fail with EINVAL if advisory locking is attempted on a file type
that doesn't support it, rather than using a homegrown EBADF or EOPNOTSUPP.
1998-08-13 10:06:31 +00:00
eeh
a2dd74ed79 Merge paddr_t changes into the main branch. 1998-08-13 02:10:37 +00:00
kleink
7b07ad780a Per XNS Issue 5, calling recvmsg(2) or sendmsg(2) with an msg.msg_iovlen less
than or equal to 0 shall fail with EMSGSIZE; the latter condition was not being
checked for.  Also, document the msg.msg_iovlen > {IOV_MAX} case.
1998-08-04 19:48:34 +00:00
kleink
c6ef57702d UIO_MAXIOV -> IOV_MAX 1998-08-04 12:19:15 +00:00
perry
275d1554aa Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)
1998-08-04 04:03:10 +00:00
kleink
3d9b4a4320 Fix two off-by-one bugs, both present in each recvmsg(2) and sendmsg(2):
* the first one would cause an unnecessary malloc() of iovec storage for
  a msg_iovlen of UIO_SMALLIOV although the required amount of memory has
  been allocated on the stack.
* the second one would cause a recvmsg() or sendmsg() with a msg_iovlen of
  UIO_MAXIOV to fail with EMSGSIZE, which is also a violation of XNS5.
1998-08-03 15:15:58 +00:00
kleink
c68582d64b UIO_MAXIOV -> IOV_MAX 1998-08-03 15:01:00 +00:00
kleink
5404ba4886 Add support to query the
* availability of POSIX Synchronized I/O (kern.synchronized_io),
* maximum number of iovec structures to be used in readv(2) etc. (kern.iov_max)
via sysctl().
1998-08-03 14:38:20 +00:00
thorpej
85b7cfc8c3 Make sure we initialize pr_nidle. 1998-08-02 19:07:47 +00:00
kleink
b7877d3fc0 Implement support for IEEE Std 1003.1b-1993 syncronous I/O:
* if synchronized I/O file integrity completion of read operations was
  requested, set IO_SYNC in the ioflag passed to the read vnode operator.
* if synchronized I/O data integrity completion of write operations was
  requested, set IO_DSYNC in the ioflag passed to the write vnode operator.
1998-08-02 18:39:14 +00:00
thorpej
a4c7bab10e Use the pool allocator for sockets. 1998-08-02 04:53:11 +00:00
thorpej
0e28b643e9 Use a pool for proc structures. 1998-08-02 04:41:32 +00:00
thorpej
6f739e1a66 Fix a braino in the idle page instrumentation. 1998-08-02 04:34:46 +00:00
thorpej
7c61b8cdd8 Instrument "idle pages" (i.e. pages which have no items allocated from
them, and could thus be freed back to the system).
1998-08-01 23:44:20 +00:00
thorpej
3c658f1f41 Don't call the protocol drain routines if how == M_NOWAIT, which typically
means we're in interrupt context.  Since we can be called from a network
hardware interrupt, we could corrupt the protocol queues we try to drain
them at that time.
1998-08-01 01:47:24 +00:00
thorpej
c56c24f4fd Initialize the mbuf allocator _before_ autoconfiguration; it might be
called when devices attach, take two.

Note that it is necessary that mbinit() NOT allocate memory, since it
is called before mb_map is created.  This is not a problem with the
pool allocator that is now used for mbufs and mbuf clusters.
1998-08-01 01:36:35 +00:00
thorpej
e7521693c1 Use the pool allocator for mbufs and mbufs clusters (two pools, one for
each).  Partially from pk@netbsd.org.
1998-08-01 01:35:20 +00:00
thorpej
e8b92fa131 Oops, back out previous. I need to attack that problem differently. 1998-08-01 01:20:43 +00:00
perry
730baa7431 fix sizeofs so they comply with the KNF style guide. yes, it is pedantic. 1998-07-31 22:50:48 +00:00
thorpej
17e88cf50e Initialize the mbuf allocator _before_ autoconfiguration; it might be
called when devices attach.
1998-07-31 21:59:55 +00:00
thorpej
fe7696eacb Un-static pool_head; vmstat wants to find it. 1998-07-31 21:55:09 +00:00
kleink
17de9df6c1 Reject an iovcnt argument of 0 to readv(), writev(), preadv() and pwritev()
as invalid.  This has been stated by the respective manual pages at least
since Net/2, and is the behaviour specified by XSH5.
1998-07-31 15:38:58 +00:00
mycroft
f53fedba63 Regen. 1998-07-30 00:46:27 +00:00
mycroft
d588e17601 __Namespace__ __protection__. 1998-07-30 00:46:01 +00:00
thorpej
4b039671de When checking for overflow in the residual count, test against SSIZE_MAX.
The read/write system calls return ssize_t because -1 is used to indicate
error, therefore the transfer size MUST be limited to SSIZE_MAX, otherwise
garbage can be returned to the user.

There is NO change from existing behavior here, only a more precise
definition of that the semantics are, except in the Alpha case, where
the full SSIZE_MAX transfer size can now be realized (ssize_t is 64-bit
on the Alpha).
1998-07-29 02:07:19 +00:00
thorpej
6326c90134 Change the "aresid" argument of vn_rdwr() from an int * to a size_t *,
to match the new uio_resid type.
1998-07-28 18:37:47 +00:00
thorpej
e95c22ee96 Don't cast the null residual pointer passed to vn_rdwr(). 1998-07-28 18:17:34 +00:00
thorpej
80e25bcca0 Don't cast the null residual pointer passed to vn_rdwr(). 1998-07-28 18:11:39 +00:00
thorpej
939279f988 When checking for overflow in the residual count, test against SSIZE_MAX.
The read/write system calls return ssize_t because -1 is used to indicate
error, therefore the transfer size MUST be limited to SSIZE_MAX, otherwise
garbage can be returned to the user.

There is NO change from existing behavior here, only a more precise
definition of that the semantics are, except in the Alpha case, where
the full SSIZE_MAX transfer size can now be realized (ssize_t is 64-bit
on the Alpha).
1998-07-28 17:58:29 +00:00
thorpej
bf51a1d137 uvm_deallocate() takes an address and a size, not an address range. From
ITOH Yasufumi <yasufu-i@is.aist-nara.ac.jp>, PR #5834.
1998-07-24 20:47:59 +00:00
thorpej
fc4828b0b4 A few small changes to how pool pages are allocated/freed:
- If either an alloc or release function is provided, make sure both are
  provided, otherwise panic, as this is a fatal error.
- If using the default allocator, default the pool pagesz to PAGE_SIZE,
  since that is the granularity of the default allocator's mechanism.
- In the default allocator, use new functions:
	uvm_km_alloc_poolpage()/uvm_km_free_poolpage(), or
	kmem_alloc_poolpage()/kmem_free_poolpage()
  rather than doing it here.  These functions may use pmap hooks to
  provide alternate methods of mapping pool pages.
1998-07-24 20:19:23 +00:00
sommerfe
1c2f0a15fd Don't create the extent region pool until one of our callers is of the
opinion that it's safe to call malloc.
1998-07-24 06:40:45 +00:00
pk
4e465abf3f Use a memory pool instead of malloc to allocate region descriptors. 1998-07-23 20:57:17 +00:00
pk
e32923a128 Re-vamped pool manager.
* support for customized memory supplier
	* automatic page reclaim by VM system
	* time-based hysteresis
	* cache coloring (after Bonwick's "slabs")
1998-07-23 20:34:00 +00:00
lukem
786b86d71b use AF_LOCAL instead of AF_UNIX 1998-07-18 05:04:35 +00:00
thorpej
4c50a37133 Back out previous, I botched something. 1998-07-16 00:46:50 +00:00
pk
3036bcf8e5 Close a descriptor leak. This proved especially detrimental under heavy
paging.
1998-07-15 12:38:29 +00:00
thorpej
b20c7bf68c For SOCK_STREAM, provide the socket credentials to the accepter as soon as
the client connects.
1998-07-10 22:15:47 +00:00
jonathan
b37021c1a1 defopt NATM. 1998-07-05 22:48:05 +00:00
jonathan
d275e56dee * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
1998-07-05 08:49:30 +00:00
jonathan
011f2bda08 defopt NS, NSIP. 1998-07-05 06:49:00 +00:00
jonathan
5c0c5dd0b4 defopt ISO TPIP. 1998-07-05 04:37:35 +00:00
jonathan
8db0fcdbf7 defopt CCITT. 1998-07-05 02:12:22 +00:00
jonathan
3751946b97 defopt INET, NETATALK. 1998-07-05 00:51:04 +00:00
jonathan
466e784ee1 defopt DDB. 1998-07-04 22:18:13 +00:00
thorpej
e5f49cece3 Regen: pad off_t args in pread/pwrite/preadv/pwritev. 1998-07-02 01:24:24 +00:00
thorpej
d4e618b3a5 Argh, pad the off_t args in pread/pwrite/preadv/pwritev. System call
numbers don't change since the window of brokenness was so small (1 day).
1998-07-02 01:23:33 +00:00
thorpej
bc799897fc Implement pread(2), pwrite(2), preadv(2), and pwritev(2). 1998-06-30 19:36:24 +00:00
thorpej
1f37d1d569 Regen: added pread(2), pwrite(2), preadv(2), pwritev(2). 1998-06-30 19:34:20 +00:00
thorpej
f0dda0d383 Add positional read and write system calls:
- pread() (#173) and pwrite() (#174), which are defined by XPG4.2.  System
  call numbers match Solaris.
- preadv() (#289) and pwritev() (#290), which are the positional cousins
  of readv() and writev(), but not defined by any standard.
1998-06-30 19:33:11 +00:00
thorpej
b6781dbaa2 Split up read/readv/write/writev into the system call front-end and
the guts that actually perform the I/O request.
1998-06-30 07:39:22 +00:00
thorpej
a4a34ba74a Add two additional arguments to the fileops read and write calls, a
pointer to the offset to use, and a flags word.  Define a flag that
specifies whether or not to update the offset passed by reference.
1998-06-30 05:33:11 +00:00
nathanw
30cbf42b77 Implement short corefile name support, controlled by options SHORTCORENAME
and sysctl kern.shortcorename.

Closes PR kern/5191.
1998-06-28 21:34:58 +00:00
thorpej
816e12eac2 defopt COMPAT_SVR4 1998-06-26 00:07:06 +00:00
thorpej
37b378d836 defopt COMPAT_HPUX 1998-06-25 23:56:39 +00:00
thorpej
8aee7782f5 defopt COMPAT_SUNOS 1998-06-25 23:40:33 +00:00
thorpej
311bac3348 defopt COMPAT_IBCS2 1998-06-25 23:22:37 +00:00
thorpej
c466f11939 defopt COMPAT_LINUX 1998-06-25 23:18:23 +00:00
thorpej
1a2cb1b9d4 defopt COMPAT_FREEBSD 1998-06-25 22:49:18 +00:00
thorpej
6b781d156f defopt NFSSERVER 1998-06-25 22:17:36 +00:00
thorpej
23e23646da Regen: defopt NFSSERVER 1998-06-25 22:17:21 +00:00
thorpej
d87e6c2b0e defopt NFSSERVER 1998-06-25 22:16:01 +00:00
thorpej
808867c7cf defopt KTRACE 1998-06-25 21:17:15 +00:00
thorpej
5b5a9f45a5 Regen: defopt KTRACE 1998-06-25 21:16:58 +00:00
thorpej
d6289815b4 defopt KTRACE 1998-06-25 21:15:35 +00:00
sommerfe
7ba7fbbb23 Always include fifos; "not an option any more". 1998-06-24 20:58:44 +00:00
sommerfe
becaafeea0 defopt for options FIFO 1998-06-22 22:00:59 +00:00
thorpej
387a1c5d41 Implement config_defer(), a generic mechanism to defer the configuration
of a device until all of its parent's children have been attached.
1998-06-09 18:46:12 +00:00
kleink
636443752e Nuke a couple of non-local prototypes which are already declared in either
<sys/buf.h>, <sys/mount.h> or <sys/vnode.h>.
1998-06-08 15:52:07 +00:00
thorpej
618c279d16 Add fine-grained locking. Still one refinement to make, which will be
done in a separate commit.
1998-06-06 02:25:46 +00:00
kleink
4648a78bba Regen: addition of fdatasync(). 1998-06-05 20:36:53 +00:00
kleink
e9d6f5e996 Per IEEE Std 1003.1b-1993, implement the fdatasync() system call which is
identical to fsync() with the expecption of not being required to synchronize
file status information.
1998-06-05 20:31:36 +00:00
kleink
382743ada3 Convert fsync vnode operator implementations and usage from the old `waitfor'
argument and MNT_WAIT/MNT_NOWAIT to `flags' and FSYNC_WAIT.
1998-06-05 19:53:00 +00:00
kleink
b5a587ab63 Regen: fsync argument change. 1998-06-05 19:41:21 +00:00
kleink
c77a008cc2 Replace the waitfor' argument to the fsync vnode operator with a flags'
argument.
1998-06-05 19:38:56 +00:00
kleink
4c3bf73d01 Regen: mlock() and munlock() prototype changes. 1998-05-30 22:23:30 +00:00
kleink
bb7e6a0bdd Per XSH98, const'ify the `addr' arguments to mlock() and munlock(). 1998-05-30 22:21:03 +00:00
kleink
2a4b2482f5 Permit checking the availability of the POSIX File Synchronization Option
(a/k/a fsync(2)), System V style message queues, semaphores and shared memory
at runtime by adding a sysctl variable for each.
1998-05-24 19:52:01 +00:00
matt
b2c24dbcbe Add an if_drain to the ifnet structure (call when the system is low
on mbufs).  Add code to m_reclaim to call if_drain in each ifnet
that has one set.  Remove register from declarations.
1998-05-22 17:47:21 +00:00
thorpej
ad7a87400a defopt LOCKDEBUG 1998-05-20 01:32:29 +00:00
pk
d0e85dde99 Inline vref/vrele in vclean() because:
* we already have the vnode interlock, so vref() should not ask for it again.
* we call VOP_RECLAIM/VOP_INACTIVE(), which shouldn't be duplicated in vrele().
1998-05-18 14:59:49 +00:00
pk
addb5d9572 VOP_CLOSE() takes F* flags, not IO_* flags. 1998-05-08 21:02:35 +00:00
kleink
fe2d01988e Fix some arithmetics lossage on typeless pointers. 1998-05-08 18:18:55 +00:00
kleink
bd6d376a49 Various SysV IPC prototype changes. 1998-05-07 18:00:49 +00:00
kleink
fb27bb18d3 Regen: various SysV IPC prototype changes. 1998-05-07 17:24:30 +00:00
kleink
e3611654cd Several SYSV IPC prototype changes. 1998-05-07 17:08:42 +00:00
enami
9ad895e33c Backout previous issignal() change so that gdb can trace a process
which has subprocess again; the lite2 change conflicts our local change.
1998-05-07 00:45:16 +00:00
thorpej
7f21dfafc1 Add monotonically increasing "current time" stamps for pfslowtimo() and
pffasttimo().
1998-05-06 01:11:46 +00:00
christos
1efd649b47 Regen 1998-05-02 18:34:13 +00:00
christos
02cecf686a New fktrace syscall from Darren Reed [with fixes from me] 1998-05-02 18:33:19 +00:00
thorpej
73863dd3c9 Pass vslock() and vsunlock() a proc *, rather than implicitly operating
on curproc.
1998-04-30 06:28:57 +00:00
mycroft
f327fee4ca Fix KTROP_CLEARFILE so it does the same thing as KTROP_CLEAR (i.e. vrele()
rather than vn_close()).  Fixes PR 5357.
1998-04-28 22:27:22 +00:00
kleink
82eb51ee05 In soshutdown(), decouple the evaluation of the `how' argument from FREAD
and FWRITE; use SHUT_{RD,WR,RDWR} instead.
Also, return EINVAL if `how' is invalid.
1998-04-27 13:31:45 +00:00
thorpej
7a239c12c6 In vfs_unmountall(), if curproc is NULL, abort, because unmounting
puts the requesting process to sleep until the file systems buffers
have flushed, and sleeping with a NULL curproc will cause a fault.
1998-04-26 19:10:33 +00:00
thorpej
cbc64bb02d Make vfs_shutdown() look a little nicer. 1998-04-26 18:58:54 +00:00
mycroft
359fa37f9a Fix a condition where we might erroneously write out a buffer with garbage
left in it.
Fixes PR 5354.
1998-04-26 14:45:23 +00:00
matthias
818f5df269 new command "config" to set type (for c), constraint and printmodifier. 1998-04-25 19:48:27 +00:00
matt
754c43dcfc Hook for 0-copy (or other optimized) sends and receives 1998-04-25 17:35:18 +00:00
jonathan
6c0abe64fc defopt NTP and PPS_SYNC, in preparation for adding PPS support. 1998-04-22 07:08:11 +00:00
thorpej
2018d40811 Allocate kernel virtual address space for the U-area before allocating
the new proc structure when performing a fork.  This makes it much
easier to abort a fork operation and return an error if we run out
of KVA space.

The U-area pages are still wired down in {,u}vm_fork(), as before.
1998-04-09 00:23:38 +00:00
mycroft
ca63148e3d Oops; forgot to update prototype. 1998-03-30 06:18:05 +00:00
mycroft
f1ed6cae04 Argument to main() is no longer used. 1998-03-30 06:15:44 +00:00
mrg
af54a244f4 add missing int to typedef 1998-03-30 02:32:38 +00:00
mrg
f0fc5e8ca7 remove register from decl. 1998-03-29 05:19:43 +00:00
kleink
5d9a1f3207 Regen: syscalls.master changed. 1998-03-27 13:09:52 +00:00
kleink
3a1500efe9 Per X/Open CAE Spec Issue 5 Version 2, change the buffer size argument of
readlink() from type `int' to type `size_t'.  This isn't an ABI change, since
the calling convention of our only LP64 platform (the Alpha) already promotes
this argument to a `long'.

This may not be the final action on this matter; readlink() still returns
an `int', which may change in a future revision of the standard.
1998-03-27 13:02:20 +00:00
thorpej
b436157e65 Make proc0 use the statically-allocate vmspace0 again, and make it use
the kernel's pmap, since proc0 (and other that share its address space)
are kernel-only processes, and should never contain userspace mappings.

This makes it easier to detect errors, like entering user mappings
for kernel processes, in pmap modules, and makes some sense, considering
that kernel processes are really just "thread contexts" for the kernel.
1998-03-27 01:52:01 +00:00
thorpej
272d8a4a38 Process 2 (the pagedaemon) always runs in kernel space, so share VM
space with proc0.
1998-03-22 18:22:07 +00:00
mycroft
2bb5067e13 Move the code to wait for carrier on a tty into a common function, since it
depends only on device-independent state bits.
Implement SunOS-style `dialout' devices.
1998-03-22 00:55:37 +00:00
mycroft
2ada4b4af1 Replace TS_WOPEN with t_wopen, per mail on tech-kern. 1998-03-21 04:02:47 +00:00
kleink
071ab13ebb Move the permission check in change_owner() back to ufs_vnops::ufs_chown()
again - the facility required in this context would be a filesystem-specific
super-user determination, which is not available yet.  Also, add some
clarification to a comment.
1998-03-10 11:49:33 +00:00
fvdl
1d02bb10d8 Clarify vget() comment a bit. 1998-03-04 09:13:48 +00:00
thorpej
9ebbb62608 Export spechash_slock; it's used outside of vfs_subr.c 1998-03-03 02:22:00 +00:00
thorpej
0080eaa0f5 Don't panic if DIAGNOSTIC in cluster_rbuild() if we aren't able to shed
memory in a buffer returned by geteblk().  Instrument the number of
occurrences.
1998-03-02 19:28:07 +00:00
ross
94ae870894 Compile post-lite2 with #ifndef DIAGNOSTIC 1998-03-01 09:51:29 +00:00
fvdl
78447a3cfd Regen. 1998-03-01 02:29:59 +00:00
fvdl
e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
perry
a5385186b1 regen 1998-02-25 21:30:36 +00:00
perry
56c01cbd82 change second parm of sysarch() from char * to void * 1998-02-25 21:24:56 +00:00
chuck
5ad9218203 fix uvm-related protection error: we can't write protect the
vmcmd_map_readvn() area until after we do vn_rdwr().  should fix
problem reported by sean doran.
1998-02-23 18:53:22 +00:00
hannken
1bb761e96f Didn't compile with option MEMORY_DISK_HOOKS. 1998-02-22 12:53:53 +00:00
mycroft
28e8037334 Fix missing newline in time zone warning. 1998-02-20 07:22:14 +00:00
pk
201f7cf6b4 Add option to use "static" storage provided by the caller.
From Matthias Drochner.
1998-02-19 23:51:48 +00:00
thorpej
95cd40bf13 Regen; makesyscalls.sh changed 1998-02-19 03:31:11 +00:00
thorpej
78a9bfbb1c Argh, protect userland from includes in the syscall names file. 1998-02-19 03:30:24 +00:00
thorpej
2fc4c3415a Include the UNION option header. 1998-02-19 00:53:46 +00:00
thorpej
990ca1baa0 Regen; syscalls.master and makesyscalls.sh changed. 1998-02-19 00:53:17 +00:00
thorpej
58fff16650 Include the NFS and LFS option headers. 1998-02-19 00:52:14 +00:00
thorpej
b0b3787d14 Include the NFS option header. 1998-02-19 00:47:02 +00:00
thorpej
0640c5a64f Put #include directives in the system call names file, too, so we can
generate dependencies on optional system calls.
1998-02-18 23:14:55 +00:00
thorpej
9a3b52d482 Yay! This file is finally DEAD DEAD DEAD! 1998-02-18 07:17:13 +00:00
thorpej
d1f0dbf1b1 Don't use vfssw[], it's gone; use vfs_list instead.
Implement vfs_attach() and vfs_detach(), which add and remove file systems
from the kernel.
1998-02-18 07:16:41 +00:00
thorpej
6c57a3c322 Change vfs_opv_init_explicit() to not allocate the vnode operations
vectors; defer that to vfs_opv_init().

Change the interface to vfs_opv_init() and export it; it now takes a
pointer to an array of vnodeopv_desc *'s to initialize.  Allocate
the vnode operations vectors here.  Called by vfs_attach().

Implement vfs_opv_free(), which deallocates the vnode operations
vectors.  Called by vfs_detach().

Change vfsinit() to build the initial vfs_list by traversing the
vfs_list_inital[] table, and vfs_attach()'ing those file systems.
Also, initialize special vnodeopv_descs (dead, fifo, spec) which
are not associated with any particular file system.
1998-02-18 07:15:30 +00:00
thorpej
c7a0984b02 vfssw[] is gone; use vfs_list instead. 1998-02-18 07:11:46 +00:00
thorpej
da61b242a0 Use vfs_attach()/vfs_detach(). 1998-02-18 07:11:21 +00:00
kleink
f339e80ad6 Regen: syscalls.master change (addition of __posix_chown(), __posix_fchown(),
__posix_lchown(); posix_rename() -> __posix_rename()).
1998-02-14 20:05:53 +00:00
kleink
3404e6deb3 Implement __posix_chown(), __posix_fchown() and __posix_lchown(). Also,
rename posix_rename() to __posix_rename() to follow this convention.
1998-02-14 20:01:05 +00:00
kleink
3ef309317a * Factor out some permission-checking code from ufs_setattr() into
change_owner().
* Change the semantics of chown(), fchown() and lchown(): when requesting a
  change of the owner of a file, clear the set-user-id bit; analogous behaviour
  for group changes.
* Since the above is a violation of the semantics specified by POSIX and
  X/Open, add corresponding compatibility syscalls: __posix_chown(),
  __posix_fchown(), __posix_lchown().  (Neither fchown() nor lchown() is
  specified by POSIX; the prefix is intended to reflect the semantics.)
* Rename posix_rename() to __posix_rename() to follow the above convention.
1998-02-14 19:49:43 +00:00
kleink
59fe905973 Fix variable declarations: register -> register int. 1998-02-14 19:34:12 +00:00
thorpej
c1538fb038 Implement TIOCGSID. 1998-02-14 01:26:50 +00:00
thorpej
50c9f48319 Implement getsid(2), as defined by XPG4.2: returns the process group ID
of the session leader of the specified process's session.
1998-02-14 01:17:51 +00:00
thorpej
6da644fd03 Regen: syscalls.master changes (getsid(2)) 1998-02-14 00:40:45 +00:00
thorpej
da187f7f6d Reserve syscalls 283, 284, and 285 for 3 up-coming POSIX systems calls,
per kleink.  Add XPG4.2's getsid(2) at #286.
1998-02-14 00:39:33 +00:00
thorpej
d2924ae854 Prevent the session ID from disappearing if the session leader exits
(thus causing s_leader to become NULL) by storing the session ID separately
in the session structure.  Export the session ID to userspace in the
eproc structure.

Submitted by Tom Proett <proett@nas.nasa.gov>.
1998-02-14 00:37:26 +00:00
kleink
af9cc34b3c Add ONOCR and ONLRET output modes, from XPG4.2. 1998-02-13 21:53:44 +00:00
tls
561bc2f4ad Remove rounding-down of hash size in hashinit(); support non &hashmask hash functions such as % [prime number] without bletcherous hacks. 1998-02-13 17:36:41 +00:00
kleink
0dc9b5452d Fix variable declarations: register -> register int. 1998-02-12 20:39:41 +00:00
mrg
d90485202c - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
1998-02-10 14:08:44 +00:00
scottb
876dc027a1 added support for SCO UNIX (derived from iBCS2) 1998-02-09 01:29:10 +00:00
thorpej
1305ecbe62 Allow callers of uvm_km_suballoc() to specify where the base of the
submap _must_ begin, by adding a "fixed" boolean argument.
1998-02-08 06:15:53 +00:00
chs
ea8413cff7 whoops! undo GC, these are still used by OLDVM.
not paying attention...
1998-02-07 16:23:35 +00:00
chs
f64abc7b4c add flags arg to hashinit(), to pass to malloc(). 1998-02-07 02:44:44 +00:00
chs
0711fdaf0b fix a locking problem by replacing the call to uvm_kernacc()
with an inlined version that uses kmem_map instead of kernel_map.
1998-02-07 02:40:36 +00:00
chs
d7d62b7ad3 snazzier LOCKDEBUG code. 1998-02-07 02:14:04 +00:00
chs
a4a3a88958 GC unused stuff. 1998-02-07 02:13:00 +00:00
thorpej
6b1ff3c892 When copying out multiple control messages, ensure that the next control
message is aligned.  From David Borman <dab@bsdi.com>.
1998-02-06 23:19:26 +00:00
mrg
5ef401eaaf oops, forgot to add this file earlier. 1998-02-05 14:58:45 +00:00
mrg
1a8c7604f4 initial import of the new virtual memory system, UVM, into -current.
UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)
1998-02-05 07:59:28 +00:00
thorpej
96f3f45d08 When loading a VFS LKM, use vfs_getopsbyname() to check if the file system
already exists.
1998-02-03 09:18:03 +00:00
thorpej
ec98cfce8a sys_mount(): Use vfs_getopsbyname() rather than groveling the vfssw[]
manualls.
1998-02-03 09:11:55 +00:00
ross
7516424fe6 Teach the NTP PLL how to lock when hz == 1000. 1998-01-31 10:42:11 +00:00
thorpej
4c54445530 Use offsetof() from libkern.h 1998-01-28 02:35:10 +00:00
thorpej
2ee3e0153d Generate dependencies on the exec format options EXEC_AOUT, EXEC_ECOFF,
EXEC_ELF32, EXEC_ELF64, and EXEC_SCRIPT.
1998-01-22 01:32:14 +00:00
thorpej
ea9ade0496 Generate dependencies on the INSECURE option. 1998-01-22 01:18:30 +00:00
thorpej
6428828e64 Const'ify the extent name. 1998-01-21 22:33:49 +00:00
thorpej
66abe4217c Implement an activity log for malloc() and free(), useful for tracking
down "Data modified on freelist" and "muliple free" problems.

The log is activated by the MALLOCLOG option, and the size of the
event ring buffer is controlable via the MALLOGLOGSIZE option (default
is 100000 entries).

From Chris Demetriou, cleaned up a little by me per suggestions in the
e-mail from Chris that contained the code.
1998-01-21 22:24:32 +00:00
thorpej
561056f2e2 Grab a fix from 4.4BSD-Lite2: open(2) with O_FSYNC and MNT_SYNCHRONOUS
had not effect.  Fix: check for either of these flags in vn_write(),
and pass IO_SYNC down if they're set.
1998-01-14 22:08:44 +00:00
perry
3fe138c146 RCS Id Police. 1998-01-09 08:03:16 +00:00
thorpej
c5a2e825a0 Regen. 1998-01-09 06:41:17 +00:00
thorpej
b59d427988 Add RCS IDs to generated files, in correct place. 1998-01-09 06:40:43 +00:00
thorpej
95b0f526ca Oops, thinko 1998-01-09 06:17:51 +00:00
thorpej
9a4eec1ed1 Regen. 1998-01-09 06:14:57 +00:00
thorpej
1a49aac581 Regen. 1998-01-09 06:09:17 +00:00
thorpej
f35d097c86 Put RCS IDs in generated files, in the right place. 1998-01-09 06:07:26 +00:00
mrg
a20d56e92e add new version of non contiguous memory code, written by chuck cranor,
called "MACHINE_NEW_NONCONGIG".  this is required for UVM, the new VM
system (also written by chuck) that is coming soon.  adds new functions:
	vm_page_physload() -- tell the VM system about an area of memory.
	vm_physseg_find() -- returns index in vm_physmem array that this
		address is in.
and several new versions of old functions/macros defined in vm_page.h.

this is the MI portion.  sparc, and then later i386 portions to come.
all other ports need to change to this ASAP!  (alpha is already being
worked on)
1998-01-08 11:36:16 +00:00
thorpej
655a55141c Regen: Back out RCS ID related changes. 1998-01-08 01:07:24 +00:00
thorpej
5713d318b8 Back out RCS ID related changes. 1998-01-08 01:06:50 +00:00
thorpej
585f0dec73 Regen: back out RCD ID related changes. 1998-01-08 00:17:11 +00:00
thorpej
d76d905b2f Back out RCS ID related changes. 1998-01-08 00:16:25 +00:00
thorpej
cbf3cc6bb8 Make insertion and removal of sockets from the partial and incoming
connections queues O(C) rather than O(N).
1998-01-07 23:47:08 +00:00
thorpej
cc22126721 Implement passing credentials as ancillary data on Unix domain sockets,
enabled with the LOCAL_CREDS socket option on the listener.  Semantics are
similar to BSD/OS's:
- Creds are available with first data on SOCK_STREAM, and with every datagram
  on SOCK_DGRAM.
- It is not possible to forge credentials.

Different in that:
- Different credential data structure (ours does not rely on the format
  of internal kernel data structures, and does not pass the login name).
- We can pass creds and file descriptors at the same time (this does not
  work in BSD/OS).

Luke Mewburn <lukem@netbsd.org> gets credit for inspiring me to implement
this.  :-)
1998-01-07 22:57:09 +00:00
thorpej
cf89ccf13e Add uipc_ctloutput(). 1998-01-07 22:50:42 +00:00
thorpej
b981fc4d34 Fix bug in recvit() that would cause recvmsg() to only receive one
control message, even if there were multiple control messages on
the queue.  From Jean-Luc Richier <Jean-Luc.Richier@imag.fr>, in
bug report kern/4700.
1998-01-07 05:49:25 +00:00
thorpej
e918c058f1 Fix passing of multiple file descriptors (was broken when code was made
64-bit safe).
1998-01-07 04:03:38 +00:00
thorpej
974b59d07c Happy new year! 1998-01-07 00:41:43 +00:00
thorpej
052b639ac1 Clean up the forking of init and the pagedaemon slightly: call fork1()
directly (which provides a pointer to the new process).
1998-01-06 21:18:00 +00:00
thorpej
07216d15fc Allow retval to be NULL, filling it in only if it was passed. 1998-01-06 21:15:41 +00:00
thorpej
c2768af3d4 Garbage-collect cpu_set_init_frame(); it hasn't been needed for some time
now.
1998-01-06 08:06:45 +00:00
perry
3a47434df3 regened with RCSIDs in place 1998-01-05 19:14:39 +00:00
perry
02e9346e57 fix RCS ids insertion so it really works 1998-01-05 19:13:04 +00:00
perry
9b0894473d make script insert RCS ids into generated files 1998-01-05 18:45:02 +00:00
perry
8309b37a61 ugh. escape rcs tags so that the script doesn't get messed up. 1998-01-05 18:19:35 +00:00
perry
4dc846816b put RCS ids in the output files. Not essential, but useful. 1998-01-05 18:09:44 +00:00
perry
a69b5af889 regened with RCSID 1998-01-05 18:06:27 +00:00
thorpej
2e85747e9e From 4.4BSD-Lite2 (noted by Frank van der Linden):
so_linger is used as an argument to tsleep(), so was stuffed with
clockticks for the TCP linger time.  However, so_linger is set directly from
l_linger if the linger time is specified, and l_linger is seconds (although
this is not currently documented anywhere).  Fix this to set the TCP
linger time in seconds, and multiply so_linger by hz when tsleep() is
called to actually perform the linger.
1998-01-05 09:12:29 +00:00
thorpej
ce340c6ca5 Also pass fork1() a struct proc **, in case the caller wants a pointer
to the newly created process.
1998-01-05 05:16:26 +00:00
thorpej
5703397593 Initialize proc0's file descriptor table with fdinit1(). 1998-01-05 04:52:48 +00:00
thorpej
6382d6dd79 Implement file descriptor table sharing. Partially from FreeBSD. 1998-01-05 04:51:15 +00:00
thorpej
740f872797 New vfork(2) implementation, whith semantics matching those of the original
3BSD vfork(2), i.e. share address space w/ parent and block parent.

Keep statistics on the total number of forks, the number of forks that
block the parent, and the number of forks that share the address space
with the parent.
1998-01-04 03:52:02 +00:00
thorpej
43677af399 Regen: add __vfork14() at #282. 1998-01-04 03:47:05 +00:00
thorpej
d36ffe9822 Add __vfork14() system call at #282. 1998-01-04 03:45:21 +00:00
thorpej
36780f9243 Make shmexit() and shmfork() take struct vmspace *'s, not struct proc *'s,
and update internal interfaces appropriately.
1998-01-03 02:50:32 +00:00
thorpej
b1cf620cfe Update for additional argument to vm_fork() ("shared" boolean). 1998-01-03 02:49:30 +00:00
thorpej
bb2d5987ff Don't call shmexit() if the vmspace ref count is not 1. Update for new
argument to shmexit().
1998-01-03 02:48:43 +00:00
enami
74a36a05ae No longer needs to include sys/shm.h. 1998-01-01 02:43:18 +00:00
thorpej
a322314f51 Split out the code that prepares a VM space for exec into a new
vmspace_exec() function.
1997-12-31 07:47:41 +00:00
thorpej
d3eaf8a978 Rearrange disk_detach() slightly, and make a small run-time cosmetic
change in disk_unbusy().
1997-12-30 09:51:24 +00:00
kleink
087ac96d12 Update to last commit: do not pass the accounting flag to suser(), since the call does not actually *use* super-user privileges. Pointed out by Charles. 1997-12-21 18:50:57 +00:00
kleink
aa4d1febf1 Due to the feedback received, change chown(), fchown() and lchown() not to
clear the setgid and setuid bits if called by the superuser.  Addresses
PR kern/4662.
1997-12-21 17:49:18 +00:00
pk
327c0046f9 Memory pool resource utility. 1997-12-15 11:14:57 +00:00
drochner
a9006ce5b9 Make ttyblock() work as intended and documented in canonical mode.
(operator precedence problem)
closes PR kern/2131 (Matthias Pfaller)
1997-12-12 12:49:40 +00:00
tv
0a558b3f1f Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.
1997-12-04 15:33:17 +00:00
kleink
5f6a03cb5b Regen. 1997-11-29 18:43:25 +00:00
kleink
5d7a8f4a16 Modify the recent sigaltstack() interface change to use the __RENAME() scheme;
add __sigaltstack14().
1997-11-29 18:38:20 +00:00
kleink
08ca830d3b Regen again to reflect correct syscalls.master version. 1997-11-25 21:10:48 +00:00
kleink
ef0caa8755 Regen. 1997-11-25 19:40:52 +00:00
kleink
a255f23ee3 In XPG4.2, the ss_size member of type stack_t (struct sigaltstack) is specified
to be of type size_t; since this imposes an interface change on the Alpha
(sizeof(int) != sizeof(size_t)), allocate a new system call number and make
the previous version a compatibility system call.
1997-11-25 19:32:15 +00:00
kleink
96dd101e9b Add compat_13. 1997-11-25 19:02:50 +00:00
thorpej
e78682a0e2 In m_split(), restore m_pkthdr.len if an error occurs. From Koji Imada,
PR #3986.
1997-11-20 04:28:18 +00:00
ross
3877611a5c Put it back the way it was. 1997-11-17 00:59:56 +00:00
ross
42046e9698 A new kprintf was imported on 10/24, and it will cause a kernel panic
whenever the %: format is used on NetBSD/Alpha. Disable %: for __alpha__.
Note: the "correct" (but untested on other architectures) fix is to
change the wrong: kprintf(cp, oflags, tp, NULL, va_arg(ap, va_list));
    to the right: kprintf(cp, oflags, tp, NULL, ap);
1997-11-15 09:27:33 +00:00
mycroft
402ecc3fed Clean up code from last commit. 1997-11-10 08:26:09 +00:00
thorpej
e51d1d566c Regen - syscalls.master changed. 1997-11-04 21:26:18 +00:00
thorpej
97d2a58201 Fix slight argument bogosity with getgroups(), setgroups(), select(),
and swapctl().  For the former three, they use an 'int' in their user-land
prototype which was a 'u_int' in the kernel, which screwed up automatic
generation/checking of lint syscall stubs.  For the latter, the user-land
prototype uses a "const char *", but the syscall just used "char *".

From Chris Demetriou <cgd@pa.dec.com>.
1997-11-04 21:24:14 +00:00
gwr
d68fdf7187 Oops... That was meant for the head. 1997-11-04 20:45:22 +00:00
mjacob
91ea08e3cf relocate where scsi devices are 1997-11-02 22:44:42 +00:00
enami
4589c896eb Conditionalize the recognition of symbolic link permission by
per fs mount option `symperm'.
1997-10-30 22:47:06 +00:00
thorpej
3569d48361 defopt UCONSOLE 1997-10-28 01:53:50 +00:00
chuck
94fa91f862 import chris torek's vfprintf() from libc [renamed to kprintf and all
floating point stuff removed].

the new kprintf replaces the 3 different (and buggy) versions of
printf that were in the kernel before (kprintf, sprintf, and db_printf),
thus reducing duplicated code by 2/3's.   this fixes (or adds) several
printf formats.  examples:
 %#x   - previously only supported by db_printf [not printf/sprintf]
 %8.8s - printf would print "000chuck" for "chuck" before
 %5p   - printf would print "0x    1" for value 1 before

XXX: new kprintf still supports several non-standard '%' formats that
are supposed to eventually be removed:
  %: - passes an additional format string and argument list recursively
  %b - used to decode error registers
  %r - int, but print in radix "db_radix" [DDB only]
  %z - 'signed hex' [DDB only]
  %n - unsigned int, but print in radix "db_radix" [DDB only]

note that DDB's "%n" conflicts with standard "%n" which takes the
number of characters written so far and stores it into the integer
indicated by the "int *" pointer arg.  yuck!

while here, add comments for each function explaining what it is
supposed to do.
1997-10-24 18:14:25 +00:00
sommerfe
436b905aba Fix PR4313: kern.maxvnodes setting was a psychotic placebo 1997-10-21 18:51:06 +00:00
thorpej
fa87c324dc Regen, syscalls.master changed. 1997-10-20 22:06:52 +00:00
thorpej
14cd99880c Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
1997-10-20 22:05:06 +00:00
is
c7a9bfc5b5 Allow more than 4 (up to 16 now) virtual filesystems to be loaded.
Patch from Matthias Scheler, pr4299.
1997-10-20 17:40:07 +00:00
mycroft
b8267c1737 Count characters even when !OPOST and FLUSHO.
Don't output the \r for ONLCR if FLUSHO.
1997-10-19 20:35:21 +00:00
mycroft
9341cad610 After conversion of the file flags, if neither FREAD nor FWRITE is set,
return EINVAL.
1997-10-19 17:18:10 +00:00
mycroft
11c9f28f0e Update comment. 1997-10-19 03:29:20 +00:00
mycroft
e704745a3c Regen. 1997-10-19 03:26:22 +00:00
mycroft
606346112c umask(2) accepts and returns a mode_t. 1997-10-19 03:25:55 +00:00
mycroft
04daee4f9c Add const where appropriate. 1997-10-19 02:00:19 +00:00
mycroft
16519602c5 Minor change; remove unnecessary casts. 1997-10-19 01:50:33 +00:00
christos
0f4b4471a8 Regen. 1997-10-18 16:36:49 +00:00