From 9c202a496e75903fe37e5c19cb97c98eba6e35f2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 22 Aug 2025 23:28:25 +0900 Subject: chore: move *.c and *.h files to src/ --- sys.c | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 sys.c (limited to 'sys.c') diff --git a/sys.c b/sys.c deleted file mode 100644 index aa7b13d..0000000 --- a/sys.c +++ /dev/null @@ -1,15 +0,0 @@ -char* get_self_path() { - char* buf = calloc(PATH_MAX, sizeof(char)); - ssize_t len = readlink("/proc/self/exe", buf, PATH_MAX - 1); - if (len == -1 || len == PATH_MAX - 1) { - return NULL; - } - buf[len] = '\0'; - return buf; -} - -// It returns a path not including final / except for root directory. -char* get_self_dir() { - char* path = get_self_path(); - return dirname(path); -} -- cgit v1.2.3-70-g09d2