summaryrefslogtreecommitdiffstats
path: root/lib/libkvm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* struct proc: change ps_start from utc time to uptimecheloha2019-10-221-1/+37
| | | | | | | | | Allows us to determine how long a process has been running, even if the UTC clock jumps. With help from bluhm@ and millert@, who squashed several bugs. ok bluhm@ millert@
* No specific called "exec(3)", so move primary manpage to a name whichderaadt2019-08-111-3/+3
| | | | | | | | does exist -- execv(3). Still call this a family but without "Nm". Adjust Xr in various pages to refer to the precise function used rather than the family, in most cases the semantics of execve(2) are being referenced, so change the Xr. ok jmc
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-282-7/+7
| | | | | | 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.
* Export unveil state so that ps(8) can show it. Two new status flags,deraadt2019-06-231-1/+2
| | | | | | | | you'll see one, or neither. 'u' - process installed unveils, but not yet locked with unveil(0,0) or pledge w/o "unveil" 'U' - process has installed unveils, and locked. ok rob
* fix print not specified process.asou2019-06-071-2/+2
| | | | ok guenther@ yasuoka@
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-252-4/+4
|
* Fix "_nfiles" reference for crash dump.yasuoka2018-09-071-3/+3
| | | | | | Diff from fukaumi at soum.co.jp ok mpi
* fix format strings; ok @kettenisotto2018-05-151-3/+3
|
* Cleanup usage of free() in libkvm.zhuk2018-05-032-23/+14
| | | | okay deraadt@, otto@, tb@
* A few fixes for kvm_getargv(3)/kvm_getenv(3):zhuk2018-05-033-63/+97
| | | | | | | | | | | 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@
* Stop assuming <sys/file.h> will pull in fcntl.h when _KERNEL is defined.guenther2018-01-021-1/+2
| | | | ok millert@ sthen@
* Add Symbols.map to explicitly define the ABIs, hiding linker defined symbols.guenther2017-12-145-5/+39
| | | | | | Use hidden aliases for internal invocations of exported symbols to avoid PLT. ok deraadt@ kettenis@ jca@
* 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@
* Add "support" for OpenBSD/arm64 so that it compiles. It's a copy ofpatrick2017-01-111-0/+131
| | | | the 32-bit ARM version and might need updates.
* Split PID from TID, giving processes a PID unrelated to the TID of theirguenther2016-11-073-39/+26
| | | | | | initial thread ok jsing@ kettenis@
* Add va_nlink information to struct kinfo_file (so bump the shlib minor)guenther2016-10-025-5/+12
| | | | from Sebastien Marie
* handle fallout of moving the address maps to RBT code.dlg2016-09-161-4/+8
| | | | | | because userland doesnt have subr_tree, and the tree traversal in this file is simple, this inlines the logic that the functions in the kernel do.
* remove references to sparctedu2016-09-011-250/+0
|
* use offsetof to create an offset instead of illegal unaligned pointerstedu2016-07-101-3/+4
| | | | ok guenther
* Make amaps use less kernel memory (2nd try)stefan2016-05-261-11/+53
| | | | | | | | | | | | | | | | | | | | | The original diff would crash at least i386 and powerpc, as spotted by guenther@ The reason was an incorrect use of sizeof in amap_lookups(). Confirmation that powerpc works by mpi@ and mglocker@ "throw it in" deraadt@ Original commit message: This is achieved by grouping amap slots into chunks that are allocated on-demand by pool(9). Endless "fltamapcopy" loops because of kmem shortage should be solved now. The kmem savings are also important to later enable vmm(4) to use larged shared memory mappings for guest VM RAM. This adapts libkvm also because the amap structure layout has changed. Testing and fix of libkvm glitch in initial diff by tb@ Feedback and "time to get this in" kettenis@
* Revert previous: breaks i386 and powerpc, probably all non-PMAP_DIRECT archsguenther2016-05-221-53/+11
|
* Make amaps use less kernel memorystefan2016-05-221-11/+53
| | | | | | | | | | | | This is achieved by grouping amap slots into chunks that are allocated on-demand by pool(9). Endless "fltamapcopy" loops because of kmem shortage should be solved now. The kmem savings are also important to later enable vmm(4) to use larged shared memory mappings for guest VM RAM. This adapts libkvm also because the amap structure layout has changed. Testing and fix of libkvm glitch in initial diff by tb@ Feedback and "time to get this in" kettenis@
* 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.
* remove hppa64 port, which we never got going beyond broken single users.deraadt2016-05-111-73/+0
| | | | | | hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
* convert bcopy to memcpy. ok dlg millerttedu2016-05-112-9/+9
|
* Add ERRORS section (requested by bluhm@). While there, move start ofzhuk2016-05-041-4/+19
| | | | RETURN VALUES section upper, where it belongs more.
* 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-252-16/+3
|
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-7/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* We are done providing support for the vax.deraadt2016-03-091-123/+0
| | | | lots of agreement.
* Remove NULL-checks before free(). ok tb@mmcc2015-12-199-52/+30
|
* update NAME section to include all documented functions,jmc2015-11-101-3/+3
| | | | | | or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
* port the changes just made to kvm_getfiles in kvm_file2.c r1.47 todlg2015-09-082-29/+30
| | | | | | | | | 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-042-40/+44
| | | | | | | | | | | | | | 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-042-2/+11
| | | | | part of a larger diff 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@
* 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@
* Teach libkvm a bit about PAE, making it independent of the kernel definesguenther2015-04-071-17/+68
| | | | | | | and doing runtime detection of what the target kernel is using. Getting this is now to avoid breakage when kernel bits come. ok deraadt@
* The swapfile argument is also const char *.jca2015-04-041-4/+4
| | | | | | Found a while ago when porting cpulimit. ok deraadt@
* Do not include <machine/autoconf.h>, for it is a kernel-only header and libkvmmiod2015-03-301-8/+7
| | | | | doesn't need anything from it. While there, fix format strings and remove unused local variable declarations.
* Replace the hand-crafted list of datagram unix domain sockets withbluhm2015-03-281-3/+5
| | | | | a SLIST. OK mpi@ benno@
* Rework the virtual memory layout on SRMMU systems (sun4d/sun4m) to use a muchmiod2015-03-181-5/+5
| | | | | | | | | | | | | | | | | | | | | lower VM_MIN_KERNEL_ADDRESS, since these systems are not crippled by the Sun-4 MMU hole and have the real 4GB of address space. Kernels running on Sun-4 MMU are not affected and will still be restricted to the existing 128MB of kernel space, with 1GB - 128MB of user space. Kernels running on SRMMU will now provide the low 3GB of address space to userland, and use the top 1GB for the kernel, except when compiled with option SMALL_KERNEL, in which case they will keep Sun-4 style the layout (this is temporary to allow for people to boot bsd.rd to upgrade even when not running 2.10 boot blocks, and will be removed eventually) A consequence of this is that the top of the userland stack is no longer at 0xf0000000. But since nothing in userland uses USRSTACK anymore, this should not be an issue. Tested on sun4c and various sun4m, with physical memory sizes ranging from 32 to 448MB.
* Extend struct kinfo_file a bit for netstat (sync with the kernel).claudio2015-02-112-2/+33
| | | | | 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-112-9/+29
| | | | | | | 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@
* typomiod2015-02-091-2/+2
|
* Move to the <limits.h> universe.deraadt2015-01-163-7/+8
| | | | review by millert, binary checking process with doug, concept with guenther
* Cleanup some macros and #defines in i386 pmap. Previously committed andmlarkin2015-01-091-1/+10
| | | | | | backed out because of libkvm breakage, recommitting now with libkvm fix. ok deraadt@
* include lock.h, needed for later headers but currently included by magictedu2014-12-162-2/+4
| | | | ok millert
* Nuke yet more obvious #include duplications.krw2014-11-191-2/+1
| | | | ok deraadt@