patch-dtpstree_cpp 842 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. $OpenBSD: patch-dtpstree_cpp,v 1.1 2012/01/08 22:49:56 naddy Exp $
  2. --- dtpstree.cpp.orig Sun Jan 8 23:02:45 2012
  3. +++ dtpstree.cpp Sun Jan 8 23:09:20 2012
  4. @@ -92,8 +92,25 @@ template <typename Type>
  5. inline char *comm(Type *proc);
  6. #ifndef HAVE_STRUCT_KINFO_PROC2
  7. +#ifdef HAVE_KINFO_NEWABI
  8. typedef kinfo_proc Proc;
  9. +const int Flags(KVM_NO_FILES);
  10. +
  11. +template <>
  12. +inline kinfo_proc *getprocs(kvm_t *kd, int &count)
  13. +{
  14. + return kvm_getprocs(kd, All, 0, sizeof (kinfo_proc), &count);
  15. +}
  16. +
  17. +template <>
  18. +inline char **getargv(kvm_t *kd, const kinfo_proc *proc)
  19. +{
  20. + return kvm_getargv(kd, proc, 0);
  21. +}
  22. +#else
  23. +typedef kinfo_proc Proc;
  24. +
  25. const int Flags(O_RDONLY);
  26. template <>
  27. @@ -107,6 +124,7 @@ inline char **getargv(kvm_t *kd, const kinfo_proc *pro
  28. {
  29. return kvm_getargv(kd, proc, 0);
  30. }
  31. +#endif
  32. #else
  33. typedef kinfo_proc2 Proc;