Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Îļþ´ò°ü½â°ü(tar with gzip & bzip2)

´ò°ü: tar [-j] | [-z] [cv] [-f tar°üÎļþ] Òª´òÈë°üµÄÔ´Îļþ
½â°ü: tar [-j] | [-z] [xv] [-f tar°üÎļþ] [-C Ö¸¶¨½â°üµÄĿ¼]
²é¿´: tar [-j] | [-z] [tv] [-f tar°üÎļþ]
³£ÓõĴò°üÑ¡Ïî:
Ñ¡Ïî
ÃèÊö
-c
½¨Á¢tar°üÎļþ
-t
²é¿´tar°üÎļþÖеÄÎļþÁбí
-x
½â¿ªtar°üÎļþ
-C path
Óë½â°üÑ¡Ïî(-x)ÅäºÏʹÓÃ,Ö¸¶¨ ......

Linuxѧϰ±Ê¼Ç——DHCP·þÎñ


£­¡¢¸ÅÄî
       1¡¢DHCP£º¶¯Ì¬Ö÷»úÅäÖÃЭÒé
                     ×÷ÓãºÓÃÓÚ¼ò»¯IPÅä¹ÜÀíµÄTCP/IP±ê×¼¡£
       2¡¢DHCP¹¤×÷Á÷³Ì£º
 &nb ......

LinuxÒ»¾ä»°ÎÊÌâ½â´ðÖ®¶þ

1101 linuxÖп̼isoµÄ·½·¨(hutuworm)
·½·¨Ò»£ºÊ¹ÓÃxcdroast£¬Ñ¡ÔñÖÆ×÷¹âµú£¬Ñ¡ÔñISOÎļþ£¬¿Ì¼!
²Î¼û[url]http://www.xcdroast.org/xcdr098/faq-a15.html#17[/url]
·½·¨¶þ£ºÕҿ̼»úµÄÃüÁ
cdrecord --scanbus
Êä³ö½á¹ûΪ£º
0,0,0 0) 'ATAPI ' 'CD-R/RW 8X4X32 ' '5.EZ' Removable CD-ROM
¿Ì¼µÄÃüÁ
cdrecord ......

linuxÏÂvncserverÅäÖÃÓëwinÏÂvnc¿Í»§¶Ë


linuxÏÂvncserverÅäÖÃÓëwinÏÂvnc¿Í»§¶Ë


8 Nov, 2008
 
¹ÜÀí&·þÎñ

< type="text/javascript"><!--
google_ad_client = "pub-7056129240767270";
/* 300x250, ´´½¨ÓÚ 09-2-13 */
google_ad_slot = "270491 ......

linuxÓëj2eeµÄ¿ª·¢

  
ÏêϸµÄ½éÉÜÁËJ2EE 1.4 application Server for LinuxµÄ°²×°ÓëÅäÖá£ÖµµÃ½è¼ø¡£
By Jawa from LinuxAID Forum
¢Ù ²ÉÓÃRedhatLinux 9 Personal ¼òÌåÖÐÎÄ°æµÄÍêÈ«°²×°(5GB)£¬
¡¡¡¡¡¡¡¡¡¡ °²×°Íê±ÏºóMySQL 3ºÍMozilla 1.2.1µÈÈí¼þÒѱ»°²×°µ½LinuxÖС£±¾ËµÃ÷Õë¶ÔLinux×Ô´øµÄÔ­ÓÐMySQL£¬²»ÁíÐа²×°MySQL¡£ÎªÁË ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ