rcutils  master
C API providing common utilities and data structures.
Functions
process.h File Reference
#include "rcutils/allocator.h"
#include "rcutils/macros.h"
#include "rcutils/visibility_control.h"
Include dependency graph for process.h:

Go to the source code of this file.

Functions

int rcutils_get_pid (void)
 Retrieve the current process ID. More...
 
char * rcutils_get_executable_name (rcutils_allocator_t allocator)
 Retrieve the current executable name. More...
 

Function Documentation

◆ rcutils_get_pid()

int rcutils_get_pid ( void  )

Retrieve the current process ID.

This function returns the current process ID, and is always successful.

This function is thread-safe.

Returns
The current process ID.

◆ rcutils_get_executable_name()

char* rcutils_get_executable_name ( rcutils_allocator_t  allocator)

Retrieve the current executable name.

This function portably retrieves the current program name and returns a copy of it. It is up to the caller to free the memory.

This function is thread-safe.

Parameters
[in]allocatorthe allocator to use
Returns
The program name on success, or
NULL on failure.