|
发表于 2003-8-4 18:09:20
|
显示全部楼层
[code:1]
#include <stdio.h>
#include <dirent.h>
main()
{
char exePath[NAME_MAX+1];
char fullPath[NAME_MAX+1];
sprintf(exePath,"/proc/%d/exe",getpid());
readlink(exePath,fullPath,NAME_MAX);
printf("%s\n",fullPath);
getchar();
}
[/code:1] |
|