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

linuxÏÂͳ¼ÆÊ±¼äÀà

class CTimeTickCount
{
public:
CTimeTickCount(int threadIndex, int id )
{
struct timezone tz;
gettimeofday(&m_tvStartTime, &tz);
// m_tmStartTime = ACE_OS::gettimeofday();
m_iThreadIndex = threadIndex;
m_iID = id;
}

~CTimeTickCount()
{
struct timezone tz;
struct timeval tv;
gettimeofday(&tv, &tz);

// ACE_Time_Value currTime = ACE_OS::gettimeofday();
long cost = (tv.tv_sec - m_tvStartTime.tv_sec) * 1000 * 1000;
cost += (tv.tv_usec - m_tvStartTime.tv_usec );

if(cost >= 100 * 1000 )
{
//NVS_DEBUG((NVS_LM_ERROR, "====thread no: %d, cost time: %dms, id: %d.",
// m_iThreadIndex, cost, m_iID));
printf( "====thread no: %d, cost time: %dms, id: %d.\n", m_iThreadIndex, cost, m_iID));
}
}

private:
struct timeval m_tvStartTime; // ACE_Time_Value m_tmStartTime; // ¿ªÊ¼Ê±¼ä
int m_iThreadIndex; // Ï̺߳Å
int m_iID; // ±êʾ
};


Ïà¹ØÎĵµ£º

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

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

linux³ÌÐòÔ±ÃæÊÔÌâÄ¿


Ò»£®Ìî¿ÕÌ⣺
1. ÔÚLinuxϵͳÖУ¬ÒÔÎļþ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ/etc/fstabÖжÁȡҪ¼ÓÔØµÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓÃi½ÚµãÀ´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ºÍ´æ´¢¿éÊý¾Ý¡£
5. Á´½Ó·ÖΪ£ºÓ²Á´½Ó ºÍ ·ûºÅÁ´½Ó¡£
6. ³¬¼¶¿é°üº¬ÁËi½Úµã±í ......

Linux ¾²Ì¬Ó붯̬Á´½Ó¿â

ÎÄÕÂѡȡµÄÀý×ӷdz£¼òµ¥£¬ÉÏÊÖÈÝÒ×£¬Ö»ÊÇΪÁ˽²Êö¾²Ì¬Ó붯̬Á´½Ó¿âµÄÉú³ÉºÍÁ´½Ó¹ý
    ³Ì£¬»¹ÓÐËûÃÇÖ®¼äµÄÇø±ð¡£ÒÔÏÂÀý×ÓÔÚ gcc 4.1.1 ÏÂ˳Àûͨ¹ý¡£ 
ÎļþÔ¤ÀÀ
ÎļþĿ¼Ê÷ÈçÏ£¬ÈçÄãËù¼û£¬·Ç³£¼òµ¥¡£
libtest/  
|-- lt.c  
|-- lt.h  
`-- test. ......

linuxÏÂudp¿Í»§¶ËÔ´ÂëʾÀý

#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <s ......

linuxÏ´óÎļþ¶ÁдԴÂëʾÀý

#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
int main()
{
printf("sizeof(off_t) = %d\n", sizeof(off_t));
int ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ