Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux ²éÕÒÖ´ÐгÌÐòµÄµ±Ç°Â·¾¶

linux shell pwd ÏÔʾµ±Ç°Â·¾¶
¼ÙÈôÓÐtest.cpp
g++ test.cpp -o test
./test
ÏëÔÚtestÖÐÕÒµ½µ±Ç°Ö´ÐгÌÐòËùÔڵķ¾¶
¿ÉÒÔÔÙtest.cppÖÐʹÓÃreadlinkº¯Êý
¾ßÌå¼ûÈçÏÂʵÀý£º
#include<iostream>
#include<unistd.h>
#include<dirent.h>
#include<string.h>
#include<string>
using namespace std;
int main()
{
 char buff[1024];
 memset(buff,0,sizeof(buff));
 int n = readlink("/proc/self/exe",buff,1023);
 if(n<0)
 {
  cout<<"Get Path failed"<<endl;
  return -1;
 }
 string path = buff;
 int nLen = path.rfind('/');
 path.erase(nLen,path.length() - nLen);
 cout<<"zui zhong lu jing :"<<path<<endl;
 
 return 0;
}
½÷¼ÇÊÇ/proc/self/exe ÔÚ´ËijÈËÔØ¹ý¸úÍ·


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨ËÄ£© L2CAP²ã±à³Ì

£¨L2CAPЭÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPЭÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼­Á¬½Ó¿ØÖƺÍÊÊÅäЭÒé (L2CAP) ΪÉϲãЭÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àЭÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãЭÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......

linuxÈí¼þ¿ª·¢¹¤³Ìʦ½Ì³Ì

»áÔ±ÏÂÔØ£º­
­
http://vipdown.3800hk.com/jiaocheng/linux/linux/@LinkGate@12403487266409x1196776239x12403488007143-5740071909166dc778c8b9deb5c6b4cc@LK@/01.rar­
­
http://vipdown.3800hk.com/jiaocheng/linux/linux/@LinkGate@12403487266409x1196776239x12403488007143-177072d80fd416c4134c7 ......

linuxϵͳµ÷Óú¯Êý

ÓɲÙ×÷ϵͳʵÏÖµÄËùÓÐϵͳµ÷ÓÃËù¹¹³ÉµÄ¼¯ºÏ¼´³ÌÐò½Ó¿Ú»òÓ¦Óñà³Ì½Ó¿Ú(Application Programming Interface£¬API)¡£ÊÇÓ¦ÓóÌÐòͬϵͳ֮¼äµÄ½Ó¿Ú¡£
¡¡¡¡²Ù×÷ϵͳµÄÖ÷Òª¹¦ÄÜÊÇΪӦÓóÌÐòµÄÔËÐд´½¨Á¼ºÃµÄ»·¾³£¬ÎªÁË´ïµ½Õâ¸öÄ¿µÄ£¬ÄÚºËÌṩһϵÁо߱¸Ô¤¶¨¹¦ÄܵĵÄÄں˺¯Êý£¬Í¨¹ýÒ»×é³ÆÎªÏµÍ³µ÷Óõģ¨system call)µÄ½Ó¿Ú³ÊÏÖ¸øÓà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ