获取当前运行程序名称

char tBuf[1024] = {0};
int ret = readlink("/proc/self/exe" , tBuf , 1023) ;
char *p = strrchr(tBuf , '/');
printf("%s\n", ++p);

posted @ 2018-10-24 16:28  mingzhang  阅读(868)  评论(0编辑  收藏  举报