Gio.Credentials.prototype.get_unix_pid

function get_unix_pid(): Number(gint) {
    // Gjs wrapper for g_credentials_get_unix_pid()
}
  

Tries to get the UNIX process identifier from credentials. This method is only available on UNIX platforms.

This operation can fail if Gio.Credentials is not supported on the OS or if the native credentials type does not contain information about the UNIX process ID.

Since 2.36

Returns

The UNIX process ID, or -1 if @error is set.