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

linuxÇý¶¯Ñ§Ï°

Ò»¡¢ioctl
´ó²¿·ÖÉ豸³ýÁ˶ÁдÄÜÁ¦£¬»¹¿É½øÐг¬³ö¼òµ¥µÄÊý¾Ý´«ÊäÖ®ÍâµÄ²Ù×÷£¬ËùÒÔÉ豸Çý¶¯Ò²±ØÐë¾ß±¸½øÐи÷ÖÖÓ²¼þ¿ØÖƲÙ×÷µÄÄÜÁ¦. ÕâЩ²Ù×÷³£³£Í¨¹ý ioctl ·½·¨À´Ö§³Ö£¬ËüÓкÍÓû§¿Õ¼ä°æ±¾²»Í¬µÄÔ­ÐÍ:
int (*ioctl) (struct inode *inode, struct file *filp,
              unsigned int cmd, unsigned long arg);
ÐèҪעÒâµÄÊÇ£º²»¹Ü¿ÉÑ¡µÄ²ÎÊýargÊÇ·ñÓÉÓû§¸ø¶¨ÎªÒ»¸öÕûÊý»òÒ»¸öÖ¸Õ룬Ëü¶¼ÒÔÒ»¸öunsigned longµÄÐÎʽ´«µÝ¡£Èç¹ûµ÷ÓóÌÐò²»´«µÝarg²ÎÊý, ±»Çý¶¯ÊÕµ½µÄ arg ÖµÊÇ䶨ÒåµÄ¡£ÒòΪÔÚarg²ÎÊýÉϵÄÀàÐͼì²é±»¹Ø±ÕÁË,ËùÒÔÈôÒ»¸ö·Ç·¨²ÎÊý´«µÝ¸ø ioctl£¬±àÒëÆ÷ÊÇÎÞ·¨±¨¾¯µÄ£¬ÇÒÈκιØÁªµÄ´íÎóÄÑÒÔ²éÕÒ.
Ñ¡ÔñioctlÃüÁî
ΪÁË·ÀÖ¹Ïò´íÎóµÄÉ豸ʹÓÃÕýÈ·µÄÃüÁÃüÁîºÅÓ¦¸ÃÔÚϵͳ·¶Î§ÄÚΨһ¡£Îª·½±ã³ÌÐòÔ±´´½¨Î¨Ò»µÄ ioctl ÃüÁî´úºÅ£¬ ÿ¸öÃüÁîºÅ±»»®·ÖΪ¶à¸öλ×ֶΡ£Òª°´ Linux Äں˵ÄÔ¼¶¨·½·¨ÎªÇý¶¯Ñ¡Ôñ ioctl µÄÃüÁîºÅ, Ó¦¸ÃÊ×ÏÈ¿´¿´ include/asm/ioctl.h ºÍ Documentation/ioctl-number.txt¡£ ҪʹÓõÄλ×ֶηûºÅ¶¨ÒåÔÚ <linux/ioctl.h> :
type(»ÃÊý)£º8 λ¿í(_IOC_TYPEBITS)£¬²Î¿¼ioctl-number.txtÑ¡ÔñÒ»¸öÊý£¬²¢ÔÚÕû¸öÇý¶¯ÖÐʹÓÃËü¡£
number£¨ÐòÊý£©£ºË³Ðò±àºÅ£¬8 λ¿í(_IOC_NRBITS)¡£
direction£¨Êý¾Ý´«Ë͵ķ½Ïò£©£º¿ÉÄܵÄÖµÊÇ _IOC_NONE(ûÓÐÊý¾Ý´«Êä)¡¢_IOC_READ¡¢ _IOC_WRITEºÍ _IOC_READ|_IOC_WRITE (Ë«Ïò´«ÊäÊý¾Ý)¡£¸Ã×Ö¶ÎÊÇÒ»¸öλÑÚÂ루Á½Î»£©, Òò´Ë¿ÉʹÓà AND ²Ù×÷À´³éÈ¡_IOC_READ ºÍ _IOC_WRITE¡£
size£¨Êý¾ÝµÄ´óС£©£º¿í¶ÈÓëÌåϵ½á¹¹ÓйØ,ARMΪ14λ.¿ÉÔÚºê _IOC_SIZEBITS ÖÐÕÒµ½Ìض¨ÌåϵµÄÖµ. 
 <linux/ioctl.h> Öаüº¬µÄ <asm/ioctl.h>¶¨ÒåÁËһЩ¹¹ÔìÃüÁî±àºÅµÄºê:
_IO(type,nr)/*ûÓвÎÊýµÄÃüÁî*/
_IOR(type, nr, datatype)/*´ÓÇý¶¯ÖжÁÊý¾Ý*/
_IOW(type,nr,datatype)/*дÊý¾Ý*/
_IOWR(type,nr,datatype)/*Ë«Ïò´«ËÍ*/
/*type ºÍ number ³ÉÔ±×÷Ϊ²ÎÊý±»´«µÝ, ²¢ÇÒ size ³ÉԱͨ¹ýÓ¦Óà sizeof µ½ datatype ²ÎÊý¶øµÃµ½*/
Õâ¸öÍ·Îļþ»¹¶¨ÒåÁËÓÃÀ´½â¿ªÕâ¸ö×ֶεĺê:
_IOC_DIR(nr)
_IOC_TYPE(nr)
_IOC_NR(nr)
_IOC_SIZE(nr)
¾ßÌåµÄʹÓ÷½·¨ÔÚʵÑéÖÐչʾ¡£
·µ»ØÖµ
POSIX ±ê×¼¹æ¶¨£ºÈç¹ûʹÓÃÁ˲»ºÏÊ浀 ioctl ÃüÁîºÅ£¬Ó¦µ±·µ»Ø-ENOTTY ¡£Õâ¸ö´íÎóÂë±» C ¿â½âÊÍΪ"²»ºÏÊʵÄÉ豸 ioctl¡£È»¶ø£¬Ëü·µ»Ø-EINVALÈÔÊ


Ïà¹ØÎĵµ£º

Linux bashÃüÁî

Linux .bash_profileÖÐ umask 022 ÉèÖÃÎÊÌâ
===========================================================
×÷Õß: tolywang(http://tolywang.itpub.net)
·¢±íÓÚ:2008.06.21 09:46
·ÖÀà: Linux/Unix¹ÜÀí
³ö´¦£ºhttp://tolywang.itpub.net/post/48/464765
-------------------------------------------------------- ......

˫ϵͳ°²×°Ê±£¬Linux´ÓÓ²ÅÌÆô¶¯

˫ϵͳ°²×°Ê±£¬Linux´ÓÓ²ÅÌÆô¶¯£º
°²×°windows¾Í²»ÔÙ½²ÁË¡£
ÏÂÔØLinuxϵͳ¾µÏñ£¬ÎÒÏÂÔصÄÊÇCentOS5.3¡£½«Linux¾µÏñ½âѹµ½Ò»¸öfat32·ÖÇøĿ¼£¨ÎÒµÄÊÇFÅÌ£©¡£
²¢½«¾µÏñÖÐisolinuxĿ¼ÏµÄvmlinuxzºÍinitrd.imgÁ½¸öÎļþcopyµ½FÅÌ£¨ÎÒµÄÊÇFÅÌ£©¡£ÏÂÔØwingrub£¬Ë«»÷°²×°¡£°²×°ºó´ò¿ªwingrub³öÀ´Ò»½çÃæchoose driverÈÃÄãÑ¡ÔñÅÌ ......

OracleÈçºÎ¸Ä±älistenerµÄ¶Ë¿ÚºÅ (Linux)

ÔÚLinuxÉÏ°²×°oracleµÄʱºò²»Ð¡ÐÄ°²×°ÁËÁ½´Îlistener, ¸ãµÃlistenerµÄ¶Ë¿ÚºÅ±ä³ÉÁË1522¶ø²»ÊÇȱʡµÄ1521, ¿Í»§¶ËÁ¬Á˺þö¼Ã»ÓÐÁ¬½ÓÉÏ£¬×îºó²Å·¢ÏÖÊÇlistenerµÄ¶Ë¿ÚºÅ²»¶Ô¡£Ò»ÏÂÊÇÎҸıälistener¶Ë¿ÚºÅµÄ²½Ö裺
1. Ê×ÏÈÐèҪֹͣlistener, ʹÓÃÃüÁîlsnrctl stop
2. listenerÍ£Ö¹ÒԺ󣬵½ÄãµÄ$ORACLE_HOME/network/adminÏÂÕ ......

Linux»·¾³½ø³Ì¼äͨÐÅ£¨Ò»£©


       ÔÚ±¾ÏµÁÐÐòÖÐ×÷Õ߸ÅÊöÁË linux ½ø³Ì¼äͨÐŵļ¸ÖÖÖ÷ÒªÊֶΡ£ÆäÖйܵÀºÍÓÐÃû¹ÜµÀÊÇ×îÔçµÄ½ø³Ì¼äͨÐÅ»úÖÆÖ®Ò»£¬¹ÜµÀ¿ÉÓÃÓÚ¾ßÓÐÇ×Ôµ¹Øϵ½ø³Ì¼äµÄͨÐÅ£¬ÓÐÃû¹ÜµÀ¿Ë·þÁ˹ܵÀûÓÐÃû×ÖµÄÏÞÖÆ£¬Òò´Ë£¬³ý¾ßÓйܵÀËù¾ßÓеŦÄÜÍ⣬Ëü»¹ÔÊÐíÎÞÇ×Ôµ¹Øϵ½ø³Ì¼äµÄͨÐÅ¡£ ÈÏÇå¹ÜµÀºÍÓÐÃû¹ÜµÀµÄ¶Áд¹ ......

linux ioctl½âÊÍ

ÎÒÕâÀï˵µÄioctlº¯ÊýÊÇÔÚÇý¶¯³ÌÐòÀïµÄ£¬ÒòΪÎÒ²»ÖªµÀ»¹ÓÐûÓбðµÄ³¡ºÏÓõ½ÁËioctl£¬
      ËùÒԾ͹涨ÁËÎÒÃÇÌÖÂ۵ķ¶Î§¡£ÎªÊ²Ã´ÒªÐ´ÆªÎÄÕÂÄØ£¬ÊÇÒòΪÎÒÇ°Ò»Õó×Ó±»ioctl¸ø¸ã»ì
      ÁË£¬Õ⼸Ìì²ÅŪÃ÷°×Ëü£¬ÓÚÊÇÔÚÕâÀïÇåÀíÒ»ÏÂÍ·ÄÔ¡£
      ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ