Commit Graph

1350 Commits

Author SHA1 Message Date
mycroft 16a8787248 Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way.  (See tech-kern.)
1997-09-11 23:01:44 +00:00
pk ae6bc354b9 Use the macro PC_ADVANCE(), if defined, to skip over a breakpoint. 1997-09-10 19:37:31 +00:00
gwr b1fe1c2452 Generalize somewhat (now works for alpha too). 1997-09-10 16:25:07 +00:00
veego b79dba1b36 syscalls.master changed; regen. 1997-09-09 08:07:00 +00:00
veego 33a2f6fd68 Ups. 1997-09-09 08:05:35 +00:00
veego b6cefe68ad Move sys_minherit from 250 to 273 and add a comment why 240-269 are
reserved.
1997-09-09 08:04:11 +00:00
chuck 5ef067d288 syscalls.master changed; regen. 1997-09-08 18:12:29 +00:00
chuck bca26d18f9 add sys_minherit (from openbsd) 1997-09-08 18:03:32 +00:00
thorpej fc8c3e00e0 Bring changes from marc-pcmcia branch down to the trunk. 1997-08-29 00:47:18 +00:00
mycroft f31ed493f7 Fix a mbuf leak in sosend() when we have a negative residual count. 1997-08-27 07:10:01 +00:00
kleink 66105c37fc Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.
1997-08-25 19:31:43 +00:00
mikel ed1e33aac5 replace gawk-specific C-style comments with generic AWK comments; from
Yasufumi ITOH in PR kern/4011
1997-08-20 06:58:10 +00:00
drochner c6567d9100 eliminate unused variable warnings
closes PR kern/3946 by Erik Bertelsen
1997-08-06 16:57:33 +00:00
leo d37dfbd5c2 Allow for more than one md-device. 1997-08-03 20:36:03 +00:00
mrg e44b1e6182 add a patchable `lkmdebug' variable and only print debug messages
when certain bits are set.
1997-07-21 05:43:36 +00:00
fvdl 4ad51c2811 Allow multiple export requests for a filesystem, host pair if the flags and
anon cred are the same. Should probably be handled better in the mountd,
but this will do for now. Fixes PR 469, submitted Sept 1994 by
a certain "Jason R. Thorpe".. ;-)
1997-07-20 23:31:32 +00:00
phil b1bfdee5fe In sys_flock, change EBADF to EINVAL because error was generated by
a bad argument, not a bad file descriptor. (Found in response to
PR 2602.)
1997-07-17 17:54:40 +00:00
pk 37d77087e8 Check `b_dev' field in bdwrite() before using it as an index into bdevsw[].
`b_dev' value of NODEV happens and is normal if the buffer is on its way
to the underlying device strategy function for the first time.

Also, MFS sillily uses a major device number (255) which cannot be used
to index bdevsw[]. Check marked with XXXs.
1997-07-08 22:03:30 +00:00
pk b7b1073fd0 In bread() and breadn(): if getblk() returns a DELWRI buffer, don't
call biowait() but return `success' immediately. We can return `success'
because buffers with recorded errors are not returned by getblk().
(Takes care of PR#3694).
1997-07-08 21:42:59 +00:00
christos 2b0c0d95ab Make this work for SETUIDSCRIPTS:
- include <sys/stat.h> for S_ISUID, S_ISGID
- fix bug where shortcut to fail would use uninitialized variables.
- elide other warnings.
1997-07-08 02:32:02 +00:00
cgd c96fac46ea update for new vnode_if.sh 1997-07-07 20:19:54 +00:00
cgd 6542ece8e1 mark prototypes for static inline functions in the generated files as
possibly unused (with __attribute__ ((unused))), to avoid generating
warnings when compiling without optimization but with most ports' default
warning flags.
1997-07-07 20:17:36 +00:00
fvdl 6eecd789e6 There appear to be spinlock bugs in the VM code. They are not a problem
now, as we're always one on CPU (they will be later, though). With DEBUG,
they cause a lot of output, so DEBUG -> LOCKDEBUG for now.
1997-07-06 22:51:59 +00:00
fvdl 8f8988628d Add NetBSD RCS Id, and a few minor changes to make it compile. 1997-07-06 12:35:33 +00:00
fvdl f93a04da47 Import Lite2 locking code 1997-07-06 12:19:53 +00:00
thorpej 8dd0293cd3 Use UCHAR_MAX rather than "255" when sanity-checking the length of a
sockaddr in sockargs().
1997-06-26 06:13:36 +00:00
thorpej 1351e629b3 Several small changes to eliminate kludginess in dealing with unix domain
socket names:
- In unp_setsockaddr() and unp_setpeeraddr(), if the socket name can't
  fit into a single mbuf, allocate enough external storage space to
  hold it.
- In unp_bind() and unp_connect(), perform a similar operation, but allocate
  one extra byte, and ensure that the pathname is nul-terminated.
Many thanks to enami tsugutomo <enami@cv.sony.co.jp> for the sanity
checking.
1997-06-26 06:06:40 +00:00
thorpej e1fb68eb29 In sockargs():
- Add a comment describing my feelings about this interface, in general.
- Remove the COMPAT_OLDSOCK length hack.  Instead, if the socket argument
  is too long to fit in an mbuf, allocate enough external storage to
  hold it.
- If the socket argument is a sockaddr, don't allow the length to be
  greater than 255, as that would overflow sa_len.
Many thanks to enami tsugutomo <enami@cv.sony.co.jp> for his sanity checking.
1997-06-26 06:01:59 +00:00
thorpej 01cbda9800 In sbappendaddr(), if the sockaddr length is larger than will fit in
an mbuf, allocate enough external storage to hold the sockaddr.  Thanks
to enami tsugutomo <enami@cv.sony.co.jp> for providing sanity-checks.
1997-06-26 05:56:38 +00:00
thorpej 6043eb7d80 Avoid running off the end of the format string if the caller botched
the format modifer.  Reported by and suggested fix from Daniel G. Pouzzner
in PR #2633.  Final fix is slightly different now that we support the %q
modifier.  This fix also includes the equivalent fix for sprintf().
1997-06-26 05:17:45 +00:00
thorpej e14025e742 If KGDB is defined, pull in <sys/kgdb.h> for prototypes. 1997-06-26 00:43:10 +00:00
thorpej 319920c23a Add "struct", "member", and "export" keywords, per PR #3555, from
Ty Sarna <tsarna@endicor.com>.
1997-06-25 03:09:06 +00:00
fvdl b5e26aee04 Invalidate publicly exported FS info when unmounting it locally. 1997-06-24 23:44:57 +00:00
fvdl 4702f17abc Add functions to set/reset the info about the publicly exported
(WebNFS) filesystem. At first glance this should go into the
NFS code, but all the other export code is here as well.
1997-06-24 23:43:33 +00:00
thorpej cd730bdd50 In sosetopt():
- Disallow < 1 values for SO_SNDBUF, SO_RCVBUF, SO_SNDLOWAT, and
  SO_RCVLOWAT; return EINVAL if the user attempts to set <= 0.
  Inspired by PR #3770, from Havard Eidnes <he@vader.runit.sintef.no>.
- For SO_SNDLOWAT and SO_RCVLOWAT, don't let the low-water mark get
  set above the high-water mark.  Behavior is now consistent with
  BSD/OS: If such an attempt is made, silently truncate to the high-water
  value.
1997-06-24 20:04:45 +00:00
thorpej a149ed59e4 Eliminate use of dtom() in the handing of UNIX domain sockets. Add an
"unp_addrlen" member to the unpcb, and use it when copying the socket
name.  This eliminates that last uses of dtom() in the system.
1997-06-24 19:12:53 +00:00
kleink df14b3b830 Add some robustness to ttymodem(), e.g. do not SIGHUP when there hasn't been
an actual carrier transition; from Charles M. Hannum.
1997-06-20 10:50:11 +00:00
pk 98ce8ab879 Remove __FORK_BRAINDAMAGEd code; it's no longer needed. 1997-06-19 20:54:15 +00:00
kleink a0696b91ad When a background process attempts to TIOC[CS]BRK (a.k.a. tcsendbreak()) or
TIOCSTART (a.k.a tcflow()), send its process group a SIGTTOU.
1997-06-18 15:32:33 +00:00
kleink 93da19a2f1 Rewrote break/parity/framing error handling from spec. 1997-06-17 20:41:59 +00:00
drochner a52a25467d Implement quad_t (%qx, %qd, %qo) printf formats.
Closes pr kern/3747.
1997-06-16 15:02:27 +00:00
thorpej 3fc5bf341d Fix a slight botch in dumpdev configuration logic in the RB_ASKNAME
case if a network interface is selected as the root device.
1997-06-16 00:25:05 +00:00
thorpej e94c4d3f1c Call cpu_dumpconf() after cpu_rootconf(). 1997-06-14 04:18:34 +00:00
thorpej 91f7efbaf9 Fix crash dump device selection after the recent swap changes:
- If RB_ASKNAME, prompt for the dump device, defaulting to
  partition 'b' of the root device, if the root device is a disk.
- Else, if dumpspec is set to "none", do not configure a dump device.
- Else, if dumpspec is set by config(8), attempt to use that device.
- Else, dumpspec is wildcarded or unspecified; if the root device is
  a disk, select partition b.  (which was the previous default dump
  partition)

Note, dumps to a local disk now work even if root is on nfs.
1997-06-14 04:17:32 +00:00
mrg 5321ad5c6f regenerate. 1997-06-12 22:07:47 +00:00
mrg 9cee42ea7c swapon back to compat_12 syscall.. 1997-06-12 22:05:37 +00:00
mrg 32d6beee19 regenerate. 1997-06-12 21:47:09 +00:00
mrg abe622f20b for now, leave swapon(8) in place. 1997-06-12 21:41:56 +00:00
mrg 295af85e9e remove swap configuration. 1997-06-12 17:12:17 +00:00
mrg 8986bdf82d regenerate. 1997-06-12 14:49:11 +00:00
mrg c59ed4fd4d add sys_swapctl(), and deprecate, with COMPAT_12, sys_swapon 1997-06-12 14:23:46 +00:00
bouyer 276676cfbb Support ext2fs. 1997-06-11 10:40:16 +00:00
kleink 372bfc7c08 Calculate returned timeval correctly when using SO_SNDTIMEO/SO_RCVTIME;
from Koji Imada <koji@math.human.nagoya-u.ac.jp> in PR/3682.
1997-06-11 10:04:09 +00:00
cgd 21bbd49bf2 in vfs_shutdown(), print "syncing disks... " before dropping to spl0(),
so that if the drop to spl0() causes another panic (e.g. because there's
still some fatal hardware interrupt that's pending) we'll know that we
dropped IPL to sync the disks.
1997-06-07 17:27:57 +00:00
veego 118a503048 Add HW_MACHINE_ARCH for the new sysctl hw.machine_arch which contains the
cpu class of a machine.
1997-06-06 23:14:36 +00:00
pk f910dab2bd Get `canwait' argument to kmem_malloc() right. 1997-06-06 10:51:49 +00:00
thorpej f160cf5490 Prototype lkmdispatch() in <sys/lkm.h>; all LKMs use it. 1997-05-28 02:44:55 +00:00
thorpej cf30e3e3c9 Prototype lkmexists() in <sys/lkm.h> as some LKMs might need to use it. 1997-05-28 02:41:41 +00:00
thorpej 5b2dc97efd Move the test for "no rootspec and no bootdv" to after we've had a chance
to set rootspec in the case of "root on ? type nfs" and no bootdv was
found.  From maximum entropy <entropy@tanstaafl.bernstein.com>, PR #3669.
1997-05-25 19:20:30 +00:00
kleink b7ba6138b6 If the pgrp_id argument of TIOCSPGRP (a.k.a. tcsetpgrp()) does not specify
an existing process group, return EINVAL.
1997-05-22 17:35:42 +00:00
gwr 5e15995438 Moved db_kill_proc() and db_show_all_procs() to ddb/db_xxx.c 1997-05-21 19:56:50 +00:00
gwr 55f621803a Moved db_show_callout() to ddb/db_xxx.c 1997-05-21 19:55:45 +00:00
kleink 91830a9500 When a background process attempts to TIOCDRAIN (a.k.a. tcdrain()), send
its process group a SIGTTOU signal.
1997-05-20 13:11:33 +00:00
pk 153ccc307b Use PHOLD() and PRELE(), rather than manipulating p_holdcnt directly. 1997-05-19 10:43:28 +00:00
kleink 2509589972 Add posix_rename() syscall: regen. 1997-05-18 20:07:27 +00:00
kleink d3aadd8976 Add posix_rename() syscall. 1997-05-18 19:56:48 +00:00
thorpej 92c113aebb Fix printf format botch. 1997-05-17 00:19:02 +00:00
gwr 09da7e273e Eliminate vmspace.vm_pmap and all references to it unless
__VM_PMAP_HACK is defined (for temporary compatibility).
The __VM_PMAP_HACK code should be removed after all the
ports that define it have removed all vm_pmap references.
1997-05-16 21:39:50 +00:00
kleink 9827bd6dc6 When fstat(2)ing a file descriptor of a local communications domain socket,
fill the socket's creation time into the stat structure's st_[acm]time fields:
POSIX requires this behavior for pipe(2). N.B.: updating the st_[am]time fields
when reading/writing the pipe is neither required nor implemented, though.
1997-05-15 17:01:04 +00:00
thorpej e98c5a9b1c Fix two boundary/overflow errors in extent_alloc_subregion():
(1): "substart == ex->ex_end" and "subend == ex->ex_start"
     are completely legal parameters for extent_alloc_subregion()
(2): "(subend - substart) + 1" can cause an overflow if the whole
    numeric range is covered by the extent.
Submitted by Matthias Drochner <drochner@zelz26.zel.kfa-juelich.de>
in PR #3119.
1997-05-12 23:36:32 +00:00
kleink e7b98401d4 Pull in the declarations of db_expression() and db_error(), used by
db_kill_proc().
1997-05-08 17:22:05 +00:00
mycroft 8e39ee9dad Don't use vaccess() here. 1997-05-08 17:16:15 +00:00
mycroft ae5d73b594 Update for vaccess() change. 1997-05-08 17:08:31 +00:00
mycroft 06fb68217b Oops; fix reversed test for VDIR. 1997-05-08 16:34:54 +00:00
mycroft e3f99a9397 Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
1997-05-08 16:19:43 +00:00
mycroft 07ba5e5ac3 Snapshot of namei() cleanup:
1) Eliminate all of the null component name special cases; handle runs of
slashes and leading and trailing slashes completely differently.
2) Return ENOENT when doing a lookup through an empty symlink.
3) Enforce that we're doing a lookup through a directory in in chdir() and
lookup() rather than in foo_lookup().

Not yet finished.
1997-05-08 14:55:22 +00:00
mycroft 4d2eb6bb39 GC some code. 1997-05-08 12:17:47 +00:00
mycroft 837a72363d VEXEC -> VLOOKUP, as appropriate. 1997-05-08 10:57:17 +00:00
mycroft 8f5978a181 GC VS[UG]ID and VSVTX, and add a new VLOOKUP, since the semantics are now
different from VEXEC.
1997-05-08 10:21:35 +00:00
mycroft d7f33c5e60 va_mode contains stat bits. Use S_IS[UG]ID rather than VS[UG]ID. 1997-05-08 10:19:10 +00:00
gwr 9fa3dabef7 Moved db_show_all_procs() to kern_proc.c 1997-05-07 18:49:10 +00:00
gwr 48c524e63a Add db_kill_proc() for DDB (and move db_show_all_procs here so
all the "proc" debugging stuff is here in one place).
1997-05-07 18:48:15 +00:00
tls 02697a5d47 add case for 512Hz in NTP code 1997-05-05 19:25:26 +00:00
mjacob f67d760363 Ancient...needed a slight amount of fixing. 1997-05-04 01:54:24 +00:00
kleink 29c5707479 * Make chown()/fchown() use a piece of common code to set ownership.
* Setting the ownership of a file now implies clearing its set-{group,user}-id
  bits.
1997-04-30 19:29:43 +00:00
mycroft 103c7d360d Oops; forgot to GC the last mbuf allocated when out of clusters. 1997-04-28 17:03:58 +00:00
mycroft 2b65c6c346 Delay turning off P_TRACED until the process is actually waited on. It can't
have any signals delivered while exiting, so this should be okay.  Change the
test for a traced process in wait4() to exclude a process that was started by
the debugger; in this case, only one SIGCHLD should be delivered.
1997-04-28 13:17:05 +00:00
mycroft 701f15db33 Reinstate P_FSTRACE, with different semantics:
* Never send a SIGCHLD to the parent if P_FSTRACE is set.
* Do not permit mixing ptrace(2) and procfs; only permit using the one that
  was attached.
1997-04-28 04:49:27 +00:00
mycroft 43a0dc8b74 Remove remnants of P_FSTRACE, which is no longer used. 1997-04-28 02:51:41 +00:00
mycroft ead5e1a6f7 When stopping a process being traced through procfs, wake up the *parent* (in
case it happens to be doing a WAIT.
1997-04-28 02:36:05 +00:00
mycroft e725c03060 When checking for init, compare against initproc, rather than comparing the
PID.  No functional difference.
1997-04-28 02:29:52 +00:00
tls 3a98883bd3 Don't allow the time to be set backwards if in highly secure mode, since this would allow inode change times to be manipulated. 1997-04-26 21:22:57 +00:00
mycroft c32418bf82 Fix error in vfs_hang_addrlist() that caused file systems to be exported
to more subnets than expected when using netmasks.  From Mike Hibler.
1997-04-25 02:43:10 +00:00
mycroft 9da4efe896 If we fail to allocate a cluster to hold a large packet, simply
drop it rather than using a chain of tiny mbufs.
1997-04-24 08:14:04 +00:00
mycroft 5e62a0725b Change previous test slightly. 1997-04-23 20:19:45 +00:00
mycroft b34794e10f Do not return success when checking for execute permission by super-user and no
execute bits are set.  Also, this test is no longer needed in execve(2).
1997-04-23 20:18:16 +00:00
mycroft 1cf91041df Nuke the old COMPAT_09 truncation of UIDs, GIDs, process and process group IDs. 1997-04-23 18:59:53 +00:00
jtc 2114c082ae In nanosleep, use local error variable when storing rqtp in so that
an error from a failed tsleep will still be returned to the caller.
1997-04-21 16:56:54 +00:00
thorpej 5ca650f210 XXX Kludge for PowerPC; needs a kernel vfprintf(). 1997-04-17 00:06:28 +00:00
jtc c9b0c57620 Add POSIX.1b nanosleep(). 1997-04-16 14:41:28 +00:00