System Dependencies

System Dependencies — Various platform specific utility functions

Synopsis




polkit_uint64_t     polkit_sysdeps_get_start_time_for_pid
                                                        (pid_t pid);
int                 polkit_sysdeps_get_exe_for_pid      (pid_t pid,
                                                         char *out_buf,
                                                         size_t buf_size);

Description

Various platform specific utility functions.

Details

polkit_sysdeps_get_start_time_for_pid ()

polkit_uint64_t     polkit_sysdeps_get_start_time_for_pid
                                                        (pid_t pid);

Get when a process started.

pid :

process id

Returns :

start time for the process or 0 if an error occured and errno will be set

Since 0.7


polkit_sysdeps_get_exe_for_pid ()

int                 polkit_sysdeps_get_exe_for_pid      (pid_t pid,
                                                         char *out_buf,
                                                         size_t buf_size);

Get the name of the binary a given process was started from. Note that this is not reliable information; it should not be part of any security decision. If the information could not be obtained 0 is returned and out_buf will be set to "(unknown)".

pid :

process id

out_buf :

buffer to store the string representation in

buf_size :

size of buffer

Returns :

Number of characters written (not including trailing '\0'). If the output was truncated due to the buffer being too small, buf_size will be returned. Thus, a return value of buf_size or more indicates that the output was truncated (see snprintf(3)) or an error occured. If the name cannot be found, -1 will be returned.

Since 0.7