Linux²Ù×÷ϵͳϵĶàÏ̱߳à³ÌÏêϸ½âÎö£¨3£©
3¡¢Ï̱߳êʶ
º¯ÊýÔÐÍ£º
#include <pthread.h>
pthread_t pthread_self(void);
pid_t getpid(void);
getpid()ÓÃÀ´È¡µÃÄ¿Ç°½ø³ÌµÄ½ø³Ìʶ±ðÂë,º¯Êý˵Ã÷
Àý³Ì8
³ÌÐòÄ¿µÄ£ºÊµÏÖÔÚн¨Á¢µÄÏß³ÌÖдòÓ¡¸ÃÏ̵߳ÄidºÍ½ø³Ìid
³ÌÐòÃû³Æ£ºpthread_id.c
/********************************************************************************************
** Name:pthread_id.c
** Used to study the multithread programming in Linux OS.
** Showing how to get the thread's tid and the process's pid.
** Author:zeickey
** Date:2006/9/16
** Copyright (c) 2006,All Rights Reserved!
*********************************************************************************************/
#include <stdio.h>
#include <pthread.h>
#include <unistd.h> /*getpid()*/
void *create(void *arg)
{
printf("New thread .... \n");
printf("This thread's id is %u \n", (unsigned int)pthread_self());
printf("The process pid is %d \n",getpid());
return (void *)0;
}
int main(int argc,char *argv[])
{
pthread_t tid;
int error;
printf("Main thread is starting ... \n");
error = pthread_create(&tid, NULL, create, NULL);
if(error)
{
printf("thread is not created ... \n");
return -1;
}
printf("The main process's pid is %d \n",getpid());
sleep(1);
return 0;
}
±àÒë·½·¨£º
gcc -Wall -lpthread pthread_id.c
Ö´Ðнá¹û£º
Ma
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
linuxÏÂĬÈÏÖ»ÄܽâѹzipѹËõÎļþ£¬¶ørarÎļþĬÈÏûÓнâѹ֧³ÖµÄ¹¤¾ß£¬ÕâÀïÌṩһ¸ö¼òµ¥µÄ·½Ê½£¬°²×°rar¹¤¾ß£¬Ö§³ÖlinuxϽâѹrarÎļþ¡£
1£ºÊ×ÏÈÏÂÔØrar½âѹ¹¤¾ß£¬ÕâÀïÓà rarlinux-3.6.b6.tar.gz£¬¸ø³öÒ»¸öÍøÓÑÌṩµÄ°æ±¾ÏÂÔصØÖ·£º
http://blogimg.chinaunix.net/blog/upfile2/080226173046.gz
2£º½ÓÏÂÀ´Ö´ÐÐÈçϲÙ×÷
t ......
LinuxµÄÍøÂçϵͳÖ÷ÒªÊÇ»ùÓÚBSD Unix µÄsocket»úÖÆ£¬ ·ÃÎÊÍøÂçÉ豸µÄÇý¶¯³ÌÐò²»ÐèҪʹÓÃÉ豸½Úµã¡£ÔÚϵͳºÍÇý¶¯³ÌÐòÖ®¼ä¶¨ÒåÓÐרÃŵÄÊý¾Ý½á¹¹£¨sk_buff£©½øÐÐÊý¾ÝµÄ´«µÝ¡£ÏµÍ³ÄÚ²¿Ö§³Ö¶Ô·¢ËÍÊý¾ÝºÍ½ÓÊÕÊý¾ÝµÄ»º´æ£¬ÌṩÁ÷Á¿¿ØÖÆ»úÖÆ£¬Ìṩ¶Ô¶àÐÒéµÄÖ§³Ö¡£Òò´Ë£¬Ñ¡ÔñÄĸöÇý¶¯³ÌÐòÊÇ»ùÓÚÄÚºËÄÚ²¿µÄÆäËû¾ö¶¨£¬¶ø²»Êǵ÷ÓÃopen() ......
ÒÔÏÂÊÇÎҵIJâÊÔociµÄÀý×Ó£¡
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "oci.h"
static OCIServer *srvhp;
static OCISession *p_session;
static OCIEnv &nb ......
2¡¢Ï̵߳ÄÖÕÖ¹
Èç¹û½ø³ÌÖÐÈκÎÒ»¸öÏß³ÌÖе÷ÓÃexit£¬_Exit,»òÕßÊÇ_exit£¬ÄÇôÕû¸ö½ø³Ì¾Í»áÖÕÖ¹£¬
Óë´ËÀàËÆ£¬Èç¹ûÐźŵÄĬÈϵĶ¯×÷ÊÇÖÕÖ¹½ø³Ì£¬ÄÇô£¬°Ñ¸ÃÐźŷ¢Ë͵½Ï̻߳áÖÕÖ¹½ø³Ì¡£
Ï̵߳ÄÕý³£Í˳öµÄ·½Ê½£º
(1) Ïß³Ì ......