summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the style bugs in the style bugs fix. The style bug fix made theimp2000-01-211-4/+6
| | | | | new function inconsistant with the rest of this file. The spelling and grammer fixes were good and remain.
* Fix style bugs in the last commit.green2000-01-211-10/+8
|
* bdeize last commit:imp2000-01-201-3/+0
| | | | | | o Remove opt_dontuse.h and ifdef PROCFS Subitted by: bde, peter
* When we are execing a setugid program, and we have a procfs filesystemimp2000-01-201-0/+59
| | | | | | | | file open in one of the special file descriptors (0, 1, or 2), close it before completing the exec. Submitted by: nergal@idea.avet.com.pl Constructive comments: deraadt@openbsd.org, sef, peter, jkh
* Removed unused includes.bde1999-12-261-26/+12
| | | | | | | Rumoved unused compatibility cruft for dup(). Using it today would just break dup() on fd's >= 64. Fixed some style bugs.
* Only bother converting the stat structure if we intend to return it,dillon1999-11-181-2/+3
| | | | | | | | when no error occurs. PR: kern/14966 Reviewed by: dillon@freebsd.org Submitted by: Kelly Yancey kbyanc@posi.net
* Remove cdevsw_add() - the necessary make_dev() calls appear to be therepeter1999-11-181-1/+0
| | | | already.
* This is a partial commit of the patch from PR 14914:phk1999-11-161-2/+2
| | | | | | | | | | | | | Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY structures for list operations. This patch makes all list operations in sys/kern use the queue(3) macros, rather than directly accessing the *Q_{HEAD,ENTRY} structures. This batch of changes compile to the same object files. Reviewed by: phk Submitted by: Jake Burkholder <jake@checker.org> PR: 14914
* Use fo_stat() rather than duplicating knowledge of file type internalspeter1999-11-081-59/+16
| | | | in here for stat(2) and friends. Update the badops entries accordingly.
* Fix the advisory file locking by restoring previous ordering in closef()/green1999-11-071-8/+10
| | | | | fdrop(). This only showed up when a file descriptor was duplicated and then closed once, where the lock would be released on the first close().
* Trim unused options (or #ifdef for undoc options).peter1999-10-111-1/+0
| | | | Submitted by: phk
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* Fix a hole in jail(2).phk1999-09-251-0/+7
| | | | Noticed by: Alexander Bezroutchko <abb@zenon.net>
* This is what was "fdfix2.patch," a fix for fd sharing. It's prettygreen1999-09-191-19/+26
| | | | | | | | | | | | | | | | | far-reaching in fd-land, so you'll want to consult the code for changes. The biggest change is that now, you don't use fp->f_ops->fo_foo(fp, bar) but instead fo_foo(fp, bar), which increments and decrements the fp refcount upon entry and exit. Two new calls, fhold() and fdrop(), are provided. Each does what it seems like it should, and if fdrop() brings the refcount to zero, the fd is freed as well. Thanks to peter ("to hell with it, it looks ok to me.") for his review. Thanks to msmith for keeping me from putting locks everywhere :) Reviewed by: peter
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-41/+10
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Fix fd race conditions (during shared fd table usage.) Badfileops isgreen1999-08-041-6/+64
| | | | | | | | | | | | now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
* From the submitter:msmith1999-06-071-6/+6
| | | | | | | | | | | | | | | | | - this causes POSIX locking to use the thread group leader (p->p_leader) as the locking thread for all advisory locks. In non-kernel-threaded code p->p_leader == p, so this will have no effect. This results in (more) correct POSIX threaded flock-ing semantics. It also prevents the leader from exiting before any of the children. (so that p->p_leader will never be stale) in exit1(). We have been running this patch for over a month now in our lab under load and at customer sites. Submitted by: John Plevyak <jplevyak@inktomi.com>
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-5/+22
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* Add sysctl descriptions to many SYSCTL_XXXsbillf1999-05-031-5/+6
| | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style)
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-281-2/+2
| | | | (Edited automatically)
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT aseivind1999-01-081-2/+2
| | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
* I got another batch of suggestions for cosmetic changes from bde.truckman1998-11-111-4/+7
|
* Installed the second patch attached to kern/7899 with some changes suggestedtruckman1998-11-111-20/+122
| | | | | | | | | | | | | | | | by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
* Fixed printf format errors.bde1998-07-291-4/+4
|
* Cast longs to intptr_t before casting them to pointers.bde1998-07-151-5/+8
| | | | | Fixed bitrot in pseudo-declaration of `struct fcntl_args'. fcntl() is now broken in some cases when ints are larger than longs.
* 64bit fixes: p->p_retval is a register_t[] not an int[].dfr1998-06-101-3/+4
|
* Fix the futimes/undelete/utrace conflict with other BSD's. Note thatdyson1998-05-111-1/+51
| | | | | | | the only common usage of utrace (the possible problem with this commit) is with malloc, so this should be a real problem. Add the various NetBSD syscalls that allow full emulation of their development environment.
* Make the rootdir handling more consistent. Now, processes alwaysdyson1998-02-151-7/+4
| | | | | | have a root vnode associated with them, and no special checks for the null case are needed. Submitted by: terry@freebsd.org
* Back out DIAGNOSTIC changes.eivind1998-02-061-2/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+2
|
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+2
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+3
|
* Fix and complete the AIO syscalls. There are some performance enhancementsdyson1997-11-291-1/+19
| | | | coming up soon, but the code is functional. Docs will be forthcoming.
* Fixed a missing conversion of retval to p_retval in disabled code.bde1997-11-231-3/+3
| | | | | | | | Fixed overflow of FFLAGS() in fcntl(F_SETFL, ...). This was not a security hole, but gave wrong results for silly flags values. E.g., it make fcntl(F_SETFL, -1) equivalent to fcntl(F_SETFL, 0). POSIX requires ignoring the open mode bits in fcntl() (even if they would be invalid for open()).
* Fixed duplicate definitions of M_FILE (one static).bde1997-11-231-2/+2
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-31/+23
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+4
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Various select -> poll changespeter1997-09-141-2/+2
|
* Removed some stale comments.bde1997-08-261-4/+4
| | | | Fixed a gratuitous ANSIism.
* Removed support for OLD_PIPE. <sys/stat.h> is now missing the hack thatbde1997-04-091-7/+1
| | | | | supported nameless pipes being indistinguishable from fifos. We're not going back.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* This commit is the embodiment of some VFS read clustering improvements.dyson1996-12-291-1/+2
| | | | | | | | | | | | Firstly, now our read-ahead clustering is on a file descriptor basis and not on a per-vnode basis. This will allow multiple processes reading the same file to take advantage of read-ahead clustering. Secondly, there previously was a problem with large reads still using the ramp-up algorithm. Of course, that was bogus, and now we read the entire "chunk" off of the disk in one operation. The read-ahead clustering algorithm should use less CPU than the previous also (I hope :-)). NOTE: THAT LKMS MUST BE REBUILT!!!
* Fixed nonexistent checking of lock types for F_GETLK.bde1996-12-191-1/+4
| | | | Found by: NIST-PCTS
* Fixed lseek() on named pipes. It always succeeded but should always fail.bde1996-12-191-1/+4
| | | | | | | | | | Broke locking on named pipes in the same way as locking on non-vnodes (wrong errno). This will be fixed later. The fix involves negative logic. Named pipes are now distinguished from other types of files with vnodes, and there is additional code to handle vnodes and named pipes in the same way only where that makes sense (not for lseek, locking or TIOCSCTTY).
* Fixed bitrot in the read-only attribute:bde1996-09-281-5/+4
| | | | | | - kern.maxfilesperproc was read-only (and thus essentially useless). Removed unused #includes. Strength-reduced used #includes.
OpenPOWER on IntegriCloud