linux ÏÔʽµ÷Óà ×Ô¼ºÐ´µÄ¶¯Ì¬¿â
~/test
|
|
|------main.c
|------lib
| |
| |------StringLen.h
| |------Strlen.c
| |------Strnlen.c
----------------StringLen.h:
#ifndef _STRINGLEN_H__
#define _STRINGLEN_H__
int Strlen(char *pStr);
int StrNlen(char *pStr, unsigned long ulMaxLen);
#endif
-------------------------------------------------
---------------Strlen.c:
#include<stdio.h>
#include<assert.h>
#include "StringLen.h"
int Strlen(char *pStr)
{
unsigned long ulLength;
assert(NULL != pStr);
ulLength = 0;
while(*pStr++)
{
ulLength++;
}
return ulLength;
}
-------------------------------------------------
---------------Strnlen.c:
#include<stdio.h>
#include<assert.h>
#include "StringLen.h"
int StrNlen(char *pStr, unsigned long ulMaxLen)
{
unsigned long ulLength;
assert(NULL != pStr);
if(ulMaxLen <= 0)
{
printf("Wrong Max Length!\n");
return -1;
} &
Ïà¹ØÎĵµ£º
¡ð
¡¢ËµÃ÷
±Ê¼ÇÊÊÓÃÓÚ
Linux
µÄ
2.6.10
ÒÔºóµÄÄںˡ£
±Ê¼ÇÒÔ
Linux
Device
Driver3
ÌṩµÄ
scull
³ÌÐò
(scull
Ŀ¼ÖеÄ
main.c
ºÍ
scull.h)
Ϊ¼Ç¼Ö÷Ïߣ¬²¢ÒÔ¸ÃÇý¶¯³ÌÐòÖеĸ÷ÖÖϵͳµ÷Óúͺ¯Êýµ÷ÓÃÁ÷³ÌΪ¼Ç
¼˳Ðò¡£±ÈÈ磬
module_init( )
ºÍ
module_exit(
)
ΪÏà¶ÔÓ¦µÄÒ»¶Ôϵͳµ÷Óã¬Ò»°ãÊé¼®Öж ......
linuxϼ¸ÖÖ·þÎñÆ÷µÄÅäÖÃʹÓÃÖ®Ò»£ºnfs tftp
°²×°nfsÐèÒªÔÚ·þÎñÆ÷¶Ë¹Ø±Õiptables·À»ðǽ£¬¹Ø±Õ·½·¨ÈçÏÂ
²é¿´·À»ðǽ״̬£º
/etc/init.d/iptables status
ÔÝʱ¹Ø±Õ·À»ðǽ£º
/etc/init.d/iptables stop
½ûÖ¹·À»ðǽÔÚϵͳÆô¶¯Ê±Æô¶¯
/sbin/chkconfig --level 2345 iptables off
ÖØÆôiptables:
/etc/init.d/iptabl ......
linux϶¨Ê±Ö´Ðмƻ®ÈÎÎñ
²é¿´/etc/crontabÎļþ
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cr ......
tcÊǸöÅäÖÃLinuxÄÚºËÁ÷Á¿¿ØÖƵŤ¾ß Ãû×Ö tc - ÏÔʾ£¯Î¬»¤Á÷Á¿¿ØÖÆÅäÖà ժҪ tc qdisc [ add | change | replace | link ] dev DEV [ parent qdisc-id | root ] [ handle qdisc-id ] qdisc [ qdisc specific parameters ] tc class [ add | change | replace ] dev DEV parent qdisc-id [ classid class-id ] qd ......