summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
AgeCommit message (Collapse)AuthorFilesLines
2021-03-11that 0 should be NULLderaadt1-2/+2
2021-02-08Revert the convertion of per-process thread into a SMR_TAILQ.mpi1-6/+5
We did not reach a consensus about using SMR to unlock single_thread_set() so there's no point in keeping this change.
2020-12-07Convert the per-process thread list into a SMR_TAILQ.mpi1-5/+6
Currently all iterations are done under KERNEL_LOCK() and therefor use the *_LOCKED() variant. From and ok claudio@
2020-10-14Accommodate POSIX basename(3) that takes a non-const parameter andnaddy1-3/+4
may modify the string buffer. ok millert@
2020-10-12make fixed-sized fixed-value mib[] arrays be constderaadt1-4/+2
ok guenther tb millert
2020-06-28Add stub implementation; derived from kvm_sh.c which has our preferredkettenis1-0/+75
copyright license.
2020-06-28Fix grammar in comment.kettenis1-2/+2
2020-06-25Add missing kvm_dump(3) and kvm_getfiles(3) under SEE ALSO for completenesskn1-2/+4
2019-12-11add sys/wait.h to unbreak builds; following "Replace p_xstat with ps_xexit andsthen1-1/+2
ps_xsig" (sysctl.h r1.198 and friends) FILL_KPROC requires W_EXITCODE from there. cc -static -pie -o ps keyword.o nlist.o print.o ps.o utf8.o -lkvm ld: error: undefined symbol: W_EXITCODE >>> referenced by kvm_proc2.c:293 (/usr/src/lib/libkvm/kvm_proc2.c:293) [...]
2019-10-22struct proc: change ps_start from utc time to uptimecheloha1-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@
2019-08-11No specific called "exec(3)", so move primary manpage to a name whichderaadt1-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
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt2-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.
2019-06-23Export unveil state so that ps(8) can show it. Two new status flags,deraadt1-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
2019-06-07fix print not specified process.asou1-2/+2
ok guenther@ yasuoka@
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.millert2-4/+4
2018-09-07Fix "_nfiles" reference for crash dump.yasuoka1-3/+3
Diff from fukaumi at soum.co.jp ok mpi
2018-05-15fix format strings; ok @kettenisotto1-3/+3
2018-05-03Cleanup usage of free() in libkvm.zhuk2-23/+14
okay deraadt@, otto@, tb@
2018-05-03A few fixes for kvm_getargv(3)/kvm_getenv(3):zhuk3-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@
2018-01-02Stop assuming <sys/file.h> will pull in fcntl.h when _KERNEL is defined.guenther1-1/+2
ok millert@ sthen@
2017-12-14Add Symbols.map to explicitly define the ABIs, hiding linker defined symbols.guenther5-5/+39
Use hidden aliases for internal invocations of exported symbols to avoid PLT. ok deraadt@ kettenis@ jca@
2017-01-21p_comm is the process's command and isn't per thread, so move it fromguenther1-15/+2
struct proc to struct process. ok deraadt@ kettenis@
2017-01-11Add "support" for OpenBSD/arm64 so that it compiles. It's a copy ofpatrick1-0/+131
the 32-bit ARM version and might need updates.
2016-11-07Split PID from TID, giving processes a PID unrelated to the TID of theirguenther3-39/+26
initial thread ok jsing@ kettenis@
2016-10-02Add va_nlink information to struct kinfo_file (so bump the shlib minor)guenther5-5/+12
from Sebastien Marie
2016-09-16handle fallout of moving the address maps to RBT code.dlg1-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.
2016-09-01remove references to sparctedu1-250/+0
2016-07-10use offsetof to create an offset instead of illegal unaligned pointerstedu1-3/+4
ok guenther
2016-05-26Make amaps use less kernel memory (2nd try)stefan1-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@
2016-05-22Revert previous: breaks i386 and powerpc, probably all non-PMAP_DIRECT archsguenther1-53/+11
2016-05-22Make amaps use less kernel memorystefan1-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@
2016-05-14Revert previous commit. Converting bcopy into memcpy is never safe whenkettenis1-7/+7
there is a big fat comment saying "Avoid alignment issues" immediately above them.
2016-05-11remove hppa64 port, which we never got going beyond broken single users.deraadt1-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
2016-05-11convert bcopy to memcpy. ok dlg millerttedu2-9/+9
2016-05-04Add ERRORS section (requested by bluhm@). While there, move start ofzhuk1-4/+19
RETURN VALUES section upper, where it belongs more.
2016-05-04Make KERN_FILE_BYPID return ESRCH when PID not found, both in sysctl andzhuk1-6/+14
offline paths. More polishing to come. Input and okay bluhm@ & kettenis@.
2016-04-25no more systracetedu2-16/+3
2016-03-30for some time now mandoc has not required MLINKS to functionjmc1-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
2016-03-09We are done providing support for the vax.deraadt1-123/+0
lots of agreement.
2015-12-19Remove NULL-checks before free(). ok tb@mmcc9-52/+30
2015-11-10update NAME section to include all documented functions,jmc1-3/+3
or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
2015-09-08port the changes just made to kvm_getfiles in kvm_file2.c r1.47 todlg2-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@
2015-09-04fix a race when fetching files from the kernel. the number of filesdlg2-39/+43
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@
2015-09-04add kvm_realloc() as a private function.dlg2-2/+11
part of a larger diff ok millert@ guenther@
2015-08-28Rework the UNIX domain socket garbage collector, including ideas fromguenther1-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@
2015-05-11When checking flags that will be passed to open(), test the O_ACCMODE portionguenther1-2/+2
separately to avoid false negatives. ok miod@ millert@
2015-04-07Teach libkvm a bit about PAE, making it independent of the kernel definesguenther1-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@
2015-04-04The swapfile argument is also const char *.jca1-4/+4
Found a while ago when porting cpulimit. ok deraadt@
2015-03-30Do not include <machine/autoconf.h>, for it is a kernel-only header and libkvmmiod1-8/+7
doesn't need anything from it. While there, fix format strings and remove unused local variable declarations.
2015-03-28Replace the hand-crafted list of datagram unix domain sockets withbluhm1-3/+5
a SLIST. OK mpi@ benno@