summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* that 0 should be NULLderaadt2021-03-111-2/+2
|
* Accommodate POSIX basename(3) that takes a non-const parameter andnaddy2020-10-141-3/+4
| | | | may modify the string buffer. ok millert@
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-5/+5
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Cleanup usage of free() in libkvm.zhuk2018-05-031-20/+11
| | | | okay deraadt@, otto@, tb@
* A few fixes for kvm_getargv(3)/kvm_getenv(3):zhuk2018-05-031-1/+10
| | | | | | | | | | | 1. Most notable: this splits argv buffer into argv-specific one and environ-specific one. This makes ps -eww totally happy. 2. realloc() usage in kvm_argv() is now ENOMEM-prone. 3. The "int off" changed to "ptrdiff_t off", as it should be. input & okay deraadt@, millert@
* Add Symbols.map to explicitly define the ABIs, hiding linker defined symbols.guenther2017-12-141-1/+4
| | | | | | Use hidden aliases for internal invocations of exported symbols to avoid PLT. ok deraadt@ kettenis@ jca@
* use offsetof to create an offset instead of illegal unaligned pointerstedu2016-07-101-3/+4
| | | | ok guenther
* Revert previous commit. Converting bcopy into memcpy is never safe whenkettenis2016-05-141-7/+7
| | | | | there is a big fat comment saying "Avoid alignment issues" immediately above them.
* convert bcopy to memcpy. ok dlg millerttedu2016-05-111-7/+7
|
* Remove NULL-checks before free(). ok tb@mmcc2015-12-191-9/+5
|
* port the changes just made to kvm_getfiles in kvm_file2.c r1.47 todlg2015-09-081-4/+3
| | | | | | | | | kvm_getprocs. basically cope with the number of procs growing between when we get the size and when we get the list. ok guenther@
* fix a race when fetching files from the kernel. the number of filesdlg2015-09-041-4/+3
| | | | | | | | | | | | | | 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@
* add kvm_realloc() as a private function.dlg2015-09-041-1/+9
| | | | | part of a larger diff ok millert@ guenther@
* When checking flags that will be passed to open(), test the O_ACCMODE portionguenther2015-05-111-2/+2
| | | | | | separately to avoid false negatives. ok miod@ millert@
* Move to the <limits.h> universe.deraadt2015-01-161-4/+4
| | | | review by millert, binary checking process with doug, concept with guenther
* Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)guenther2014-08-151-34/+32
| | | | | | | on it, simplifying error checking, reducing system calls, and improving thread-safety for libraries. ok miod@
* ANSIfy a declarationguenther2013-11-161-3/+2
|
* reduce use of <sys/user.h>deraadt2013-11-011-2/+2
| | | | ok guenther millert
* Remove support for a.out and ecoff. We only do elf now.deraadt2013-10-171-2/+2
| | | | ok miod
* Replace the old, broken KERN_PROC ABI and its matching functionsguenther2011-03-121-4/+1
| | | | | | | | | in libkvm with the stable-ABI versions that are currently named KERN_PROC2, kvm_get{proc,argv,envv}2(). The latter names and symbols will continue to be supported for a few releases. Committing now that they ports people have had a couple releases to update pkgs that usd the old functions
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-9/+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
* Add kvm_getfile2 which uses KERN_FILE2 when possible, fallingmillert2009-06-071-2/+5
| | | | back on kmem grovelling for non-live kernels. OK deraadt@
* All operation on live kernels uses sysctl interface, there is no reason tomiod2009-01-211-5/+3
| | | | | | access the swap area. Change kvm_open() to no longer require a swap area, and to not consider failure to open() it as fatal. Post-mortem analysis would need an image of the swap area at the time of the crash, anyway.
* careful cleanup following advice from lint. be very very very carefulderaadt2006-03-311-36/+39
| | | | with sprinkling in size_t!
* kvm_openfiles() should take int flag, not unsignedderaadt2006-03-311-3/+3
|
* for some of internal functions use paddr_t where phys addr is intended insteadd of u_long; miod@ okmickey2006-03-201-4/+5
|
* Kill (almost all) warnings.miod2004-09-151-2/+4
|
* KVM_NO_FILES is 0x80000000, so arg 4 of kvm_openfiles() must be unsignedderaadt2004-09-141-3/+3
| | | | int instead of int; millert ok
* free memory allocated by kvm_getproc2() in kvm_close()jaredy2004-08-111-2/+4
| | | | ok deraadt@ millert@
* if sym has null value -- report as not found; check that kd->vmst is set before use; millert@ okmickey2004-07-011-2/+8
|
* knf; ok millertderaadt2004-06-151-90/+49
|
* more explicitly check against -1 for pread/pwrite error returns; millert okderaadt2004-02-231-5/+5
|
* strlcpy is nicer. ok deraadt@ millert@tedu2004-02-181-4/+4
|
* Initialize procbase2 to 0 in _kvm_open(); Dan Harnettmillert2004-01-091-2/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* indentderaadt2002-09-171-5/+8
|
* Set close on exec flag for file descriptors opened by kvm_open().millert2002-09-171-3/+23
| | | | Inspired by NetBSD. deraadt@ and myself.
* Add a flag - KVM_NO_FILES which tells kvm_openfiles to notart2002-06-081-2/+10
| | | | | open any files, just return an kvm handle that we can use to some of the functions.
* call open() with 3 args, for the heck of itderaadt2002-03-051-9/+9
|
* We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.millert2002-02-191-50/+5
|
* Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)millert2002-02-171-4/+4
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-5/+5
|
* Use the address of the symbol, do not overwrite the address with 0, beforedrahn2001-11-211-5/+5
| | | | calling pwrite. Fix from dlucq. ok millert.
* Adapt to new uvm/ includes.art2001-11-061-4/+2
|
* No need to pull in vm/vm_param.h in any of these files.art2001-11-051-3/+2
|
* no more vm/swap_pager.hderaadt2001-06-271-3/+2
|
* Convert lseek/{read,write} pairs into pread and pwrite.art2001-05-181-99/+84
| | | | from my todo list, work by Jonathon Fletcher <jonathon.fletcher@pobox.com>.
* Repair a fprintf message lacking one parameter.miod2001-05-171-3/+3
| | | | | Found by having a look at the recent TPE patches, which fixes libkvm but not libkvm.old...
* spellingtodd2001-01-041-3/+3
|
* various savecore/kvm fixes; gluk@ptci.ru, PR#1461deraadt2000-10-251-9/+10
|