mirror of
https://github.com/proot-me/proot.git
synced 2025-08-28 16:43:49 +02:00
18 lines
315 B
C
18 lines
315 B
C
#include <unistd.h>
|
|
#include <limits.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
char path[PATH_MAX];
|
|
ssize_t status;
|
|
|
|
status = readlink("/proc/self/exe", path, PATH_MAX - 1);
|
|
if (status < 0 || status >= PATH_MAX)
|
|
exit(EXIT_FAILURE);
|
|
path[status] = '\0';
|
|
|
|
puts(path);
|
|
exit(EXIT_SUCCESS);
|
|
}
|