Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Ϲ²ÏíÄÚ´æ(shm)ʹÓÃʾÀý

#include <sys/ipc.h>
#include <stdio.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#define PERM IPC_CREAT //S_IRUSR|S_IWUSR
#include <errno.h>
int main(int argc,char **argv)
{
int shmid[2048];
c ......

SuSE Linux10ÉÏ°²×°OracleÊý¾Ý¿â

ϵͳҪÇó£º
¡¡¡¡Äڴ棺ÍƼö1G
¡¡¡¡Swap·ÖÇø£ºÉèΪÄÚ´æµÄ2±¶
¡¡¡¡/tmp´ÅÅ̿ռ䣺400MBÒÔÉÏÈý
¡¡¡¡´ÅÅ̿ռ䣺Èí¼þ3.5G Êý¾Ý1.2G
¡¡¡¡ËùÐèÈí¼þ£º
¡¡¡¡SuSE Linux10 for x86
¡¡¡¡Oracle database 10gR2 for Linux32
¡¡¡¡Orarun-1.8-109.15.i586.rpmÈí¼þ°ü£¬¿ÉÒÔ´Óhttp://Ftp.novell.com/partners/Oracle/sels-9ÏÂÔØ
&n ......

LinuxÖÐ ¾²Ì¬¿âºÍ¹²Ïí¿â

1£® ´´½¨Ä¿Â¼
 mkdir –p test/sub
2£® ÔÚ×ÓĿ¼sub/ϱàдhello.cºÍhello.h
 /*****hello.c*****/
 #include <stdio.h>
 #include “hello.h”
 void hello()
 {
 printf(“Hello!\n”);
 }
 
 /*****hello.h**** ......

linux»·¾³±äÁ¿²Ù×÷


ÔÚlinuxϵͳÏ£¬Èç¹ûÄãÏÂÔز¢°²×°ÁËÓ¦ÓóÌÐò£¬ºÜÓпÉÄÜÔÚ¼üÈëËüµÄÃû³Æʱ³öÏÖ“command not found”µÄÌáʾÄÚÈÝ¡£Èç¹ûÿ´Î¶¼µ½°²×°Ä¿±êÎļþ¼ÐÄÚ£¬ÕÒµ½¿ÉÖ´ÐÐÎļþÀ´½øÐвÙ×÷¾ÍÌ«·±ËöÁË¡£ÕâÉæ¼°µ½»·¾³±äÁ¿PATHµÄÉèÖÃÎÊÌ⣬¶øPATHµÄÉèÖÃÒ²ÊÇÔÚlinux϶¨ÖÆ»·¾³±äÁ¿µÄÒ»¸ö×é³É²¿·Ö¡£±¾ÎÄ»ùÓÚRedHat 9.0£¬Ïêϸ½²½âÁË»·¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ