Linux ϵĴíÎó error.h
errno
ÊǸöint±äÁ¿£¬·µ»Ø´íÎó
ÓдíÎóʱʹÓ÷½·¨
fprintf(fp, "%s", strerror(errno))
perrorÓ÷¨
#include <stdio.h>
#include <stdlib.h>
#include<errno.h>
int main(void)
{
FILE *fp;
if((fp=fopen("aaa.txt","r+"))==NULL)
{
puts("²»ÄܽøÈëÎļþ");
perror("ÔÒò");
printf("errno=%d\n",errno);
exit(1);
}
system("PAUSE");
return 0;
}
fopen·µ»ØNULLÒòΪûÓÐÎļþ
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES &
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
linux ÊØ»¤½ø³Ì
1.´´½¨×Ó½ø³Ì£¬¸¸½ø³ÌÍ˳ö
ÊØ»¤½ø³ÌÊÇÍÑÀëÖն˵ģ¬´ËʱµÄ×Ó½ø³ÌÓÉ1ºÅ½ø³ÌÁìÑø¡£
2.ÔÚ×Ó½ø³ÌÖд´½¨ÐµĻỰ
µ÷ÓÃsetsid£¨£©º¯Êý£¬×÷ÓÃÓÐÈý¸ö£¬Èýø³Ì°ÚÍÑԻỰµÄ¿ØÖÆ£»Èýø³Ì°ÚÍÑÔ½ø³Ì×éµÄ¿ØÖÆ£»
Èýø³Ì°ÚÍÑÔ¿ØÖÆÖն˵ĿØÖÆ
ÕâÀïÐèÒª½éÉܽø³Ì×éºÍ»á»°×éµÄ¸ÅÄî
½ø³Ì×飺ÊÇÒ»¸ö»ò¶à¸ö½ø³ÌµÄ¼¯ºÏ£¬Óɽ ......
Óà GDB µ÷ÊÔ³ÌÐò
GDB ¸ÅÊö
————
GDB ÊÇ GNU ¿ªÔ´×éÖ¯·¢²¼µÄÒ»¸öÇ¿´óµÄ UNIX ϵijÌÐòµ÷ÊÔ¹¤¾ß¡£»òÐí£¬¸÷λ±È½Ïϲ»¶ÄÇÖÖͼÐνçÃ淽ʽµÄ£¬Ïñ VC ¡¢ BCB µÈ IDE µÄµ÷ÊÔ£¬µ«Èç¹ûÄãÊÇÔÚ UNIX ƽ̨ÏÂ×öÈí¼þ£¬Äã»á·¢ÏÖ GDB Õâ¸öµ÷ÊÔ¹¤¾ßÓÐ±È VC ¡¢ BCB µÄͼÐλ¯µ÷ÊÔÆ÷¸üÇ¿´óµÄ¹¦ÄÜ¡£Ëùν “ ´çÓÐË ......