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 &
Ïà¹ØÎĵµ£º
linux ÊØ»¤½ø³Ì
1.´´½¨×Ó½ø³Ì£¬¸¸½ø³ÌÍ˳ö
ÊØ»¤½ø³ÌÊÇÍÑÀëÖն˵쬴ËʱµÄ×Ó½ø³ÌÓÉ1ºÅ½ø³ÌÁìÑø¡£
2.ÔÚ×Ó½ø³ÌÖд´½¨ÐµĻỰ
µ÷ÓÃsetsid£¨£©º¯Êý£¬×÷ÓÃÓÐÈý¸ö£¬Èýø³Ì°ÚÍÑԻỰµÄ¿ØÖÆ£»Èýø³Ì°ÚÍÑÔ½ø³Ì×éµÄ¿ØÖÆ£»
Èýø³Ì°ÚÍÑÔ¿ØÖÆÖն˵ĿØÖÆ
ÕâÀïÐèÒª½éÉܽø³Ì×éºÍ»á»°×éµÄ¸ÅÄî
½ø³Ì×飺ÊÇÒ»¸ö»ò¶à¸ö½ø³ÌµÄ¼¯ºÏ£¬Óɽ ......
ÒýÓÃhttp://www.icanwen.cn/article.asp?id=18
±»¼à¿ØÖ÷»úµÄ°²×°ÅäÖÃ
1.´´½¨ÕʺÅ
useradd nagios
passwd nagios
2.°²×°nagios²å¼þ
tar xvzf nagios-plugins-*.tar.gz
./configure
make && make install
chown nagios.nagios ......
ÕâÁ½Ìì¸ÕÄõ½¿ª·¢°å£¬ÒªÅäÖÃLINIXÏÂÃæµÄµÄ±àÒë»·¾³¡£ÅäÖÃNFS·þÎñÆ÷ºÍTFTP,ÔÚÍíÉÏÓкܶàºÃÐĵÄÈ˰Ñ×Ô¼ºÅäÖõĹý³Ì˵ÁËÒ»±é£¬µ«ÊÇÔÚʵ¼Ê²Ù×÷Öл¹ÊdzöÏֺܶàÎÊÌ⣬ÏÖÔÚ½«×Ô¼ºÕâÁ½ÌìµÄÅäÖùý³Ì×ܽáÈçÏ£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú£º
1¡¢NFS·þÎñ
1£©ÔÚ¿Í»§¶ËÖÐÊäÈësetup->Syst ......
±¾ÎÄת×Ô£ºhttp://www.cnblogs.com/blueoceanli/archive/2009/04/27/1444491.html
(ÐÞ¸Ä~/.vimrc,ûÓд´½¨Ö®)
set encoding=utf-8
syntax enable
syntax on
filetype on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set cindent
set autoindent
filetype plugin indent on
1.Alternate (http://www.vim ......
ln
[root@www ~]# ln [-sf] 來Ô´檔 Ä¿標檔
選項與參數£º
-s £ºÈç¹û²»¼ÓÈκÎ參數¾Í進ÐÐ連結£¬ÄǾÍÊÇhard link£¬ÖÁì¶ -s ¾ÍÊÇsymbolic link
-f £ºÈç¹û Ä¿標檔 ´æÔÚ時£¬¾ÍÖ÷動µÄ將Ä¿જ ......