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

ÎÒµÄÐéÄâÎļþϵͳ£¨linux)


 
1# ·¢±íÓÚ 2005-11-15 17:34  Ö»¿´¸Ã×÷Õß
  http://www.chinaunix.net ×÷Õß:bierdaci  ·¢±íÓÚ£º2004-05-25 18:59:33
²»ÖªµÀ¸Ã²»¸Ã·¢ÕâÀÊÇÎÒ´Óproc¸ÄÀ´µÄ,¶®ÄÚºËÔ´ÂëµÄ½»Á÷½»Á÷
hello.c
[code:1:3adb123188]
#include "hello.h"
struct inode * hello_get_inode(struct super_block *, int, struct hello_dir_entry *);
/*Õâ¸öº¯ÊýÊÇÖ±½Ó´Ólinux¸´ÖƹýÀ´µÄ£¬×÷ÓþÍÊÇÏÔʾĿ¼ÀïµÄÎļþÃû£¬Ã»ÓÐÕâ¸ö
º¯ÊýÒ²ÐÐÖ»ÊÇÄãÓÃls¡¢dirÃüÁî¿´²»µ½Ä¿Â¼ÏµÄÎļþ¡£*/
int hello_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
printk("hello_readdir\n");
struct hello_dir_entry * de;
unsigned int ino;
int i;
struct inode *inode = filp->f_dentry->d_inode;
ino = inode->i_ino;
de = (struct hello_dir_entry *) inode->u.generic_ip;
if (!de)
return -EINVAL;
i = filp->f_pos;
switch (i) {
case 0:
if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0)
return 0;
i++;
filp->f_pos++;
/* fall through */
case 1:
if (filldir(dirent, "..", 2, i,
   filp->f_dentry->d_parent->d_inode->i_ino,
   DT_DIR) < 0)
return 0;
i++;
filp->f_pos++;
/* fall through */
default:
de = de->subdir;
i -= 2;
for (;;) {
if (!de)
return 1;
if (!i)
break;
de = de->next;
i--;
}
do {
if (filldir(dirent, de->name, de->namelen, filp->f_pos,
   de->low_ino, de->mode >> 12) < 0)
return 0;
filp->f_pos++;
de = de->next;
} while (de);
}
return 1;
}
int hello_d_revalidate(struct dentry *res, int i){printk("d_revalidate\n");return 0;}
int hello_d_hash(struct dentry *res, struct qstr *name){printk("d_hash\n");return 0;}
int hello_d_compare(struct dentry *res, struct qstr *name, struct qstr *old)
{printk("d_compare\n");return 0;}
int hello_d_delete(struct dentry *res){printk("d_delete\n");return


Ïà¹ØÎĵµ£º

LinuxϵͳSudoÃüÁîµÄʹÓÃ˵Ã÷

“Sudo” ÊÇUnix/Linuxƽ̨ÉϵÄÒ»¸ö·Ç³£ÓÐÓõŤ¾ß£¬ËüÔÊÐíϵͳ¹ÜÀíÔ±·ÖÅ䏸ÆÕͨÓû§Ò»Ð©ºÏÀíµÄ“ȨÀû”£¬ÈÃËûÃÇÖ´ÐÐһЩֻÓг¬¼¶Óû§»òÆäËûÌØÐíÓû§²ÅÄÜÍê³ÉµÄÈÎÎñ£¬±ÈÈ磺ÔËÐÐһЩÏñmount£¬halt£¬suÖ®ÀàµÄÃüÁ»òÕ߱༭һЩϵͳÅäÖÃÎļþ£¬Ïñ/etc/mtab£¬ /etc/samba/smb.confµÈ¡£ÕâÑùÒÔÀ´£ ......

linux ¹ÜÀíÃüÁî Ö® ¼àÊÓϵͳ

1.¼àÊÓÄÚ´æ
free -mt
             total       used       free     shared    buffers     cached
Mem:     ......

LinuxÖ÷»ú¼à¿Ø¹¤¾ßmunin monit ntop

À´Ô´£ºhttp://linux.chinaunix.net/ebook/doc/2009/09/17/1135830.shtml
±¾ÎĽéÉÜÔÚcentos 5.x»·¾³ÏÂͨ¹ýyumÔ´µÄÀ©Õ¹Ê¹ÓÃmunin¡¢ monit¡¢ntop¹¤¾ßÀ´¼à¹ÜÄãµÄÓ¦ÓóÌÐòºÍ·þÎñÆ÷¡£ÌâΪÀÁÈË˵˵µÄÊǼò±ãµÄ°²×°·½Ê½¶øÒÑ£¬½«Ç¿´óµÄ¹¦ÄÜÅäÖüòµ¥µÄÓ¦ÓÃÆðÀ´ÊǺÜÖØÒªµÄ£¬¿ÉÒÔ½Úʡʱ¼ä²¢Ìá¸ßЧÂÊ¡£
Monit£ºhttp:#www.tildeslas ......

LinuxÏÂSUNµÄJREÎÊÌâÈÕÖ¾ÊÕ¼¯

LinuxÏÂSUNµÄJREÎÊÌâÈÕÖ¾ÊÕ¼¯
ÔÚLinuxÏÂʹÓÃSunÌṩµÄJRE£¬µ±·¢Éúcore dumpʱ£¬Èç¹ûÈ·ÈÏÊÇÓÉJREÔì³ÉµÄ£¬Sunͨ³£ÐèÒªÄãÌṩÈÕÖ¾ÒÔ¹©·ÖÎö¡£
ͨ³£ÊÇͨ¹ýÖ´ÐÐpkgapp½Å±¾À´ÊÕ¼¯¡£¸Ã½Å±¾¿ÉÔÚsunÍøÕ¾ÉÏÏÂÔØ£¬Ãû×ÖΪSUN-GDD_pkgapp_linux_redhat.tar.gz¡£
pkgapp¹¤¾ßÐèÒªkshµÄÖ§³Ö£¬Òò´ËÈç¹ûLinuxÉÏûÓа´ÕÕksh£¬±ØÐëÏȰ²×°²Å¿É¡ ......

LinuxϾ²Ì¬¿â.aÎļþÉú³É·½·¨


LinuxϾ²Ì¬¿â.aÉú³É
1.½«¸÷º¯Êý´úÂëËùÔÚµÄÔ´Îļþ±àÒë³ÉĿ¼Îļþ¡£ÀýÈ磬¶ÔÓÚmyfunc.c£¬¿ÉÒÔÓÃÈçÏÂÃüÁî ½«Æä±àÒë³ÉÄ¿±êÎļþ£º 
gcc -c myfunc.c 
µ±È»ÔÚÓжà¸öÔ´Îļþʱ£¬Ö»ÐèÔÚgcc ÃüÁîÐÐÖн«Æä·Ö±ðÁÐÉϾͿÉÒÔÁË¡£¾­´ËÒ»²½£¬½«Äܹ»µÃµ½¸÷Ô´ÎļþµÄÄ¿±êÎļþ¡£¶ÔÉÏÀý£¬½«µÃµ½myfunc.o
2.½«¸÷Ä¿±êÎļþÊÕ¼¯ÆðÀ´· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ