summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_file2.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-251-2/+2
|
* Fix "_nfiles" reference for crash dump.yasuoka2018-09-071-3/+3
| | | | | | Diff from fukaumi at soum.co.jp ok mpi
* Stop assuming <sys/file.h> will pull in fcntl.h when _KERNEL is defined.guenther2018-01-021-1/+2
| | | | ok millert@ sthen@
* p_comm is the process's command and isn't per thread, so move it fromguenther2017-01-211-15/+2
| | | | | | struct proc to struct process. ok deraadt@ kettenis@
* Split PID from TID, giving processes a PID unrelated to the TID of theirguenther2016-11-071-8/+9
| | | | | | initial thread ok jsing@ kettenis@
* Add va_nlink information to struct kinfo_file (so bump the shlib minor)guenther2016-10-021-1/+5
| | | | from Sebastien Marie
* Make KERN_FILE_BYPID return ESRCH when PID not found, both in sysctl andzhuk2016-05-041-6/+14
| | | | | | offline paths. More polishing to come. Input and okay bluhm@ & kettenis@.
* no more systracetedu2016-04-251-12/+1
|
* fix a race when fetching files from the kernel. the number of filesdlg2015-09-041-36/+41
| | | | | | | | | | | | | | might have increased between when we got the number of files and when we requested that number of files. now we allocate another 10ish percent on top of what the kernel says we need, and retry if that still isnt enough. while here use realloc instead of constantly going through free/malloc sequences. with input from claudio@ deraadt@ ok millert@ guenther@
* Rework the UNIX domain socket garbage collector, including ideas fromguenther2015-08-281-2/+2
| | | | | | | | | | | | | {Free,Net}BSD - when a socket is closed with fds in its input, defer closing them to a task to avoid recursing. This eliminates the complicated extra reference taking which had a 37 line(!) comment explanation - move flags, counts, and links only needed for this from struct file to struct unpcb - document the flow of the mark/sweep collector much help from claudio@ who made me explain the GC to him until we trusted it ok claudio@ mpi@ deraadt@
* Replace the hand-crafted list of datagram unix domain sockets withbluhm2015-03-281-3/+5
| | | | | a SLIST. OK mpi@ benno@
* Extend struct kinfo_file a bit for netstat (sync with the kernel).claudio2015-02-111-1/+32
| | | | | Bump minor number because of this. OK guenther@
* Prefer arg != 0 over arg for non-boolean. nitted kettenis@guenther2015-02-111-2/+2
|
* sysctl({CTL_KERN, KERN_FILE, KERN_FILE_BYFILE}) previously requiredguenther2015-02-111-6/+5
| | | | | | | the extra argument to be zero; instead, make it filter on the file type (DTYPE_*) when non-zero to make claudio's netstat work easier. ok claudio@
* Move to the <limits.h> universe.deraadt2015-01-161-1/+2
| | | | review by millert, binary checking process with doug, concept with guenther
* Nuke yet more obvious #include duplications.krw2014-11-191-2/+1
| | | | ok deraadt@
* Put the socket splicing fields into a seperate struct sosplice thatbluhm2014-11-031-6/+14
| | | | | | | gets only allocated when needed. This way struct socket shrinks from 472 to 392 bytes on amd64. When splicing gets active, another 88 bytes are allocated for struct sosplice. OK dlg@
* Remove unnecessary netinet/in_systm.h include.lteo2014-10-251-2/+1
| | | | ok millert@
* Apply reallocarray() idiom.deraadt2014-10-151-7/+9
| | | | ok guenther
* Track whether a process is a zombie or not yet fully built via flagsguenther2014-07-041-29/+29
| | | | | | | | | | | PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's thread data. This eliminates the need for the thread-level SDEAD state. Change kvm_getprocs() (both the sysctl() and kvm backends) to report the "most active" scheduler state for the process's threads. tweaks kettenis@ feedback and ok matthew@
* Eliminates struct pcred by moving the real and saved ugids intoguenther2014-03-301-11/+4
| | | | | | | | | struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
* More crash dump parsing fixes: correct paddr in process info and pidsguenther2014-02-051-11/+10
| | | | | | in file info. Drop some unnecessary casts and unused variables too. ok millert@
* Threads can't be zombies, only processes, so change zombproc to zombprocess,guenther2014-01-201-46/+34
| | | | | | | | make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
* p_textvp moved from struct proc to struct processguenther2014-01-201-4/+4
|
* Prep for hidden visibility: move the vnode/file related functionguenther2013-11-161-3/+2
| | | | | | | | declarations, including _kvm_getftype(), into a new header, kvm_file.h, so that we don't have to pull <sys/vnode.h> into all the .c files. No more extern function declaration in .c files. ok millert@
* Apply format __attribute__ to _kvm_err() and fix the errors that it detects.guenther2013-11-121-13/+22
| | | | | | | Treat failure to KREAD teh pcredd or ucreds to be errors insteading of continuing with bogus data. ok deraadt@ millert@
* a missing prototypesderaadt2013-11-121-1/+6
| | | | and don't act like an unknown vnode type is "ok"
* - add UNIX-domain socket info to struct kinfo_file2guenther2013-10-221-37/+65
| | | | | | | | | | - convert netstat from kvm_getfiles() to kvm_getfile2() using that - delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major) - rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file and KERN_FILE2 to KERN_FILE. ok deraadt@, millert@ ports scan sthen@
* spacesderaadt2013-03-201-2/+2
|
* knowledge of nnpfs can be removedderaadt2012-08-231-26/+1
|
* Committed the wrong version (an earlier try) of the KERN_FILE2 vsguenther2012-06-021-2/+4
| | | | rthreads fix. Update to the correct one.
* Eliminate the f_usecount ref count in struct file; instead of sleepingguenther2012-05-011-2/+2
| | | | | | | | | 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@
* Fix kvm_deadfile2_byid()'s handling of kernel vs user addresses forguenther2012-04-201-14/+43
| | | | | | | | fd_ofiles and fd_ofileflags, reading in the separate allocation when necessary. Lets fstat -p and fstat -u work on kernel crash dumps again. ok millert@
* Make kvm_getfile2() have a fighting change to work correctly on crashguenther2012-04-141-91/+88
| | | | dumps
* The kinfo_file2 structure's f_wbytes member was being filled with theguenther2012-03-281-2/+2
| | | | | | read byte count instead of the written byte count. pointed out by paulm at tetrardus.net, ok dcoppa@
* 0 is a valid uid for files sysctl, don't skip it. reminded by guenthertedu2012-03-131-2/+2
|
* Add rtable id and thread id to struct kinfo_proc (and fix process id)guenther2012-01-071-11/+32
| | | | | | | | | | | and add an 'rtableid' keyword to ps. Add rtable id, thread id, and socket splice info to struct kinfo_file2 and make fstat display socket splice information. Remove old KVM_PROC2 and kinfo_proc2 interfaces; bump libkvm major Socket splice info and corrections from bluhm@ "Lovely" deraadt@
* The ktrace vnode has moved to struct process and changed name.guenther2011-12-141-3/+3
| | | | Missed commit pointed out by mikeb@
* move the specfs code to a place people can see it; ok guenther thib krwderaadt2011-07-041-3/+2
|
* Move some macros in <msdosfs/denode.h> to outside the #ifdef _KERNELguenther2010-07-171-3/+1
| | | | | | so that libkvm doesn't need to define that, thereby avoiding some warnings. ok miod@
* Fail instead of lying if a process asks sysctl()'s KERN_PROC2 orguenther2010-06-291-1/+6
| | | | | | | KERN_FILE2 (or their libkvm wrappers) for more information than the running implementation knows how to provide. ok millert@ deraadt@
* Reimplement kvm_getproc2()'s support for reading crash dumps andguenther2010-01-101-3/+1
| | | | | | | | | | | | | | /dev/mem to be direct instead of going through kvm_getprocs(), as that function is going to get more an more broken as we move stuff from struct proc to struct process for rthreads. To minimize the code copying, put the common logic of filling in a kinfo_proc2 structure into a macro FILL_KPROC2() in <sys/sysctl.h> for use from both the kernel and user-space. This also hides the KERN_PROC #define behind "#if defined(_KERNEL)||defined(_LIBKVM)", as it's deprecated. Positive feedback from millert and blambert; so committing to unblock further rthreads work.
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-5/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* Support KERN_FILE_TEXT here toomillert2009-07-211-2/+13
|
* Handle the case where so_pcb is NULL.millert2009-07-211-2/+4
|
* correct kvm_getfile2 error stringmillert2009-07-081-4/+4
|
* Install ntfs includes and add libkvm (fstat) support. ntfs bitsmillert2009-06-241-6/+9
| | | | adapted from NetBSD fstat. OK deraadt@
* Move KREAD define to kvm_private.hmillert2009-06-201-5/+2
|
* Split out cd9660 bits into their own .c file to avoid #define collisionsmillert2009-06-201-25/+6
| | | | with ufs and add also udf support. OK miod@
* Add msdosfs support now that we have the headers.millert2009-06-201-40/+59
|