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

linux 0.11 ÄÚºËѧϰ fcntl.c


/*
 *  linux/fs/fcntl.c
 *
 *  (C) 1991  Linus Torvalds
 */
#include <string.h>
#include <errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <asm/segment.h>
#include <fcntl.h>
#include <sys/stat.h>
extern int sys_close(int fd);
/* ¸´ÖÆÎļþ¾ä±ú£¬²ÎÊýfdÊÇÖ¸Óë¸´ÖÆµÄÎļþ¾ä±ú£¬argÊÇÖ¸¶¨ÐÂÎļþµÄ¾ä±úµÄ×îСֵ */
static int dupfd(unsigned int fd, unsigned int arg)
{
// Èç¹ûÎļþ¾ä±úÖµ´óÓÚÒ»¸ö³ÌÐò×î¶à´ò¿ªÎļþÊýNR_OPEN£¬»òÕ߸þä±úµÄÎļþ½á¹¹²»´æÔÚ£¬Ôò³ö´í£¬
// ·µ»Ø³ö´íÂë²¢Í˳ö
if (fd >= NR_OPEN || !current->filp[fd])
return -EBADF;
// Èç¹ûÖ¸¶¨µÄоä±úÖµarg ´óÓÚ×î¶à´ò¿ªÎļþÊý£¬Ôò³ö´í
if (arg >= NR_OPEN)
return -EINVAL;
// ÔÚµ±Ç°½ø³ÌµÄÎļþ½á¹¹Ö¸ÕëÊý×éÖÐѰÕÒË÷ÒýºÅ´óÓÚµÈÓÚarg µ«»¹Ã»ÓÐʹÓõÄÏî
while (arg < NR_OPEN)
if (current->filp[arg])
arg++;
else
break;
// Èç¹ûÕÒµ½µÄоä±úÖµarg ´óÓÚ×î¶à´ò¿ªÎļþÊý£¬Ôò³ö´í
if (arg >= NR_OPEN)
return -EMFILE;
// ÔÚÔËÐÐexec()ÀຯÊýʱ²»¹Ø±Õ¸Ã¾ä±ú
current->close_on_exec &= ~(1<<arg);
// Áî¸ÃÎļþ½á¹¹Ö¸ÕëµÈÓÚÔ­¾ä±úfd µÄÖ¸Õ룬²¢½«ÎļþÒýÓüÆÊýÔö1
(current->filp[arg] = current->filp[fd])->f_count++;
return arg;
}
/* ¸´ÖÆÎļþ¾ä±úϵͳµ÷Óú¯Êý */
int sys_dup2(unsigned int oldfd, unsigned int newfd)
{
// Èô¾ä±únewfd ÒѾ­´ò¿ª£¬ÔòÊ×ÏȹرÕÖ®
sys_close(newfd);
// ¸´ÖƲ¢·µ»ØÐ¾ä±ú
return dupfd(oldfd,newfd);
}
/* ¸´ÖÆÎļþ¾ä±úϵͳµ÷Óú¯Êý¡£Ð¾ä±úµÄÖµÊǵ±Ç°×îСµÄδÓþä±ú */
int sys_dup(unsigned int fildes)
{
return dupfd(fildes,0);
}
/* Îļþ¿ØÖÆÏµÍ³µ÷Óú¯Êý */
int sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct file * filp;
// Èç¹ûÎļþ¾ä±úÖµ´óÓÚÒ»¸ö½ø³Ì×î¶à´ò¿ªÎļþÊýNR_OPEN£¬»òÕ߸þä±úµÄÎļþ½á¹¹Ö¸ÕëΪ¿Õ£¬Ôò³ö´í£¬
// ·µ»Ø³ö´íÂë²¢Í˳ö
if (fd >= NR_OPEN || !(filp = current->filp[fd]))
return -EBADF;
switch (cmd)
{
case F_DUPFD: // ¸´ÖÆÎļþ¾ä±ú
return dupfd(fd,arg);
case F_GETFD: // È¡Îļþ¾ä±úµÄÖ


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨Èý£© HCI²ã±à³Ì

http://www.ej38.com/showinfo/linux-111338.html
1. HCI²ãЭÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host
Controller Interface(HCI)  ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬
ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth D ......

linuxÓëj2ee

J2ee³ÌÐòÔ±Ó¦¸ÃÕÆÎÕµÄlinux֪ʶ
¿ª·¢ÕßÔÚÏß Builder.com.cn ¸üÐÂʱ¼ä:2007-09-01×÷ÕߣºÖйúITʵÑéÊÒ À´Ô´:ÖйúITʵÑéÊÒ
±¾ÎĹؼü´Ê£º Linux J2ee
¡¡Ò»°ã´óÐÍJ2EEÓ¦Óö¼ÔÚ½¨¹¹ÔÚlinux»·¾³Ïµġ£¿ª·¢»·¾³ÏÂÎÒÃÇ¿ÉÒÔͨ¹ýsambaÓ³Éä³É±¾µØµÄÍøÂçÇý¶¯Æ÷£¬Ö±½ÓÔÚwindows»·¾³Ï½øÐбà³Ìµ÷ÊÔ¡£µ«ÊÇ×îºóµÄ·¢²¼»¹ÊÇÒªµ½linux»·¾³£¬ ......

linuxÓëj2ee

Linux ³£ÓÃÃüÁî
Linux ϵͳ³£ÓÃÃüÁî¸ñʽ£º
    command  [option]  [argument1]  [argument2]  ...
ÆäÖÐoptionÒÔ“-”¿ªÊ¼£¬¶à¸öoption¿ÉÓÃÒ»¸ö“-”Á¬ÆðÀ´£¬Èç“ls -l -a” Óë“ls -la”µÄЧ¹ûÊÇÒ»ÑùµÄ¡£¸ù¾Ýà ......

linux 0.11 ÄÚºËѧϰ block_dev.c


/*
 * ¸ÃÎļþµÄÁ½¸öº¯ÊýÊÇΪÁËÏòopenºÍwriteº¯ÊýÌṩ½Ó¿Ú£¬ÊµÏÖÄÚºËÊý¾Ý
 * ºÍÓû§Êý¾ÝµÄ½»»¥
 */
/*
 *  linux/fs/block_dev.c
 *
 *  (C) 1991  Linus Torvalds
 */
#include <errno.h>
#include <linux/sched.h>
#include <linux/kernel ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ