~ubuntu-branches/ubuntu/raring/python-psutil/raring-proposed

« back to all changes in this revision

Viewing changes to psutil/arch/bsd/process_info.c

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-03-10 23:27:55 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100310232755-rq8mx1chwh229e7w
Tags: 0.1.3-1
* New upstream release
* debian/control
  - bump Standards-Version to 3.8.4 (no changes needed)
* debian/rules
  - adjust tests list

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: process_info.c 355 2009-04-30 12:18:58Z g.rodola $
 
2
 * $Id: process_info.c 523 2010-02-27 17:15:23Z jloden $
3
3
 *
4
4
 * Helper functions related to fetching process information. Used by _psutil_bsd
5
5
 * module methods.
32
32
    int err;
33
33
    struct kinfo_proc * result;
34
34
    int done;
35
 
    static const int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 };
 
35
    static const int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PROC, 0 };
36
36
    // Declaring name as const requires us to cast it when passing it to
37
37
    // sysctl because the prototype doesn't include the const modifier.
38
38
    size_t              length;
140
140
    *pathsize = size;
141
141
    if (sysctl(mib, 4, path, &size, NULL, 0) == -1) {
142
142
        //perror("sysctl");
 
143
        free(path);
143
144
        return NULL;       /* Insufficient privileges */
144
145
    }
145
146
 
162
163
 */
163
164
char *getcmdargs(long pid, size_t *argsize)
164
165
{
165
 
    int mib[3];
 
166
    int mib[4];
166
167
    size_t size, argmax;
167
168
    char *procargs = NULL;
168
169