Commit Graph

1323 Commits

Author SHA1 Message Date
kleink 2da2c50987 KNF glitch in last commit, pointed out by Chris G. Demetriou. 1997-04-02 03:23:01 +00:00
kleink 6b58679ffa Implement OCRNL "\r" -> "\n" tty output translation.
Fixes PR standards/3434.
1997-04-02 03:10:51 +00:00
christos ee29ff37a9 PR/3396: Klaus Klein: If CREAD is not set drop incoming data. 1997-03-29 23:26:27 +00:00
thorpej 2a4b742e6a Update and enhancement to the mbuf code, to support use of non-cluster
external storage.  Highlights:

	- additional "void *" argument to (*ext_free)(), an opaque
	  cookie for use by the free function.
	- MCLALLOC() and MCLFREE() calls are gone.  They are replaced
	  by MEXTADD() (add external storage to mbuf), MEXTMALLOC()
	  (malloc() external storage and attach to mbuf), and
	  MEXTREMOVE() (remove external storage from mbuf).
	- completely new external storage reference counting
	  mechanism; mclrefcnt[] is gone.

These changes will eventually be used to pass driver DMA buffers up
the network stack, and reduce/eliminate copies in certain code paths
(e.g. NFS writes).

From Matt Thomas <matt@3am-software.com> and myself <thorpej@nas.nasa.gov>,
with some input from Chris Demetriou <cgd@cs.cmu.edu> and review by
Charles Hannum <mycroft@mit.edu>.
1997-03-27 20:33:07 +00:00
mikel 4ab6dc7d2e allow examination of SIGKILL and SIGSTOP signal handlers (but still
disallow changes); from Klaus Klein in PR standards/3398.
1997-03-27 07:52:25 +00:00
mikel 19fd4b60de make setpgid(pid, pgrp) return EINVAL if pgrp < 0 as required by POSIX.1;
from Klaus Klein in PR standards/3395.
1997-03-27 06:14:03 +00:00
gwr 37b247edde Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/ 1997-03-26 22:42:13 +00:00
gwr 71e43d14ab Move findroot/setroot stuff from configure() to cpu_rootconf(). 1997-03-26 22:38:40 +00:00
mycroft 13ca4f0381 Do not return generation counts to the user. 1997-03-24 21:44:53 +00:00
mikel e19a744a21 kern.osrevision now returns value of NetBSD symbol (from <sys/param.h>),
not BSD symbol.  fixes PR kern/2016.
1997-03-21 06:50:48 +00:00
mycroft ef083dd857 fill_eproc(): Fill in e_login. From PR 3351, by Geoff Wing. 1997-03-19 04:55:07 +00:00
is 07b064e02e New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:09:08 +00:00
mycroft e01c3bbe05 Return EISDIR for directories, not EACCES. 1997-03-14 06:12:11 +00:00
gwr 84e2004691 Look for $AWK in environment 1997-03-13 22:47:20 +00:00
fvdl 9599f78147 Add missing part of MNT_NOATIME commit: add it to the flags that can
be set by the mount system call.
1997-03-13 20:20:39 +00:00
hpeyerl f385ef3e0f Probe linux emul before svr4 emul. From Christos. 1997-03-13 02:55:25 +00:00
mycroft 85b2440284 Use splclock() to block time updates, not splhigh(). 1997-02-28 04:45:35 +00:00
thorpej 61deb88642 Remove prepending "#" and "$" characters from constants so this can
be used for m68k and i386 targets.
1997-02-26 23:44:24 +00:00
leo 3052dff85d Only make the memory-disk device the default root device when
MEMORY_DISK_IS_ROOT is defined.
1997-02-24 12:20:47 +00:00
mrg 3a0a1d42da in pollscan, cast incoming fd to unsigned int. from mycroft. 1997-02-23 02:23:07 +00:00
fvdl 501f1a3eb9 Do previous change properly (pasto; should have been inside the loop). 1997-02-23 00:07:18 +00:00
fvdl 0538233e2c Implement changes to make fix for NQNFS and MFS unmounting (race conditions)
work. Not quite as good as with the Lite2 merges, but it'll do until then.

* dounmount() expects to be called with the mountpoint marked busy
* all callers of dounmount() thus make the call themselves
* if a filesystem was being unmounted, and we're woken up in vfs_busy(),
  don't reference the mountpoint struct pointer, as it has very probably
  been freed.
1997-02-22 03:22:32 +00:00
mikel b0e7d3c13b sync filesystems in reverse order. suggested originally by Jim Rees
<rees@citi.umich.edu>, with some updating by Greg Hudson <ghudson@mit.edu>.
1997-02-20 04:52:44 +00:00
gwr 3c10fb1e47 Put back in the code to deal with advancing the PC on first entry,
and a long comment explaining why (needed on the pc532).
Remove PUTESC(c) macro which is no longer used.
1997-02-18 16:45:10 +00:00
mrg d1b433e462 check that fd being poll()ed is valid. from mycroft. 1997-02-18 04:20:54 +00:00
mrg 6fd38fc5f9 pass P_SUGID to child. from freebsd. 1997-02-18 01:30:37 +00:00
tls 4b1213d27c sync needs to clean VM objects backed by vnode pagers 1997-02-13 02:54:06 +00:00
ragge b2d40fd746 Fix bug that caused crash when root device was specified as 'ra0*'. 1997-02-12 19:27:08 +00:00
gwr 06e961d04e Reincarnation of the old hp300/kgdb_stub.c, worked over by
Matthias Pfaller and Gordon Ross
1997-02-12 00:51:47 +00:00
fvdl c745cba077 If the target for a rename() call exists, it will be removed. So, don't
leave any pages around (i,e, insert a vnode_pager_uncache()).
1997-02-10 12:41:19 +00:00
mikel e707982f35 check options argument to wait{3,4,pid}(); from Klaus Klein in PR 3182. 1997-02-07 05:33:07 +00:00
pk 5851e327c5 Inline functions and place variable assigment after the program.
This enables other versions of AWK (eg. `nawk') to grok the script.
1997-02-06 22:16:12 +00:00
gwr d372229de2 This little awk program translates the initialized data table found
in the assembly file genassym.s into the usual assym.h file.  The
assym.h file generated this way is identical to the output generated
if I simply compile and run the genassym.s file.  "Heh, Kewl!"
Thanks to Matthias Pfaller for the "translate the .s file" idea!
1997-02-03 21:31:17 +00:00
thorpej 7b30910b48 KMEMSTATS is a header option; pull in "opt_kmemstats.h". 1997-02-02 21:22:16 +00:00
thorpej 6dc3c24a7c Add missing \n in printf format for "cannot mount root" error message.
Pointed out by cgd@netbsd.org
1997-02-02 02:55:06 +00:00
cgd 3d3f4afbea use cnpollc() appropriately in getstr() 1997-02-01 02:28:48 +00:00
cgd 1a0b411d75 list 'a'+MAXPARTITONS-1, rather than just 'a'+MAXPARTITIONS, as last partition 1997-02-01 00:39:14 +00:00
pk 1cdfe6e18c Simplify a bit by using `next' statements, eliminating the `matched' variable.
Also, ignore lines with just whitespace, instead of reporting a syntax error.
1997-01-31 21:56:28 +00:00
pk d4e0e6e7a3 - remove two debugging (apparently) lines.
- generate a `return(0)' at the end of the generated `int main()'.
- append a newline when printing the rest of a `^quote[ ]+' line.
1997-01-31 21:38:16 +00:00
thorpej 2ca27c5550 Garbage-collect "argdev". 1997-01-31 19:10:27 +00:00
cgd 6384f7c322 fix check_console() changes:
* prototype it before it is used (several ports compile with
  -Wstrict-prototypes -Wmissing-prototypes), so this is _necessary_.
* conform to C syntax (yes, that's right, it wouldn't parse).
* make error check less error-prone, + style fixups.
1997-01-31 05:25:24 +00:00
thorpej 68de7ca719 - Implement vfs_mountroot(). This function is called my main() to
mount the root file system.  If the operator specified the root
  file system type in the kernel configuration file, attempt to
  mount that file system type on the root device.  If the root
  file system type was wildcarded (or unspecified), try all of
  the file systems statically built into the kernel until one
  succeeds.  If no file systems succeed, return an error.  The
  system will recover from this condition.
- Implement vfs_getopsbyname().  This function returns the file
  system ops vector given a file system name.
1997-01-31 02:50:36 +00:00
thorpej e101942fa0 NFSCLIENT -> NFS 1997-01-31 02:36:24 +00:00
thorpej 1005d16030 Syscalls.master changed, regen. (NFSCLIENT -> NFS) 1997-01-31 02:35:52 +00:00
thorpej 55ee7ceeb8 NFSCLIENT -> NFS 1997-01-31 02:34:23 +00:00
thorpej ec15ba06cb Add a sysctl node "kern.root_device", which contains the external
name of the device that root was mounted on (e.g. "sd0").
1997-01-31 02:33:59 +00:00
thorpej 0408b501ce - Implement a new machine-independent setroot() function, mostly derived
from the version used by NetBSD/alpha, with several changes by me.
  Support for asking for root device and root file system type on any
  kernel, obsoleting "options GENERIC".
- Make my mountroothook implementation used by the sparc and x68k
  ports machine-independent, and use it here.  Mountroothooks allow
  devices to execute special functions before being mounted as the
  root device (such as ejecting the floppy and prompting for a new
  floppy disk).
- Make swapconf() machine-independent.  It was identical on all ports.
1997-01-31 02:31:33 +00:00
thorpej 883ccf99b6 - NFSCLIENT -> NFS
- Run mountroot hooks before we attempt to mount the root device, and
  destroy mountroot hooks after the root file system has been sucessfully
  mounted.
- Don't panic if we can't mount root.  Instead, set RB_ASKNAME and
  call setroot(), which will prompt the operator for the root device
  and file system type.
1997-01-31 02:25:47 +00:00
mouse b5657b655d Oops, forgot the #include. 1997-01-31 00:50:38 +00:00
mouse f2e82f1145 Apply the interim fix from PR 2236, reformatted and a comment added.
Not a real fix, but it should help until we get a real fix done.
1997-01-31 00:47:12 +00:00
tls af543e23ae remove ability to mangle namei cache 1997-01-30 10:29:24 +00:00
matthias 1370131ffd Add scripts and documentation for a new method to create assym.h files.
With the kern/genassym.sh script HOSTED_CC is no longer used to create
assym.h files. This should make crosscompilation easier.
1997-01-30 09:37:20 +00:00
tls e9a5b29d40 add #ifdef KMEMSTATS around variable otherwise unused; now compiles with KMEMSTATS turned off. 1997-01-30 06:50:46 +00:00
mikel d59edbdc1c regen 1997-01-22 06:54:31 +00:00
mikel bd71be635d add multiple inclusion protection to generated header 1997-01-22 06:51:59 +00:00
cgd 008f5aedf9 apply patch from PR 2788 (from Dennis Ferguson <dennis@jnx.com>) to
more smoothly apply "tickfix"es microsecond deltas (when compensating
for clocks running at > 1000Hz).
1997-01-15 04:59:39 +00:00
cgd 99fb250b5c fix from PR 2787 (from Dennis Ferguson <dennis@jnx.com>): when adjtime
is running (and NTP is not enabled), the adjtime()-handling code clobbers
any tickfix that may be necessary for systems with clocks with frequency
greater than 1000Hz.
1997-01-15 04:27:35 +00:00
perry b89a3425b7 Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
1997-01-15 01:28:28 +00:00
thorpej f1c90f5e13 Implement sbcreatecontrol(), a generic function to create a "control"
mbuf for presentation on a socket buffer.
1997-01-11 05:16:46 +00:00
thorpej 62dcdcfb89 Implement SO_TIMESTAMP socket option: receive a timeval timestamp
as a control message with a datagram.
1997-01-11 05:15:01 +00:00
thorpej 1dc6efd7e6 Only call Debugger() on panic if "db_onpanic" is set. 1997-01-09 05:38:22 +00:00
thorpej 8404eae1ea Grok CTL_DDB. 1997-01-09 05:37:41 +00:00
mrg 7de1b7c8eb only set P_SUGID once. 1997-01-07 10:41:02 +00:00
cgd e7af2a8237 * catch up with system call argument type fixups/const poisoning.
* Fix arguments to various copyin()/copyout() invocations, to avoid
  gratuitous casts.
* Some KNF formatting fixes
1996-12-22 10:21:06 +00:00
cgd c60b7587ab * catch up with system call argument type fixups/const poisoning.
* Fix arguments to various copyin()/copyout() invocations, to avoid
  gratuitous casts.
* Some KNF formatting fixes
* Change sockargs()'s second argument to be a const void *, to help
  with dealing with the syscall argument type fixups/const poisoning.
1996-12-22 10:16:54 +00:00
cgd 7e31391b10 update for new syscalls.master 1996-12-22 08:05:47 +00:00
cgd acad90d846 * (slight) general cleanup
* change in-kernel syscall prototypes to match user-land prototypes in
  the following ways:
    + add 'const' where appropriate.
    + make the following "safe" type changes where appropriate:
	caddr_t -> struct msghdr *
	caddr_t -> struct sockaddr *
	caddr_t -> void *
	char * -> void *
	int -> uid_t (safe because uid_t not used as index/count)
	int -> gid_t (safe because gid_t not used as index/count)
	u_int -> size_t
    + change "int" to "u_long" in flags arguments to chflags() and
      fchflags().  This is safe because the arguments are used as
      flag bits and there's nothing that would cause the top bit
      of the int to be set yet, and because the user-land definitions
      already specified u_long, so a u_long's worth of argument was
      already being passed in.
1996-12-22 08:04:06 +00:00
cgd 997ec138ad change ntp_gettime's struct ntptimeval *'s name to match kern_ntptime.c 1996-12-22 07:47:43 +00:00
cgd c99936a735 * fix return types. previously, most things returned 'int.' which was
wrong for a bunch of functions:
	void:		sys_exit, sys_sync
	ssize_t:	sys_read, sys_write, sys_recvmsg, sys_sendmsg,
			sys_recvfrom, sys_readv, sys_writev, sys_sendto
	long:		sys_pathconf, sys_fpathconf
	void *:		sys_shmat

* Note that sys_open, sys_ioctl, and sys_fcntl are defined such that their
  last argument is optional.

These changes should not have any real effect, because right now this
information is not actually used for anything.
1996-12-22 07:00:57 +00:00
cgd 8fac03afc3 regen for syscalls.master and makesyscalls.sh changes 1996-12-22 06:48:18 +00:00
cgd 747448fc3e mark syscall() and __syscall() as INDIR syscalls 1996-12-22 06:46:50 +00:00
cgd 0e9ddb9039 * Don't actually output args structure definitions for INDIR syscalls (typo).
* Don't output prototypes for INDIR syscalls (since they always show up as
  sys_nosys() in the syscall table).
* Add "indir" to the comment for INDIR syscalls in the syscalls table, so
  it's more obvious why they call sys_nosys().
1996-12-22 06:45:14 +00:00
cgd ba32ea9a68 update copyright date 1996-12-22 06:33:46 +00:00
cgd 286395d1b3 * remember (i.e. don't throw away) system call return types.
* Deal with multi-word system call return types (i.e. foo *, or
  struct foo *, or struct foo, etc.).
* Add a new class of system calls "INDIR" (for "indirect"), which
  is to be used to represent indirect syscalls like syscall() and
  __syscall() which are implemented in MD code and which don't want
  args structures defined.  (The old way of declaring this type of
  syscalls still works.)
* Allow system calls to be marked as having a variable number of
  arguments, by inserting "..." (no trailing comma) before the
  first hf the optional arguments in the syscall definition.  Because
  of the way syscall arguments are handled by MI code, _ALL_ syscall
  arguments must actually be included in the definition, i.e.
  "optional" arguments are either "are there or aren't," i.e. these
  aren't really varargs functions.  Therefore, for normal syscalls,
  there _must_ be arguments listed after the "...".  For INDIR
  syscalls, which really do have a variable number of arguments and
  which aren't handled via the normal mechanism, that requirement is
  not in force.
* output primitive (machine-parsable) syscall descriptions as comments
  in <sys/syscall.h>.  These can be used to easily build real function
  prototypes, or to build stub functions for use by lint.
1996-12-22 06:33:16 +00:00
cgd e9a07759c9 ntp_gettime()'s argument is a struct ntptimeval *, not a struct timex * 1996-12-22 06:23:38 +00:00
gwr 6dba055937 Move `static' to the beginning of the storage class specifiers. 1996-12-18 20:24:50 +00:00
gwr e2c836939b As discussed, replace KERNBASE with kernel_text. 1996-12-18 20:12:58 +00:00
cgd 60faf5d2ae always provide at least a minimal aux vector. (The minimal version
is one entry long, with the entry's id being AUX_null.)
1996-12-17 22:04:20 +00:00
thorpej 2ac210b6e3 Call device_register() if __alpha__ || hp300 1996-12-17 08:59:15 +00:00
thorpej 8606b2f1d3 In sbreserve(), don't allow a count of 0. Fixes PR #2794, from
Erik Berls <cyber@dis.org>.
1996-12-09 23:50:57 +00:00
thorpej ff392f324b Back out this piece of revision 1.3:
>- Optional systems calls are "UNIMPL" if the support is not being
>  compiled into the kernel.

It had implications that didn't occurr to me at the time.  *sigh*
1996-12-06 20:10:51 +00:00
thorpej 5c4caca2d5 syscalls.master changed; regen. 1996-12-06 20:06:35 +00:00
thorpej 49989d779a Back out this piece of revision 1.38:
>- Optional systems calls are "UNIMPL" if the support is not being
>  compiled into the kernel.

It had implications that didn't occur to me at the time.  *sigh*
1996-12-06 20:05:31 +00:00
cgd 66764a1a2f Check for a new definition, __BROKEN_INDIRECT_CONFIG, and if it is _not_
defined:
	define match functions to take a struct cfdata * as their second
	argument, config_search() to take a struct cfdata * as its second
	argument, and config_{root,}search() to return struct cfdata *.

	remove 'cd_indirect' cfdriver element.

	remove config_scan().

	remove config_make_softc() as a seperate function, reintegrating
	its functionality into config_attach().

Ports will define __BROKEN_INDIRECT_CONFIG until their drivers prototypes
are updated to work with the new definitions, and until it is sure that
their indirect-config drivers do not assume that they have a softc
in their match routine.
1996-12-05 00:09:10 +00:00
thorpej 6aaaad08d2 syscalls.master changed; regen. 1996-12-03 00:30:59 +00:00
thorpej f85bef61f1 Include sys_getfh() if NFSSERVER || NFSCLIENT. 1996-12-03 00:28:31 +00:00
thorpej f02e8b3cf0 Make NFSSERVER work without NFSCLIENT. This is achieved by splitting
the client and server/shared data initialization into separate functions,
and calling the server/shared initialization directly from main().
Problem noted in PR #1308 (Kenneth Stailey) and PR #1780 (Chris Demetriou).
Fix suggested in PR #1780 by Chris Demetriou, and munged a bit by me,
and OK'd by Frank van der Linden <fvdl@netbsd.org>.
1996-12-03 00:22:43 +00:00
thorpej f8ae3272b9 Back out previous soqinsque() and soqremque() changes. This will
stop the panics until the socket queues get converted to <sys/queue.h>.
1996-11-26 23:24:04 +00:00
cgd 3340f02c2b fix two problems with shutdown hook code:
(1) after removing a shutdown hook (in shutdownhook_disestablish()),
    free it.  We created it, we have to free it.  Without this,
    shutdownhook_disestablish() leaks memory.
(2) in doshutdownhooks(), before running each hook, remove it from the
    shutdown hook list.  This makes sure that every hook is tried once
    (because doshutdownhooks() is called from before rebooting, and
    a fault in a shutdown hook will cause doshutdownhooks() to be called
    again), but prevents the hooks from potentially being run infinitely
    (as used to be possible, in the above-mentioned situation).
1996-11-24 00:42:31 +00:00
fvdl ee489171ee Make previous change in interpreter entry point calculation dependant on
a 'mips' define. XXX

Just a temporary patch to get things going again for Linux ELF binaries,
needs to be solved properly.
1996-11-23 11:46:34 +00:00
cgd e77b6879f7 Feature:
If not compiled with -D_KERNEL, include different includes and
do so macro magic so that this will fit sanely into test harnesses.
When used in user-land, this should be compiled with -D_EXTENT_TESTING.

Bug fixes:
(extent_insert_and_optimize) You can't do things like:
	LIST_REMOVE(elem->...le_next, ...);
	free(elem->...le_next, ...);
They just don't work (and will corrupt your list and/or malloc free list).

(extent_alloc_region_descriptor) Unless you wait, malloc can fail.
Don't accidentally deref a potentially-NULL pointer.
1996-11-21 18:46:34 +00:00
cgd 9ed8ce3b8f clean up a few spaces vs. tabs and KNF bogons. Make this compile
cleanly with -Wall -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual.
1996-11-15 23:53:32 +00:00
cgd 30ca7eaa8d clean up a few spaces vs. tabs bogons 1996-11-15 23:51:23 +00:00
jtc d22cdecb45 Add clock_gettime, clock_settime, and clock_getres 1996-11-15 22:44:25 +00:00
thorpej 621d9e4932 Regen. 1996-11-14 04:52:30 +00:00
thorpej 9d9479eb2f Make ntp_gettime() and ntp_adjtime() like other system calls:
- The functions that implement them and the argument names are
  prepended with "sys_".
- Optional systems calls are "UNIMPL" if the support is not being
  compiled into the kernel.
1996-11-14 04:51:09 +00:00
thorpej 82b23eb20c Only call sysctl_ntptime() if NTP is compiled into the kernel. 1996-11-14 04:47:45 +00:00
thorpej 156e926117 Implement bitmask_snprintf(), which takes a value and a string
representing the names of those bits, prints them into a buffer
provided by the caller, and returns a pointer to that buffer.
Functionality is identical to that of the (non-standard) `%b' printf()
format, which will be deprecated.

Rename the non-exported function ksprintn() to ksnprintn(), and change
it to use a buffer provided by the caller, rather than at static
buffer.
1996-11-13 06:06:05 +00:00
jonathan bbcd2bb1ef Elf32 fixes for mips shared libraries:
* handle interpreters with nonzero virtual address of entry-point:
   subtract p_vaddr from computed entrypoint, as the mips elf exec did.

 * Add #ifdef ELF_INTERP_NON_RELOCATABLE/#endif around the code
   that tries to choose a `good' address at which to load an interpreter,
   if none was set by the emul probe  function.
   (the address chosen could be improved to avoid  fragmenting the
    process virtual address space).

 * define ELF_INTERP_NON_RELOCATABLE in machine/elf_machdep.h for mips CPUs,
   which currently use a GNU-derived ld.so.

ELF_INTERP_NON_RELOCATABLE is not necessary for native NetBSD/alpha ELF
binaries. It may be required for GNU-derived ELF dynamic loaders (Linux/i386?)
1996-11-11 20:33:10 +00:00
thorpej 26a25a87b2 Optimization of soqinsque() and soqremque():
Keep queue of pending sockets in a double linked list.  Previously,
a singly linked list was used, giving O(N) insertion/deletion times,
and was a major time consumer for sockets with large pending queues.
The double linked list give O(C) insertion/deletion times with only
a small cost in complexity.

Since a socket can be on, at most, one queue at a time, both so_q and
so_q0 can safely be used as (forward and backward, respectively) queue
pointers.

Submitted my Matt Thomas <matt@3am-software.com>, a long time ago.
(Geez, I've been running with this patch for _months_, and had completely
forgotten about it!)
1996-11-10 05:58:37 +00:00
cgd 8a3333b2a9 Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed.  Rename remrq() to
remrunqueue().
1996-11-06 20:19:19 +00:00
gwr f5927ca260 Minor nit in my change regarding const and non-ansi code... 1996-10-27 21:50:33 +00:00
gwr 2ada6af51b Oops, part of that last commit was not meant to go in.
The definitions of va_alist, va_dcl belong elsewhere.
1996-10-27 20:50:00 +00:00
gwr a0d9bd5bb2 The hack-ish tricks to make the ANSI-style va_start macro work in
non-ANSI mode were not quite complete.  This makes non-ANSI work.
Perhaps it would be better to eliminate this hack altogether...
1996-10-27 20:30:52 +00:00
cgd ce53653783 make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name.  (Only the pathname buffer, cn_pnbuf, should be
modified.)  Propagate the const poisoning to code that uses the namei
and componentname structs.
1996-10-25 23:13:58 +00:00
cgd 9fa0b6391e don't thow away char_type's 'const'ness via a cast when passing it to scanc().
(1) that causes -Wcast-qual to be unhappy, and (2) the cast is unnecessary!
1996-10-25 22:11:39 +00:00
cgd ca829ca73c don't assign non-const pointers from const pointers; make the appropriate
pointers 'const'.  (-Wcast-qual)
1996-10-25 22:01:44 +00:00
cgd ef6504281a remove duplicate prototypes from tty_subr.c (ndqb, putc, b_to_q), and
make the first arg of b_to_q (the u_char * that points to data to be
stuffed into the queue) const, since it's not modified.
1996-10-25 21:20:29 +00:00
cgd 574f71ab26 replace a construction in sys_setitimer() that was too tricky for its
(and my!) own good with a more straightforward one that is equally (and
more apparently) correct.
1996-10-24 04:35:33 +00:00
cgd 8595fc3073 make coredump() use more sensible error returns (even though they're
not used by anything, for now), and implement MNT_NOCOREDUMP by checking
whether or not MNT_NOCOREDUMP is set on the file system where the dump
would land (i.e. the file system of the process's current working
directory), and disallowing the core dump if it's set.
1996-10-23 23:13:19 +00:00
cgd 6d3337bdf6 permit MNT_NOCOREDUMP as a generic mount flag. 1996-10-23 23:07:08 +00:00
matthias a587cc60a0 * In dosetrlimit ensure that rlim_cur and rlim_max are >0. Otherwise
the kernel might crash due to invalid values passed to setrlimit.
1996-10-23 07:19:38 +00:00
jtc 4039b6bcba Return ESPIPE when filedes is associated with a FIFO. 1996-10-21 17:42:48 +00:00
mrg 8fd70c1fe1 in coredump(), check the SUGID bit rather than testing various parts
of the cred structures.  this prevents a previously set[gu]id process
from generating a core file.
1996-10-18 08:39:34 +00:00
perry 8a0600b163 removed #ifdef tahoe 1996-10-17 16:31:54 +00:00
thorpej 52c0d38a1a Several changes:
- Rename EX_NOBLOB to EX_NOCOALESCE; it's much more descriptive of
  what's going on.
- In extent_free_region_descriptor(), if we're a fixed extent,
  freeing a dynamically allocated region descriptor, and someone
  is waiting on the freelist, let the waiter have it, rather than
  free'ing it back to the system.
- Use ALIGN(), rather than our homegrown EXTENT_ALIGN(), when dealing
  with map overhead.  Privatize the EXTENT_ALIGN() macro; there's no need
  to export it.
- Implement EX_BOUNDZERO flag.  This changes the boundary line policy in
  extent_alloc() and extent_alloc_subregion(); boundary lines are
  computed relative to 0, rather then the start of the extent.
- Fix a nasty race between multiple participants doing region and
  descriptor allocation.
- Add a new flag to specify that it's ok to wait for space in the
  extent: EX_WAITSPACE.
- Blow away an unnecessary splhigh()/splx().
- Put a bunch of sanity code inside #ifdef DIAGNOSTIC/#endif.
1996-10-17 08:27:35 +00:00
ws 31bdb14ed5 Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB 1996-10-16 19:32:08 +00:00
cgd c8e4c454f2 curproc was being used directly for ru_{in,ou}block counting. Instead
of using it directly, use a local, and set that local to be curproc
if curproc is not NULL else a pointer to process 0's proc struct.
If syncing disks while handling a panic that occurred while 'curproc'
was NULL, the old code would dereference NULL and die.
1996-10-15 23:06:27 +00:00
cgd 279c087328 reorganize tsleep() so the (cold || panicstr) test is done before the
ktrace context switch checking.  If syncing disks while handling a panic
that occurred while 'curproc' was NULL, the old code would dereference
NULL and die.  The (slight) reorganization was done so that space (one extra
splhigh()), rather than time (one extra comparison), would be wasted.
1996-10-15 23:00:10 +00:00
cgd 709ebdf6ab panic must print a newline 1996-10-15 21:35:56 +00:00
cgd 0e4ddf059b deal more sanely with ELF binaries with only a single program header
section.  Patch come up with by Bob Baron <rvb+@cs.cmu.edu> and myself.
This entire bit of code (the code which sets daddr/dsize and taddr/tsize)
is very bogus, but it's not clear what the 'right' way to fix it is
and this patch fixes a problem preventing some ELF executables from
being run.
1996-10-13 22:54:52 +00:00
christos f443b89c92 backout previous kprintf change 1996-10-13 02:32:29 +00:00
christos ee3d88fbdf fix uiomove's first argument and remove unnecessary casts 1996-10-13 02:27:52 +00:00
cgd 4431ea58a9 replace ELF_ALIGN with ELF_TRUNC (round to lower alignment boundary) and
ELF_ROUND (round to higher alignment boundary), and use them properly.
Also, change a bit of code in elf_load_psection to use the next ELF_ROUND
macro.  This fixes a bug found by Robert Baron <rvb+@cs.cmu.edu> where
elf_load_psection, if given a properly aligned address at which to load
the section, would round actually load it at the next highest alignment
boundary.
1996-10-11 19:44:02 +00:00
christos 60d201973e printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:46:11 +00:00
christos 153ead2dff - Use debugging printf - macros instead if #ifdef #endif everywhere
- printf -> kprintf, sprintf -> ksprintf
1996-10-10 22:43:21 +00:00
thorpej 4a23efc7bc Fix botch in netbsd-1-2 merge (multiple inclusion of <sys/tty.h>),
pointed out by Jonathan Stone <jonathan@DSG.Standford.EDU>.
1996-10-10 00:27:41 +00:00
thorpej f2e79979ad Merge the netbsd-1-2 branch back into the mainline. 1996-10-09 00:59:15 +00:00
mycroft 02ee12e4ba Use PHOLD() and PRELE() rather than frobbing p_holdcnt directly. 1996-10-09 00:04:39 +00:00
cgd 1878cacd45 KNF, de-static the functions that were static (so they'll show up
in ddb, etc.)
1996-10-08 03:40:40 +00:00
cgd 6ab18a1959 don't include <machine/exec.h> explicitly. No other changes needed, since
<sys/exec.h> was already being included.
1996-10-07 21:43:02 +00:00
cgd cd3ab82ec2 clean up a comment added in the last commit 1996-10-07 18:29:24 +00:00
cgd 5d4cf83257 when loading interpreter: check its vnode type, check its mount point
for NOEXEC and NOSUID, and make sure the interpreter file is executable.
The mount point checks are done because, even though the interpreter
is not the program being 'executed', code from the interpreter is being
executed, and so the mount point's flags should be respected.
1996-10-07 18:24:48 +00:00
scottr d2be4a69c2 Expand tab in copyright message; it loses on some consoles. 1996-10-05 06:32:43 +00:00
ws 2da166f660 Fix p_nice vs. NZERO code.
Change NZERO to 20 to always make p_nice positive.
On Christos' suggestion make p_nice explicitly u_char.
1996-10-02 18:04:56 +00:00
cgd cc06b3f10f Remove the implicit inclusion of EXEC_ELF32 when COMPAT_LINUX and/or
COMPAT_SVR4 is included.
1996-10-02 05:30:29 +00:00
cgd ccd26363f6 allow a.out executable support to be optional (conditioned on EXEC_AOUT),
and shell script support to be optional (conditioned on EXEC_SCRIPT).
Remove the implicit inclusion of EXEC_ECOFF when COMPAT_OSF1 and/or
COMPAT_ULTRIX is included, and of EXEC_ELF32 when COMPAT_LINUX and/or
COMPAT_SVR4 is included.
1996-10-02 05:29:29 +00:00
cgd 60b9a20b61 initialize vnode_free_list and mountlist at compile time with the new
queue.h list/queue head initializer macros.  mountlist was converted so
that panics (or other reboots) early on in kernel startup don't cause
sys_sync() to croak.  vnode_free_list was converted because it was nearby.
1996-10-01 22:49:11 +00:00
cgd 3b34cba879 exec vnode locking protocol changes: in a nutshell, don't keep vnodes
locked for any longer than we have to.
1996-09-30 23:18:43 +00:00
cgd 6f5b5cefc7 make the check_header and load_file functions static 1996-09-30 23:02:14 +00:00
ws 0d59d2eb20 Enter new KGDB on panic just like other kernel debuggers 1996-09-30 17:32:01 +00:00
cgd fea9aa2096 clean up a comment (in code derived from the a.out code, where i cleaned
up the comment earlier).
1996-09-27 03:38:27 +00:00
cgd 2f42e5b8ed fix some typos and clean up some comments. 1996-09-26 23:34:46 +00:00
cgd 0e097578a2 add and use a machine-dependent header, which currently defines some
macros to use to remove #ifdefs from the machine ID case check.
Eventually, these headers will contain other information, e.g.
machine-dependent relocation information, etc.
1996-09-26 21:50:55 +00:00
cgd 79bd41b179 add support and reorganize for 64-bit ELF, included by EXEC_ELF64
option.  (Also, make EXEC_ELF32 option a way to explicitly include
32-bit ELF support.)
1996-09-26 20:51:03 +00:00
christos 3f15a06497 Recognize %.2x as %02x 1996-09-25 21:03:06 +00:00
cgd 80c82b8766 rename exec_elf.c to exec_elf32.c, since it execs 32-bit ELF. exec_elf32.c
was copied from exec_elf.c on the CVS server to keep the logs intact.
1996-09-20 22:33:23 +00:00
jtc 16fe807b60 renamed sys_getlogin to sys___getlogin. required by libc namespace conventions 1996-09-19 04:52:12 +00:00
thorpej 0d3a57ea3f Add COMPAT_M68K4K to the exec switch. 1996-09-10 22:05:03 +00:00
mycroft 7cbc74f45c Use INFTIM, not -1. 1996-09-07 21:47:23 +00:00
mycroft 1449e67e30 Modify poll(2) prototype. 1996-09-07 14:20:09 +00:00
mycroft 07d2eae876 Regen. 1996-09-07 14:18:04 +00:00
mycroft cdd2b02b50 Modify poll(2) prototype. 1996-09-07 14:16:42 +00:00
mycroft 264dd4757c Regen. 1996-09-07 12:56:49 +00:00
mycroft 2bc736661a Implement poll(2). 1996-09-07 12:40:22 +00:00
mycroft 59f71c45fc Clean up sys_select() slightly. 1996-09-05 15:32:52 +00:00
mycroft af113f915d Use SET(), CLR(), ISSET(). 1996-09-05 15:31:40 +00:00
mycroft b3eac79b64 tty stop functions really should return void, not int, and certainly not both. 1996-09-02 06:43:16 +00:00
christos da17295d91 Calling shmdt(2) before calling shmat(2) would crash the system because
p->p_vmspace->vm_shm would be NULL. Protected the rest of the cases where
that might happen too. This was the reason why sunxdoom would panic the
system in SVR4 emulation.
1996-09-01 22:53:06 +00:00
mycroft de1c962824 Don't core dump if ruid != euid or rgid != egid. 1996-09-01 01:56:10 +00:00
cgd f8ed933394 implement realloc(), just like the user-land version, except it takes
"type" and "flags" arguments a la kernel malloc().
1996-08-27 20:01:42 +00:00
cgd d7083cda8d update so that SYSCALL_DEBUG works again. s/nosys/sys_nosys/g.
(It must not have been used for a long time!)
1996-08-20 22:00:36 +00:00
explorer a9ef8aef84 This fixes a nasty little bug where traceroute (and other raw-ip sending
programs which attach their own header) can crash the machine.  The problem
in this case was:
	a variable "space" was set to the total data to copy,
	len was used to remember how much to copy in this chunk (mbuf),
	in one case, len = min(MCLBYTES - max_hdr, resid) but
		size -= MCLBYTES;
	 instead of
		size -= len;

Note that userland programs can still crash the machine by providing
bogus data in the ip->ip_len field I suspect.  I haven't verified this,
but will soon be doing so and applying a fix of some sort.  Probably
clamping the ip->ip_len value to the true packet size will be ok.
1996-08-14 05:53:18 +00:00
explorer 1177a1fc69 formatting fix only 1996-08-14 05:43:35 +00:00
explorer 13659c5c84 spelling error only 1996-08-14 05:43:19 +00:00
thorpej d719cb7901 Inside some DIAGNOSTIC code, cast some pointer arithmetic results
to long to quiet the compiler.
1996-08-13 23:25:10 +00:00
mrg cd658e4447 oops, need to copyinstr() here. how come it worked anyway? 1996-08-11 04:05:33 +00:00
mrg 72bad48e62 implement RB_STRING, derived from SunOS, via compat_sunos. 1996-08-10 00:23:14 +00:00
mrg 5abbf990f3 Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models.  It is currently silently ignored on all other
hardware now, however.  The MD function "boot()" has been changed to
also take a char *.
1996-08-09 10:30:23 +00:00
thorpej 3946240709 Fix unititialized variable warning. Pointed out by Aaron Brown. 1996-07-25 20:41:48 +00:00
abrown 062b2cdd6b Fix unused variable warning for an "int i" left over from the old disk
statistics code.
1996-07-24 16:13:04 +00:00
thorpej aba7675464 In extent_alloc_subregion(), don't adjust the initial boundary check
value if we're not concerned with boundary checking.  Avoids a stupid
infinite loop.
1996-07-23 23:09:10 +00:00
explorer 67b1de765f Add compile-time and run-time control over automatic niceing 1996-07-17 21:54:04 +00:00
thorpej 0462d3063c Remove old-style disk instrumentation code. 1996-07-12 22:00:42 +00:00
jtc f9a9b2e372 Used signed instead of unsigned longs for sec and usec variables to
handle cases which would otherwise yeild wildly wrong results.
1996-07-11 00:09:29 +00:00
cgd 1c5ea3c014 print difference between pointers with %ld, so that -Wformat works
on the Alpha and for consistency.  Also, other minor formatting cleanups.
1996-07-10 18:15:22 +00:00
chuck 9c9676883e add native mode atm protocol layer 1996-07-04 03:16:56 +00:00
pk 947ec65105 sunos_compat: return EIO when TIOCGPGRPing a half-open pty. This is
expected by SunOS pty-allocating programs (telnetd,rlogind,..).
1996-07-02 21:19:02 +00:00
mycroft 8ea2fc5788 Regen. 1996-06-23 11:08:01 +00:00
mycroft 351bdbd445 Implement setre[ug]id() compatibly with 4.3BSD, SunOS, and Linux. 1996-06-23 11:04:11 +00:00
thorpej 6041e29f1f My extent map manager. Sort of like resource maps, but more flexible.
Understands allocation aligment and boundary restrictions, "specific region"
allocations, and suballocations.  Capable of statically or dynamically
allocating map overhead.

Many thanks to Matthias Drochner for running the code for me, and sending
me bug fixes, optimizations, and suggestions.  Also, many thanks to
Chris Demetriou for his extremely helpful suggestions.

XXX No manual page yet.  One is forthcoming, as soon as I can scare up
the time to write one.  This has been sitting on my plate for quite a
while, and several projects are waiting for it.  Time to move on.
1996-06-23 00:10:08 +00:00
mycroft 506cefab8c In the sync case of bwrite(), move the accounting earlier so that so that the
delayed write is logically converted to a sync write, mirroring the async case.
In bdwrite(), move the tape case earlier to avoid needless reassignbuf()s.
1996-06-18 20:50:23 +00:00
pk b298c40fbe Call reassignbuf() at splbio in bdwrite(). 1996-06-17 22:21:31 +00:00
cgd d73abf41aa avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
1996-06-14 22:21:12 +00:00
christos e2e0f65050 Merge pagedvn changes from OpenBSD and added mips defines. Also added
ELF_MAP_PAGE_ZERO define. The entry point computation is different than
the one OpenBSD uses.
1996-06-14 18:15:55 +00:00
jtc 2074cccbb8 Cast `sec' to a u_quad_t in `sec * 1000000 + usec' so the expression
is computed with quad integer arithmetic (so it won't overflow after
4294 seconds).
1996-06-13 23:22:22 +00:00
pk 7b9f9e5426 Check user access rights only if `uio_segflg' says it's a user space buffer. 1996-06-13 22:30:18 +00:00
christos 306987eb37 - Pass the Elf exec header in the emulation dependent probe functions.
- remove static from elf_read_from().
1996-06-13 18:35:25 +00:00
cgd 1abc77f86d if kmem_malloc() fails while trying to allocate an mbuf cluster, try
and free some space by calling m_reclaim().  Also, log the "mb_map full"
error message (at most) every 60-seconds.  The old code would log it
once over the lifetime of the system, but that's not a useful diagnostic.
(More useful is the new behaviour, which roughly indicates how often
periods of heavy load occur, without spamming the console and system
logs with messages.)
1996-06-13 17:02:23 +00:00
cgd 06c209646e handle the case where kmem_malloc() returns NULL in the 'can wait' case.
Right now, this code just panic()s (same as kmem_malloc() used to do
before, but different message), but in the future it should be modified
to try to reclaim wasted memory.
1996-06-13 16:53:34 +00:00
cgd f41d0a3d9b in select(), if it's a small number of file descriptors use a
automatic array rather than an array allocated with alloca().
(This was the only use of alloca() in the kernel, and it wasn't
necessary or consistent with the way other functions in this file
work.)
1996-06-13 05:08:47 +00:00
cgd 1e2b610d5a #ifdef __alpha__, call a machine-dependent function with new device
structure and 'aux', right before ca_attach is called for the
newly-attached device.  This allows the alpha port to do root device
autodetection without modifying every bus and device driver which could
be in the 'boot path.'  In the long run, it may make sense to make
this machine-independent.
1996-06-13 04:50:29 +00:00
pk 50e7d72655 Protect vnode when updating for started IO on buffers. 1996-06-11 11:15:36 +00:00
briggs 0a55dbede5 Do not declare tickfixcnt ifdef NTP. 1996-06-09 04:51:03 +00:00
cgd 57b8bdb5c3 Fix a bug where free()ing an already-free block, or even a block that looked
like it might have already been freed, would cause a crash because of a bad
pointer dereference.  Pointed out by Brian Noble <bnoble@cs.cmu.edu>.
1996-06-06 19:13:32 +00:00
mrg 8def9fa734 don't tty_detach() in ttyfree(). make the user of ttyfree() do
the tty_detach() as not all ttymalloc()'ed ttys are tty_attach()ed.
1996-06-06 15:31:24 +00:00
mrg b9c4c21d8e add a comment on how to use tty_attach(). 1996-06-04 13:59:10 +00:00
mycroft abfbe7c6c4 Deal with FD_SETSIZE larger than the default. 1996-06-02 14:48:23 +00:00
jtk ef561b71a7 print out file systems being unmounted, #ifdef DEBUG. pr#1492 1996-06-01 20:24:05 +00:00
mrg a715717750 now that tty.h has queue.h, we do not need it here. 1996-05-31 00:03:05 +00:00