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

LinuxÖÐerrnoʹÓÃ

µ±linuxÖеÄC apiº¯Êý·¢ÉúÒ쳣ʱ,Ò»°ã»á½«errno±äÁ¿(Ðèinclude
errno.h)¸³Ò»¸öÕûÊýÖµ,²»Í¬µÄÖµ±íʾ²»Í¬µÄº¬Òå,¿ÉÒÔͨ¹ý²é¿´¸ÃÖµÍƲâ³ö´íµÄÔ­Òò£¬ÔÚʵ¼Ê±à³ÌÖÐÓÃÕâÒ»Õнâ¾öÁ˲»ÉÙÔ­±¾¿´À´ÄªÃûÆäÃîµÄÎÊÌâ¡£µ«ÊÇ
errnoÊÇÒ»¸öÊý×Ö£¬´ú±íµÄ¾ßÌ庬Ò廹Ҫµ½errno.hÖÐÈ¥ÔĶÁºê¶¨Ò壬¶øÿ´Î²éÔÄÊÇÒ»¼þºÜ·±ËöµÄÊÂÇé¡£ÓÐÏÂÃ漸ÖÖ·½·¨¿ÉÒÔ·½±ãµÄµÃµ½´íÎóÐÅÏ¢
(1)void perror(const char *s)
º¯Êý˵Ã÷
perror ( )ÓÃÀ´½«ÉÏÒ»¸öº¯Êý·¢Éú´íÎóµÄÔ­ÒòÊä³öµ½±ê×¼´íÎó(stderr),²ÎÊýs ËùÖ¸µÄ×Ö·û´®»áÏÈ´òÓ¡³ö,ºóÃæÔÙ¼ÓÉÏ´íÎóÔ­Òò ×Ö·û´®¡£´Ë´íÎóÔ­ÒòÒÀÕÕÈ«¾Ö±äÁ¿ errno µÄÖµÀ´¾ö¶¨ÒªÊä³öµÄ×Ö·û´®¡£
(2) char *strerror(int errno)
½«´íÎó´úÂëת»»Îª×Ö·û´®´íÎóÐÅÏ¢,¿ÉÒÔ½«¸Ã×Ö·û´®ºÍÆäËüµÄÐÅÏ¢×éºÏÊä³öµ½Óû§½çÃæÀýÈç
fprintf(stderr,"error in CreateProcess %s, Process ID %d ",strerror(errno),processID)
×¢£º¼ÙÉèprocessIDÊÇÒ»¸öÒѾ­»ñÈ¡Á˵ÄÕûÐÎID
(3)printf("%m", errno);
ÁíÍâ²»ÊÇËùÓеĵط½·¢Éú´íÎóµÄʱºò¶¼¿ÉÒÔͨ¹ýerror»ñÈ¡´íÎó´úÂ룬ÀýÈçÏÂÃæµÄ´úÂë¶Î
/*×¢£ºÏÂÃæµÄÍ·ÎļþʹÓÃ""¶øûÓÐÖ±½ÓʹÓüâÀ¨ºÅÊÇÒòΪ²©¿Í´ó°ÍÖмâÀ¨ºÅµ±×÷html·ûºÅ£¬ËùÒÔÆäÄÚ²¿µÄÍ·ÎļþÃû×ֻᱻֱ½ÓºöÂÔ*/
#include"stdio.h"
#include "stdlib.h"
#include "errno.h"
#include "netdb.h"
#include "sys/types.h"
#include "netinet/in.h"
int main (int argc, char *argv[])
{
struct hostent *h;
if (argc != 2)
{
fprintf (stderr ,"usage: getip address\n");
exit(1);
}
/* È¡µÃÖ÷»úÐÅÏ¢ */
if((h=gethostbyname(argv[1])) == NULL)
{
/* Èç¹ûgethostbyname ʧ°Ü£¬Ôò¸ø³ö´íÎóÐÅÏ¢ */
herror(“gethostbyname”);
exit(1);
}
/* ÁÐÓ¡³ÌÐòÈ¡µÃµÄÐÅÏ¢ */
printf(“Host name : %s\n”, h->h_name);
printf(“IP Address : %s\n”, inet_ntoa (*((struct in_addr *)h->h_addr))£©;
return 0;
}
/*************************************/
ͨ¹ýÉÏÃæµÄ´úÂë¿ÉÒÔ¿´µ½£ºÊ¹ÓÃgethostbyname()º¯Êý£¬Äã²»ÄÜʹÓÃperror()À´Êä³ö´íÎóÐÅÏ¢£¨ÒòΪ´íÎó´úÂë´æ´¢ÔÚ h_errno Öжø²»ÊÇerrno ÖС£ËùÒÔ£¬ÄãÐèÒªµ÷ÓÃherror()º¯Êý¡£
Äã
¼òµ¥µÄ´«¸øgethostbyname() Ò»¸ö»úÆ÷Ãû£¨&ldq


Ïà¹ØÎĵµ£º

LinuxÄÚºËÅäÖÃÎĵµ(make menuconfig)

Ò»¡¢ÒýÑÔ£º
    ±¾ÎĵµµÄÄÚÈݴ󲿷ÝÄÚÈݶ¼ÊÇ´ÓÍøÉÏÊÕ¼¯¶øÀ´£¬È»ºóÅäºÏһЩеĽØͼ£¨Äں˰汾£ºV2.4.19£©¡£ÔÚÿһÅäÖÃÏîºó»áÓÐÒ»¸öÑ¡ÔñÖ¸ÄϵIJ¿·Ý£¬ÓÃÀ´Ö¸µ¼´ó¼ÒÔõôÑù¸ù¾Ý×Ô¼ºµÄÇé¿öÀ´×öÏàÓ¦µÄÑ¡Ôñ£»»¹ÓÐÔÚÿһ¸ö´óÏîºÍÎĵµµÄ×îºó»áÓÐÒ»¸ö¾­Ñé̸£¬ËüÊÇһЩ¸ßÊÖÃÇÔÚÓ¦¶ÔÎÊÌâºÍ´¦ÀíÌØÓÐÓ²¼þʱµÄһЩ¾­Ñ飨Õâ¸ö»¹µ ......

linuxѧϰ֮ubuntuµÄ°ü¹ÜÀí


Ô­ÎĵØÖ·£ºhttp://www.ibm.com/developerworks/cn/linux/l-lpic1-v3-102-4/index.html?ca=drs-
Ian
Shields
, ×ÊÉî³ÌÐòÔ±, IBM
Ian Shields ²ÎÓë developerWorks
Linux רÇøµÄÐí¶à Linux ÏîÄ¿¡£ËûÊÇ IBM ±±¿¨ÂÞÀ´ÄÉÖÝ Research Triangle Park µÄÒ»Ãû¸ß¼¶³ÌÐòÔ±¡£ËûÓÚ
1973 Äê×÷ΪһÃûϵͳ¹¤³Ìʦ¼ÓÈë IBM λÓÚ°Ä´ ......

linux½âѹtarÃüÁî


linux½âѹ tarÃüÁî
tarÃüÁî
tar [-cxtzjvfpPN] ÎļþÓëĿ¼ ....

²ÎÊý£º
-c £º½¨Á¢Ò»¸öѹËõÎļþµÄ²ÎÊýÖ¸Áî(create µÄÒâ˼)£»
-x
£º½â¿ªÒ»¸öѹËõÎļþµÄ²ÎÊýÖ¸Á
-t £º²é¿´ tarfile ÀïÃæµÄÎļþ£¡
Ìرð×¢Ò⣬ÔÚ²ÎÊýµÄÏ´ïÖУ¬ c/x/t ½öÄÜ´æÔÚÒ»¸ö£¡²»¿Éͬʱ´æÔÚ£¡
ÒòΪ²»¿ÉÄÜͬʱѹËõÓë½âѹËõ¡£
-z £ºÊ ......

linux oracleËõС»Ø¹ö±í¿Õ¼ä´óСundotbs01.dbf


http://hi.baidu.com/lu_xinzhong/blog/item/4ff92b1725dec505c83d6d09.html
»Ø¹ö±í¿Õ¼ä´óС
-- ´´½¨Ò»¸öеÄС¿Õ¼äµÄUNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- ÉèÖÃеıí¿Õ¼äΪϵͳUNDO_TABLESPACE
Alter SYSTE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ