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

Linux Kernel Linked List Explained

²Î¼û£ºhttp://isis.poly.edu/kulesh/stuff/src/klist/
Introduction:
Linux kernel is mostly written in the C language. Unlike many other languages C does not have
a good collection of data structures built into it or supported by a collection of standard libraries.
Therefore, you're probably excited to hear that you can borrow a good implementation of a
circularly-linked list in C from the Linux kernel source tree.
The file include/linux/list.h
in the source tree implements a type oblivious, easy-to-use, circularly-linked list in the C
language. The implementation is efficient and portable-- otherwise it would not have made it
into the kernel. Whenever someone needs a list in the Linux kernel they rely on this
implementation to strung up any data structure they have. With very little modifications
(removing hardware prefetching of list items) we can also use this list in our applications.
A usable version of this file is available
here for download
.
Some of the advantages of using this list are:
Type Oblivious:
This list can be used to strung up any data structure you have in mind.
Portable:
Though I haven't tried in every platform it is safe to assume the list implementation
is very portable. Otherwise it would not have made it into the kernel source tree.
Easy to Use:
Since the list is type oblivious same functions are used to initialize, access,
and traverse any list of items strung together using this list implementation.
Readable:
The macros and inlined functions of the list implementation makes the resulting
code very elegant and readable.
Saves Time:
Stops you from reinventing the wheel. Using the list really saves a lot of
debugging time and repetitively creating lists for every data structure
you need to link.
Linux implementation of the linked list is different from the many
linked list

implementations you might have seen. Usually a linked list contains
the items that are to be linked. For example:
struct my_li


Ïà¹ØÎĵµ£º

Linux ½Å±¾±àд»ù´¡

1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·½ÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
¡¡¡¡·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐиÃÎļþµÄ³ÌÐò¡£ÔÚÕâ¸öÀý×ÓÖÐÎÒÃÇʹÓÃ/bin/shÀ´Ö´ÐгÌÐò¡£
¡¡¡¡µ±±à¼­ºÃ½Å±¾Ê±£¬Èç¹ûÒªÖ´Ðиýű¾£¬»¹±ØÐëʹÆä¿ÉÖ´ÐС£
¡¡¡¡ÒªÊ¹½Å±¾¿ÉÖ´ÐУº
±àÒ ......

vmware ÏÂlinuxÉÏÍøÉèÖÃ

http://blog.163.com/lwzy-crack/blog/static/95272042200910218176623/
Ö÷»úΪWindowsXPϵͳ£¬VMwareÐéÄâ»úÀï°²×°Linux²Ù×÷ϵͳ¡£°²×°ÍêVMwareºó£¬Ö÷»úµÄÍøÂçÁ¬½ÓÀïÃæ³öÏÖÁËÁ½¸öеÄÁ¬½Ó£¬¼´VMware Network Adapter VMnet1ºÍVMware Network Adapter VMnet8Èçͼ¡£ÐéÄâ»úÀï°²×°µÄϵͳ¾ÍÊÇ¿¿ÕâÁ½¸öÐéÄâÍø¿¨À´ÁªÍøµÄ¡££¨ÈçÏÂÍ ......

linux grepÃüÁǿ´óµÄÎı¾ËÑË÷

linux grepÃüÁǿ´óµÄÎı¾ËÑË÷
1.×÷ÓÃ
linuxϵͳÖÐgrepÃüÁîÊÇÒ»ÖÖÇ¿´óµÄÎı¾ËÑË÷¹¤¾ß£¬ËüÄÜʹÓÃÕýÔò±í´ïʽËÑË÷Îı¾£¬²¢°ÑÆ¥ÅäµÄÐдòÓ¡³öÀ´¡£grepÈ«³ÆÊÇGlobal Regular Expression Print£¬±íʾȫ¾ÖÕýÔò±í´ïʽ°æ±¾£¬ËüµÄʹÓÃȨÏÞÊÇËùÓÐÓû§¡£
2.¸ñʽ
grep [options]
3.Ö÷Òª²ÎÊý
[options]Ö÷Òª²ÎÊý£º
£­c£ºÖ»Êä³öÆ¥Åä ......

LinuxÖг£ÓõÄC\C++Í·Îļþ

1¡¢  һЩͷÎļþµÄ×÷Óãº
<assert.h>£ºANSI C¡£Ìṩ¶ÏÑÔ£¬assert(±í´ïʽ)
<glib.h>£ºGCC¡£GTK£¬GNOMEµÄ»ù´¡¿â£¬ÌṩºÜ¶àÓÐÓõĺ¯Êý£¬ÈçÓÐÊý¾Ý½á¹¹²Ù×÷º¯Êý¡£Ê¹ÓÃglibÖ»ÐèÒª°üº¬<glib.h>
<dirent.h>£ºGCC¡£Îļþ¼Ð²Ù×÷º¯Êý¡£struct dirent,struct DIR,opendir(),closedir(),readdir(),readdi ......

LinuxÖÐͨ¹ýlocaleÀ´ÉèÖÃ×Ö·û¼¯


ÔÚLinux
ÖÐͨ¹ýlocale
À´ÉèÖóÌÐòÔËÐеIJ»Í¬ÓïÑÔ»·¾³£¬locale
ÓÉANSI C
Ìṩ֧³Ö¡£locale
µÄÃüÃû¹æÔòΪ<
ÓïÑÔ>_<
µØÇø>.<
×Ö·û¼¯±àÂë>
£¬Èçzh_CN.UTF-8
£¬zh
´ú±íÖÐÎÄ£¬CN
´ú±í´ó½µØÇø£¬UTF-8
±íʾ×Ö·û¼¯¡£ÔÚlocale
»·¾³ÖУ¬ÓÐÒ»×é±äÁ¿£¬´ú±í¹ú¼Ê»¯»·¾³ÖеIJ»Í¬ÉèÖãº
1.  & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ