函数名:ReadLink()
函数功能:获取当前进程的程序名
函数实现:
1 string ReadLink(){ 2 char name[100]; 3 int rval = readlink("/proc/self/exe",name,sizeof(name)-1); 4 if(rval == -1){ 5 cout << "readlink error" << endl; 6 } 7 name[rval] = '
函数名:ReadLink()
函数功能:获取当前进程的程序名
函数实现:
1 string ReadLink(){ 2 char name[100]; 3 int rval = readlink("/proc/self/exe",name,sizeof(name)-1); 4 if(rval == -1){ 5 cout << "readlink error" << endl; 6 } 7 name[rval] = '