Code

utils os: Add sdb_realpath().
[sysdb.git] / src / include / utils / os.h
index f4decde0f4b6312692c238d7d8cff2dc87165d36..42fdea3dad5e99872dc0eac03bc68cf3caa8a4e4 100644 (file)
@@ -47,6 +47,22 @@ extern "C" {
 char *
 sdb_get_homedir(void);
 
+/*
+ * sdb_realpath:
+ * Returns the canonicalized absolute pathname for the specified path. The
+ * function expands all symbolic links and resolves references to '.', '..',
+ * and extra slash characters (/).
+ *
+ * '~/' at the start of the string will be replaced by the current user's home
+ * directory.
+ *
+ * Returns:
+ *  - the canonicalized absolute pathname on success
+ *  - NULL else
+ */
+char *
+sdb_realpath(const char *path);
+
 /*
  * sysdb_mkdir_all:
  * Recursively create the directory 'pathname' (similar to 'mkdir -p' on the