PolkitUnixProcess

## PolkitUnixProcess PolkitUnixProcess — Unix processs |

## Synopsis

                        PolkitUnixProcess;
    PolkitSubject *     polkit_unix_process_new             (gint pid);
    PolkitSubject *     polkit_unix_process_new_full        (gint pid,
                                                             guint64 start_time);
    gint                polkit_unix_process_get_pid         (PolkitUnixProcess *process);
    guint64             polkit_unix_process_get_start_time  (PolkitUnixProcess *process);
    void                polkit_unix_process_set_pid         (PolkitUnixProcess *process,
                                                             gint pid);
    gint                polkit_unix_process_get_owner       (PolkitUnixProcess *process,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----PolkitUnixProcess

## Implemented Interfaces

PolkitUnixProcess implements PolkitSubject.

## Properties

      "pid"                      gint                  : Read / Write / Construct
      "start-time"               guint64               : Read

## Description

An object for representing a UNIX process.

To uniquely identify processes, both the process id and the start time of the process (a monotonic increasing value representing the time since the kernel was started) is used.

## Details

### PolkitUnixProcess

    typedef struct _PolkitUnixProcess PolkitUnixProcess;

The PolkitUnixProcess struct should not be accessed directly.

### polkit_unix_process_new ()

    PolkitSubject *     polkit_unix_process_new             (gint pid);

Creates a new PolkitUnixProcess for `pid`. The start time of the process will be looked up in using e.g. the `/proc` filesystem depending on the platform in use.

`pid` : | The process id.
Returns : | A PolkitSubject. Free with `g_object_unref()`.

### polkit_unix_process_new_full ()

    PolkitSubject *     polkit_unix_process_new_full        (gint pid,
                                                             guint64 start_time);

Creates a new PolkitUnixProcess object for `pid` and `start_time`.

`pid` : | The process id.
`start_time` : | The start time for `pid`.
Returns : | A PolkitSubject. Free with `g_object_unref()`.

### polkit_unix_process_get_pid ()

    gint                polkit_unix_process_get_pid         (PolkitUnixProcess *process);

Gets the process id for `process`.

`process` : | A PolkitUnixProcess.
Returns : | The process id for `process`.

### polkit_unix_process_get_start_time ()

    guint64             polkit_unix_process_get_start_time  (PolkitUnixProcess *process);

Gets the start time of `process`.

`process` : | A PolkitUnixProcess.
Returns : | The start time of `process`.

### polkit_unix_process_set_pid ()

    void                polkit_unix_process_set_pid         (PolkitUnixProcess *process,
                                                             gint pid);

Sets `pid` for `process`.

`process` : | A PolkitUnixProcess.
`pid` : | A process id.

### polkit_unix_process_get_owner ()

    gint                polkit_unix_process_get_owner       (PolkitUnixProcess *process,
                                                             GError **error);

Gets the uid of the owner of `process`.

`process` : | A PolkitUnixProcess.
`error` : | Return location for error or `NULL`.
Returns : | The UNIX user id of the owner for `process` or 0 if `error` is set.

## Property Details

### The `"pid"` property

      "pid"                      gint                  : Read / Write / Construct

The UNIX process id.

Allowed values: >= G_MAXULONG

Default value: 0

### The `"start-time"` property

      "start-time"               guint64               : Read

The start time of the process.

Default value: 0