summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Format string fixes:sf2013-07-041-3/+3
| | | | | | | | f_count is long ok kettenis@ Change esm_sensor_map.arg to int ok deraadt@
* convert some easy bcopy to memcpy and clean up fdexpand a bit.tedu2013-06-111-21/+23
| | | | ok kettenis
* Move FHASLOCK from f_flag to f_iflags, freeing up a bit for passingguenther2013-06-051-3/+3
| | | | | | O_* flags and eliminating an XXX comment. ok matthew@ deraadt@
* To protect assumptions inside systrace, don't let systrace fds beguenther2012-08-231-16/+16
| | | | | | shared between processes. ok djm@
* Revert the blocked FIFO open fix, as there's either a race in theguenther2012-07-111-21/+6
| | | | ref-count handling under handling, or blambert@ is messing with my head
* Don't hold the fd-table lock across vn_open(), as opening a FIFO may block.guenther2012-07-081-6/+21
| | | | | | Having done that, dupfdopen() has to handle a possible race. ok matthew@ krw@
* Cleanup O_CLOEXEC handling and make sure UF_EXCLOSE is set correctlymatthew2012-05-211-2/+3
| | | | | | | | | | when opening /dev/fd/* (i.e., UF_EXCLOSE is now set iff O_CLOEXEC is set, rather than copying UF_EXCLOSE from the file descriptor being dup'd). Also, add support for O_CLOEXEC and O_DIRECTORY to fhopen(). ok krw, guenther; feedback from millert; testing and bug finding by krw
* Remove the "vn_open() returning ENXIO means dup+close" hook thatguenther2012-05-141-48/+14
| | | | | | | was used by the now defunct portalfs. Zero out fd_ofileflags[fd] when allocating an fd instead of when releasing it. ok krw@ matthew@
* Eliminate the f_usecount ref count in struct file; instead of sleepingguenther2012-05-011-30/+16
| | | | | | | | | at the top of closef() until all in-progress calls finish, just do the advisory locking bits required of close() by POSIX and let whichever thread has the last reference do the call to the file's fo_close() method and the final cleanup. lots of discussion with deraadt@ and others; worked out with and ok krw@
* Add struct proc * argument to FRELE() and FILE_SET_MATURE() inguenther2012-04-221-11/+12
| | | | | | anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
* In this case where dup2() extends the table using fdalloc, the newlyderaadt2012-04-121-1/+2
| | | | | | selected fd is automatically fd_used(). We need to fd_unused() it, because it will be fd_used() again in finishdup(). spotted by guenther ok miod
* New system call: getdtablecount(2) returns the number of filederaadt2012-04-121-1/+10
| | | | | descriptors the process currently has open. ok guenther miod gilles ...
* dup() was calling fd_used() twice for the new file descriptor. Seperatederaadt2012-04-121-7/+8
| | | | | the dup and dup2 cases. with guenther ok miod
* Hold struct filedesc's fd_lock when writing to the fd_ofiles, fd_ofileflags,guenther2012-02-151-9/+25
| | | | | | | | or fd_{lo,hi}maps members, or when doing a read for a write. Fixes hangs when an rthreaded processes sleeps while copying the fd table for fork() and catches another thread with the lock. ok jsing@ tedu@
* Add F_DUPFD_CLOEXEC.matthew2011-07-081-1/+5
| | | | "Sure" deraadt@
* Support sending struct info to kdump. So far for struct stat andotto2011-07-081-1/+6
| | | | struct sockaddress; mostly from freebsd. ok deraadt@ tedu@ nicm@
* Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, soguenther2011-04-021-2/+2
| | | | | | that you can't evade the checks by doing the dirty work in an rthread ok blambert@, deraadt@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-4/+4
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* Rollback the allproclk and fileheadlk addition. When grabbing anguenther2010-07-191-7/+1
| | | | | | | | rwlock, the thread will release biglock if it sleeps, means that atomicity from before the rw_enter() to after it is not guaranteed. The change didn't address those, so pulling it until it does. "go for it" tedu@
* Add a rwlock around the filehead and allproc lists, mainly to protecttedu2010-03-241-1/+7
| | | | | list walkers in sysctl that can block. As a reward, no more vslock. With some feedback from art, guenther, phessler. ok guenther.
* Remove the VREF() macro and replaces all instances with a call to verf(),thib2009-07-091-5/+5
| | | | | | | | | | | which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
* Punctuate comment for clarity, and keep tense consistent throughoutblambert2008-11-251-3/+3
| | | | ok and improvements jmc@
* Fix a bunch of problems and races with posix file locking.art2008-09-191-45/+58
| | | | | | | | | | | | | | | | - file descriptor table becomes the owner of the lock instead of the proc. - When grabbing the lock, we check if the fd hasn't changed under our feet, this is more or less impossible to solve without a hack like this. I've banged my head against the wall, I figured out a solution, but implementing it correctly would cost me 12 gray hairs. Screw it, this is ugly, but it works. - Wait until usecount drains before releasing the posix lock in closef. - Add missing FREF/FRELE to sys_flock - keep the pid in the flock struct instead of abusing the fact that we used to use the proc as the lock owner. Pointed out by and discussed with Al Viro, big thanks. miod@ ok
* use PR_ZERO instead of a bzero() right after the pool_get();thib2008-06-121-3/+2
| | | | ok blambert@
* Add a PR_ZERO flag for pools, to compliment the M_ZEROthib2008-05-061-3/+2
| | | | | | | malloc flag, does the same thing. use it in a few places. OK tedu@, "then go ahead. and don't forget the manpage (-:" miod@
* MALLOC/FREE -> malloc/freechl2007-10-291-3/+3
| | | | | | replace an hard coded value with M_WAITOK ok krw@
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-3/+3
| | | | | | | | | | | | it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
* grammar, spelling, and style fixes from bret lambert;jmc2006-11-141-3/+5
| | | | kern_descrip.c change ok deraadt
* add a name to rwlock so that we can tell where procs are getting stucktedu2006-05-071-2/+2
| | | | | | without breaking into ddb. doubles the size of rwlock [1], but moving forward this really helps. ok/tested pedro fgsch millert krw [1 - next person to add a field to this struct gets whipped with a wet noodle]
* typo fix from ray lai;jmc2006-01-061-2/+2
| | | | ok deraadt
* do not allow setugid processes to use /dev/fd/#, unless they are aderaadt2005-12-071-1/+12
| | | | | setuid-script and are attempting to dup is the specific setuid-script fd via such a pathname; ok tedu pedro millert
* ansi/deregister.jsg2005-11-281-78/+29
| | | | 'go for it' deraadt@
* change VOP_PATHCONF to take a locked vnode, as itsjaredy2005-07-031-1/+3
| | | | | | | comment entry describes. requires that sys_fpathconf() lock its vnode. lots of testing by jolan and myself, ok pedro
* remove p arg from fdplocktedu2004-07-221-6/+6
|
* new syscall closefrom(int fd) closes all fds equal and greater than fd.tedu2004-01-121-1/+23
| | | | ok deraadt@ millert@
* lock filedesc before manipulating. avoids some rare races.tedu2004-01-061-19/+33
| | | | testing for quite some time by brad + otto
* Check array index before using it; from Tim Robbins via Niels.millert2003-12-021-2/+2
|
* change arguments to suser. suser now takes the process, and a flagstedu2003-08-151-2/+2
| | | | | | | | | argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
* Remove unreachable return statement after break; Patrick Latifimillert2003-08-061-2/+1
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Allow fdinit to be called with p == NULL so that we can useart2002-11-221-10/+12
| | | | it to properly init filedescs for proc0.
* finishdup: Avoid reference count leak in error case by reordering some code.art2002-11-081-5/+6
|
* Match reality by changing (u_int) -> (int) in comments.nordin2002-10-151-4/+4
|
* Add missing FRELE() in finishdup() error case; ok artpvalchev2002-08-231-2/+5
|
* compatiblity -> compatibilityderaadt2002-06-031-2/+2
| | | | | | decriptor -> descriptor authentciated -> authenticated transmition -> transmission
* Fix a comment I missed when renaming FILE_UNUSE to FRELE.art2002-05-231-2/+2
|
* First round of __P removal in sysmillert2002-03-141-5/+5
|
* Missing FRELE in error case. ok provos@nordin2002-02-191-1/+2
|
* fix issue on LP64 BE arch's w/ fcntl's F_GETOWNericj2002-02-181-3/+3
| | | | pointed out by der Mouse <mouse@Rodents.Montreal.QC.CA>
* More FREF/FRELE on relevant places. Now, only sys_mmap and a bunch of ioctl functions in sys/compat are left.art2002-02-131-16/+34
|