introspection_get_process_name()
Get the name of a process
Synopsis:
#include <sys/introspection.h>
int introspection_get_process_name( pid64_t pid64,
char * buffer,
size_t bsize );
Arguments:
- pid64
- The PID (pid_t) or unique PID (pid64_t) of the target process.
- buffer
- The location to store the data.
- bsize
- The size of the buffer.
Library:
libintrospection
Use the -l introspection option to qcc to link against this library.
Description:
The introspection_get_process_name() function gets the name of a
process (i.e., the path to the started binary, without resolving symbolic links and
excluding the leading "/").
Returns:
The length of the process name excluding the terminator, on success. If an error occurs, the function returns the negative of a value from the Errors section.
Errors:
- EFAULT
- Error accessing the output buffer.
- ESRCH
- The PID is invalid.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Signal handler | Yes |
| Thread | Yes |
Page updated:
