Graphviz 13.0.0~dev.20250121.0651
Loading...
Searching...
No Matches
gv_find_me.c File Reference
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <util/gv_find_me.h>
#include <unistd.h>
Include dependency graph for gv_find_me.c:

Go to the source code of this file.

Functions

static char * readln (const char *path)
 readlink-alike but dynamically allocates
 
char * gv_find_me (void)
 

Function Documentation

◆ gv_find_me()

char * gv_find_me ( void  )

find an absolute path to the current executable

The caller is responsible for freeing the returned pointer.

It is assumed the containing executable is an on-disk file. If it is an in-memory executable with no actual path, results are undefined.

Returns
An absolute path to the containing executable on success or NULL on failure

Definition at line 65 of file gv_find_me.c.

References free(), NULL, and readln().

Referenced by find_me(), and find_share().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readln()

static char * readln ( const char *  path)
static

Definition at line 26 of file gv_find_me.c.

References free(), and NULL.

Referenced by gv_find_me().

Here is the call graph for this function:
Here is the caller graph for this function: