Project

Profile

Help

Support #2176 » test.c

O'Neil Delpratt, 2014-12-16 12:00

 
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>

int main(int argc, char** argv) {
char buf[500];
int r = readlink("/proc/self/exe", buf, 500);
if (r == -1) {
printf("Error! error = %s\n", strerror(errno));
} else {
buf[r] = 0;
printf("Ok! buf = %s\n", buf);
}

return 0;
}
(2-2/2)