OpenBSD: kinfo_proc2 -> kinfo_proc

The kinfo_proc2 interface has been removed from OpenBSD (it was
deprecated anyway), so use the correct replacement: kinfo_proc.

https://bugzilla.gnome.org/show_bug.cgi?id=667591
This commit is contained in:
Antoine Jacoutot
2012-01-22 12:47:49 +01:00
parent aa7572abfd
commit b11aa1517e
9 changed files with 19 additions and 19 deletions

View File

@@ -49,7 +49,7 @@ char *
glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
pid_t pid, unsigned max_len)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
char *retval, **args, **ptr;
size_t size = 0, pos = 0;
int count;
@@ -67,7 +67,7 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
glibtop_suid_enter (server);
/* Get the process data */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count < 1)) {
glibtop_suid_leave (server);
@@ -75,7 +75,7 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
return NULL;
}
args = kvm_getargv2 (server->machine.kd, pinfo, max_len);
args = kvm_getargv (server->machine.kd, pinfo, max_len);
if (args == NULL) {
glibtop_suid_leave (server);
glibtop_warn_io_r (server, "kvm_getargv (%d)", pid);

View File

@@ -57,7 +57,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
glibtop_proc_kernel *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
int count;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
@@ -71,7 +71,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
if (pid == 0) return;
/* Get the process information */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof(*pinfo), &count);
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);

View File

@@ -62,7 +62,7 @@ pid_t *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
gint64 real_which, gint64 arg)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
unsigned *pids = NULL;
int which, count;
int i,j;
@@ -74,7 +74,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
which = (int)(real_which & GLIBTOP_KERN_PROC_MASK);
/* Get the process data */
pinfo = kvm_getproc2 (server->machine.kd, which, arg,
pinfo = kvm_getprocs (server->machine.kd, which, arg,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count < 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (proclist)");

View File

@@ -74,7 +74,7 @@ glibtop_map_entry *
glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
struct vm_map_entry entry, *first;
struct vmspace vmspace;
struct vnode vnode;
@@ -95,7 +95,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
glibtop_suid_enter (server);
/* Get the process data */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc2), &count);
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc2), &count);
if ((pinfo == NULL) || (count < 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
return (glibtop_map_entry*) g_array_free(maps, TRUE);

View File

@@ -96,7 +96,7 @@ void
glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
int count;
@@ -111,7 +111,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
if (pid == 0) return;
/* Get the process data */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count < 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);

View File

@@ -49,7 +49,7 @@ glibtop_get_proc_signal_p (glibtop *server,
glibtop_proc_signal *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
int count = 0;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
@@ -60,7 +60,7 @@ glibtop_get_proc_signal_p (glibtop *server,
if (pid == 0) return;
/* Get the process information */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);

View File

@@ -51,7 +51,7 @@ glibtop_get_proc_state_p (glibtop *server,
glibtop_proc_state *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
int count = 0;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0);
@@ -62,7 +62,7 @@ glibtop_get_proc_state_p (glibtop *server,
if (pid == 0) return;
/* Get the process information */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);

View File

@@ -117,7 +117,7 @@ void
glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
int count;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0);
@@ -129,7 +129,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
/* Get the process information */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);

View File

@@ -54,7 +54,7 @@ void
glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
pid_t pid)
{
struct kinfo_proc2 *pinfo;
struct kinfo_proc *pinfo;
int count = 0;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
@@ -65,7 +65,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
if (pid == 0) return;
/* Get the process information */
pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid,
sizeof (*pinfo), &count);
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);