linux¶àÏ̱߳à³Ì Ïà¹Ø¸ÅÄî
ѧϰLinux¶à½ø³Ì±à³Ì
Ò»¡¢½ø³ÌµÄ¶¨Ò壺³ÌÐòÖ´ÐкÍ×ÊÔ´¹ÜÀíµÄ×îСµ¥Î»¡£
¶þ¡¢½ø³Ì¿ØÖÆ£º
£¨1£©½ø³Ì±êʶ£º ½ø³Ì±êʶ ×Ó½ø³ÌºÅ ¸¸½ø³ÌºÅ
Í·Îļþ #include<unistd.h> #include<unistd.h>
º¯Êý¹¦ÄÜ È¡µÃµ±Ç°½ø³ÌµÄ½ø³ÌºÅ È¡µÃµ±Ç°½ø³ÌµÄ¸¸½ø³ÌºÅ
º¯ÊýÔÐÍ Pid_t getpid(void) Pid_t getppid(void)
º¯Êý·µ»ØÖµ ³É¹¦·µ»Ø½ø³ÌµÄ½ø³Ì±êʶ·û ³É¹¦·µ»Ø¸¸½ø³ÌµÄ½ø³Ì±êʶ·û
×¢£ºPid_tÆäʵÊÇÒ»¸ötypedefÀàÐÍ£¬Ï൱ÓÚunsigned int.
Àý£º
#include<stdio.h>
#include<unistd.h>
int main()
{
printf("ϵͳ·ÖÅäµÄ½ø³ÌºÅÊÇ£º%d\n",getpid());
printf("ϵͳ·ÖÅäµÄ¸¸½ø³ÌºÅÊÇ£º%d\n",getppid());
return 0;
}
£¨2£©½ø³ÌµÄ´´½¨£º
1)exec×庯Êý£º
Í·Îļþ #include<unistd.h>
ÔÐÍ
int execl(const chat *path,const char *args,...)
int execv(const char *path,char const *argv[])
int execle(const cahr *path,const char *arg,...,char *const envp[])
int execve(const char *path,char *const argv[],char *const envp[])
int execlp(const char *file,char *arg,...)
int execvp(const cahr *file,char *const argv[])
·µ»Ø ·µ»Ø-1±íʾ³ö´í
ÓÉÓڱȽ϶࣬ÔÚ´ËÖ»¾ÙÀýexecveº¯Êý£º
#include<stdio.h>
#include<unistd>
int main()
{
char *args[]={"/usr/bin/vim",NULL};
printf("ϵͳ·ÖÅäµÄ½ø³ÌºÅÊÇ£º%d\n",getpid());
if(execve("/usr/bin/vim",args,NULL)<0)
perror("´´½¨½ø³Ì³ö´í£¡");
return 0;
}
×¢:ÔÚÓÃexecveº¯Êý´´½¨Ð½ø³ÌµÄºó£¬»áÒÔеijÌÐòÈ¡´úÔÀ´µÄ½ø³Ì£¬È»ºóϵͳ»á´ÓеĽø³ÌÔËÐУ¬µ«ÊÇеĽø³ÌµÄPIDÖµ»áÓëÔÀ´½ø³ÌµÄPIDÖµÏàͬ.
2)system()º¯Êý
Í·Îļþ #include<stdlib.h>
¹¦ÄÜ ÔÚ½ø³ÌÖпªÊ¼ÁíÒ»¸ö½ø³Ì
ÔÐÍ int system(const char *string)
´«ÈëÖµ ϵͳ±äÁ¿
·µ»ØÖµ
³É¹¦Ôò·µ»ØÖ´ÐÐshellÃüÁîºóµÄ·µ»ØÖµ£¬µ÷ÓÃ/bin/shÊý°Ù·µ»Ø127£¬ÆäËû
ʧ°Ü·µ»Ø£1£¬ÈýÊåstringΪ¿Õ·µ»Ø·ÇÁãÖµ
Àý£º
#include<stdio.h>
#include<stdlib.h>
main()
{
int newret;
printf("ϵͳ·ÖÅ
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
linuxÏß³Ì(pthread)±à³ÌÖеÄsegmentation fault£¡£¡
Posted on ÐÇÆÚÎå, 3ÔÂ 27th, 2009 at 10:28 ÏÂÎç
Ô´ÎÄÀ´×Ôhttp://www.isongzi.com/2009/03/27/pthread-segmentation-fault/
¼Ìsocket bad addres ´íÎóÖ®ºó£¬ÔÚ´´½¨Ï̡߳¾pthread_create()¡¿µÄʱºòÓÖ³öÏÖÁË segmentation fault¡£
´íÎóÓï¾äÈçÏ£º
pthread_create(& ......
×î½üÒ»Ö±¿àÐÄÑо¿»ùÓÚÍøÂç¹ÜÀí·½ÃæµÄÓ¦Óã¬Ñ¸À×µÈÏÂÔØÈí¼þ¸øûÓи߶ËÉ豸µÄÍøÂç´øÀ´ÁËÂé·³¡£¹«Ë¾µÄCISCO 2811 ²»ÄÜÓÃÀ´×öÁ÷¿Ø£¬ºóÀ´ÔÚWINDOWS Óò¿ØÉÏ×öÁËÒ»¸öÁ÷¿Ø£¬µ«ÊÇÐèÒª¹Ø±Õ¾ÖÓòÍøÖмÆËã»úµÄ¶Ë¿Ú£¨³ýÆóÒµÓ¦ÓÃÖ®ÍâµÄ£©£¬ºóÀ´ÓÃËû×ö·À»ðǽ¶¼×½½ó¼ûÖ⣬ÈÃÈËʵÔÚÊÇÎÞ·¨ÈÌÊÜ£¬³ýÁËÒ»¸ö ......
ÎÒµÄORACLE RAC INSTALL for LINUX 10.2Ñо¿
ÎÒµÄORACLE RAC INSTALL for LINUX 10.2Ñо¿
1¡¢´´½¨ÐéÄâ»ú
DB1ÐéÄâ»úÎļþĿ¼ g:\vmtest1 Îļþ´óС8G ÄÚ´æ944M£¨ÔÁÂÎÒÖ»ÓÐ2GRAM)
DB2ÐéÄâ»úÎļþĿ¼ E:\vmtest2 Îļþ´óС8G ÄÚ´æ944M
ÔÚDB1ÉÏ´´½¨¹²Ïí´ÅÅÌ£¬
E:\SHARE Îļþ´óС8G
DB2Ò²´´½¨´ÅÅÌ£¬ ......