亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nfsdrv.c

?? vxworks操作系統(tǒng)源代碼_對(duì)于在vxworks環(huán)境下開發(fā)軟件的人員非常有用
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/* nfsDrv.c - Network File System (NFS) I/O driver *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------03l,07may02,kbw  man page edits03k,06nov01,vvv  made max. path length configurable (SPR #63551)03j,15oct01,rae  merge from truestack ver 03s, base 03h (SPR #9357 etc.)03i,07feb01,spm  merged from version 03o of tor3_x branch (base 03h):                 fixed group validation in nfsMountAll (SPR #3524),                 added permission checks to nfsOpen() routine (SPR #21991)03h,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).03g,15dec98,cjtc added helper routine nfsDrvNumGet() to return the nfs		 driver number in the io system. This is needed by the		 WindView host to ensure that the upload is going via		 the upload mechanism requested03f,20nov97,gnn  fix for spr#5436, need to support FIOFSTATFSGET03e,26aug97,spm  removed compiler warnings (SPR #7866)03f,19aug97,cth  changed nfsCacheSize back to before 03e (SPR 7834) fixed by		 fixing SPR 8460.03e,15apr97,cth  added simsol specific fix for spr#7834 (for sirocco release),            +dvs  at some pt this probably needs to be better integrated.03d,06aug96,sgv  fix for spr#646802s,13feb95,jdi  doc tweaks.02r,12jan95,rhp  doc: add FIOSYNC to list of NFS ioctl functions. 		   Also, jdi doc tweaks to nfsDevListGet() and nfsDevInfoGet().02q,01dec93,jag  added the routines nfsDevListGet(), and nfsDevInfoGet().  		 These routines provide support for the SNMP demo.02q,08sep94,jmm  changed NFS client to use new RPC genned xdr routines02p,28jul93,jmm  added permission checking to nfsOpen () (spr 2046)02o,01feb93,jdi  documentation cleanup for 5.1; added third param to		 ioctl() examples.02n,13nov92,dnw  added include of semLibP.h02m,21oct92,jdi  removed mangen SECTION designation.02l,02oct92,srh  added ioctl(FIOGETFL) to return file's open mode02k,16sep92,jcf  added include of errnoLib.h.02j,04sep92,jmm  changed nfsUnmount to make sure device names match exactly                   (spr 1564)02i,19jul92,smb  added include fcntl.h.02h,26may92,rrr  the tree shuffle02g,19Mar92,jmm  changed nfsSeek to allow seeks beyond EOF                 added #include of pathLib.h02f,20jan92,jmm  changed nfsOpen to not truncate path names after                 looking up symlinks02e,16dec91,gae  added includes plus fixes for ANSI.02d,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -changed READ, WRITE and UPDATE to O_RDONLY O_WRONLY and ...		  -changed VOID to void		  -changed copyright notice02c,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.02b,21feb91,jaa	 documentation cleanup.02a,08oct90,dnw  changed nfsMountAll verbose flag to quiet flag.01z,08oct90,hjb  de-linted.01y,02oct90,hjb  nfsWrite() changed to avoid reading data into cache to		   keep cache up-to-date when size of data being written		   is bigger than the nfs cache size.01x,10aug90,dnw  added verbose arg to nfsMountAll().01w,26jun90,jcf  changed semaphore types.		 removed super semaphores.01v,29may90,dnw  fixed nfsMount to free allocated memory if iosDevAdd returns		   ERROR01u,10may90,dnw  added nfsMountAll		 change nfsClose() to not call nfsClientClose() (unless		   nfsAutoClose is set TRUE)		 made SSEMAPHORE include embedded SEM_BINARY which is inited		   instead of a SEM_ID which is created (to reduce malloc).		 changed NFS_MAXPATHLEN to (PATH_MAX + 1)01t,01may90,llk  added FIOREADDIR and FIOFSTATGET ioctl calls.		 deleted FIODIRENTRY ioctl call.01s,01apr90,llk  changed nfsRead() to always return the number of bytes		   requested by caller (up to the bytes left in the file).		 changed name nfsFlushCache() to nfsCacheFlush().		 added "DEFICIENCIES" documentation (and probably some		   deficiencies).		 made string arrays shorter than defined in the NFS spec.		 fixed bug which didn't update file ptr correctly if cache		   size was 0.		 coalesced malloc of cache and fd into one malloc.01r,14mar90,jdi  documentation cleanup.01q,09aug89,dab  made nfsOpen() check for O_TRUNC flag.                 made nfsCreate() truncate file if file already exists.01p,12jul89,llk  lint.01o,24mar89,dab  caching disabled when nfsCacheSize is zero;           +gae  formerly a bug when nfsCacheSize was zero.01n,23mar89,dab  added FIOSYNC option to nfsIoctl().01m,21nov88,jcf  lint.01l,19oct88,llk  documentation.01k,28sep88,llk  documentation.01j,24aug88,gae  documentation.  Made nfsMount() check hostname, and		 allow default local name.01i,07jul88,jcf  lint.01h,30jun88,llk  changed to handle links.		 added nfsDevShow().01g,22jun88,dnw  changed taskIdGet() to taskIdSelf().01f,16jun88,llk  changed to more v4 names.01e,04jun88,llk  added rm, mkdir, rmdir.		 changed how nfsOpen retrieves directory and file names.01d,30may88,dnw  changed to v4 names.01c,04may88,jcf  changed ssemaphores to be consistent with new semLib.01b,22apr88,gae  fixed drvnum reference in nfsUnmount().01a,19apr88,llk  written.*//*This driver provides facilities for accessing files transparently over thenetwork via NFS (Network File System).  By creating a network devicewith nfsMount(), files on a remote NFS system (such as a UNIX system) canbe handled as if they were local.USER-CALLABLE ROUTINESThe nfsDrv() routine initializes the driver.  The nfsMount() and nfsUnmount()routines mount and unmount file systems.  The nfsMountAll() routine mountsall file systems exported by a specified host.INITIALIZATIONBefore using the network driver, it must be initialized by calling nfsDrv().This routine must be called before any reads, writes, or other NFS calls.This is done automatically when INCLUDE_NFS is defined..CREATING NFS DEVICESIn order to access a remote file system, an NFS device must be created bycalling nfsMount().  For example, to create the device `/myd0/' for the filesystem `/d0/' on the host `wrs', call:.CS    nfsMount ("wrs", "/d0/", "/myd0/");.CEThe file `/d0/dog' on the host `wrs' can now be accessed as `/myd0/dog'.If the third parameter to nfsMount() is NULL, VxWorks creates a device withthe same name as the file system.  For example, the call:.CS    nfsMount ("wrs", "/d0/", NULL);.CEor from the shell:.CS    nfsMount "wrs", "/d0/".CEcreates the device `/d0/'.  The file `/d0/dog' is accessed by the same name,`/d0/dog'.Before mounting a file system, the host must already have been createdwith hostAdd().  The routine nfsDevShow() displays the mounted NFS devices.IOCTL FUNCTIONSThe NFS driver responds to the following ioctl() functions:.iP "FIOGETNAME" 18 3Gets the file name of <fd> and copies it to the buffer referenced by <nameBuf>:.CS    status = ioctl (fd, FIOGETNAME, &nameBuf);.CE.iP "FIONREAD"Copies to <nBytesUnread> the number of bytes remaining in the filespecified by <fd>:.CS    status = ioctl (fd, FIONREAD, &nBytesUnread);.CE.iP "FIOSEEK"Sets the current byte offset in the file to the position specified by<newOffset>.  If the seek goes beyond the end-of-file, the file grows.The end-of-file pointer gets moved to the new position, and the new spaceis filled with zeros:.CS    status = ioctl (fd, FIOSEEK, newOffset);.CE.iP "FIOSYNC"Flush data to the remote NFS file.  It takes no additional argument:.CS    status = ioctl (fd, FIOSYNC, 0);.CE.iP "FIOWHERE"Returns the current byte position in the file.  This is the byte offset ofthe next byte to be read or written.  It takes no additional argument:.CS    position = ioctl (fd, FIOWHERE, 0);.CE.iP "FIOREADDIR"Reads the next directory entry.  The argument <dirStruct> is a pointer toa directory descriptor of type DIR.  Normally, the readdir() routine is used toread a directory, rather than using the FIOREADDIR function directly.  Seethe manual entry for dirLib:.CS    DIR dirStruct;    fd = open ("directory", O_RDONLY);    status = ioctl (fd, FIOREADDIR, &dirStruct);.CE.iP "FIOFSTATGET"Gets file status information (directory entry data).  The argument<statStruct> is a pointer to a stat structure that is filled with datadescribing the specified file.  Normally, the stat() or fstat() routine isused to obtain file information, rather than using the FIOFSTATGETfunction directly.  See the manual entry for dirLib:.CS    struct stat statStruct;    fd = open ("file", O_RDONLY);    status = ioctl (fd, FIOFSTATGET, &statStruct);.CE.iP "FIOFSTATFSGET"Gets the file system parameters for and open file descriptor.  The argument<statfsStruct> is a pointer to a statfs structure that is filled with datadescribing the underlying filesystem.  Normally, the stat() or fstat() routineis used to obtain file information, rather than using the FIOFSTATGET functiondirectly.  See the manual entry for dirLib:.CS    statfs statfsStruct;    fd = open ("directory", O_RDONLY);    status = ioctl (fd, FIOFSTATFSGET, &statfsStruct);.CEDEFICIENCIESThere is only one client handle/cache per task.Performance is poor if a task is accessing two or more NFS files.Changing <nfsCacheSize> after a file is open could cause adverse effects.However, changing it before opening any NFS file descriptors should notpose a problem.INCLUDE FILES: nfsDrv.h, ioLib.h, dirent.hSEE ALSO: dirLib, nfsLib, hostAdd(), ioctl(),*/#include "vxWorks.h"#include "iosLib.h"#include "ioLib.h"#include "memLib.h"#include "stdlib.h"#include "semLib.h"#include "string.h"#include "lstLib.h"#include "rpc/rpc.h"#include "xdr_nfs.h"#include "xdr_nfsserv.h"#include "hostLib.h"#include "sys/stat.h"#include "dirent.h"#include "errnoLib.h"#include "errno.h"#include "stdio.h"#include "nfsLib.h"#include "nfsDrv.h"#include "pathLib.h"#include "fcntl.h"#include "memPartLib.h"#include "private/semLibP.h"IMPORT unsigned int nfsMaxMsgLen;	/* max. length of NFs read/write buf */IMPORT int          nfsMaxPath;         /* max. length of file path *//* XXX FD_MODE is defined in here and in netDrv */#define FD_MODE		3	/* mode mask for opened file */				/* O_RDONLY, O_WRONLY or O_RDWR */#ifdef __GNUC__# ifndef alloca#  define alloca __builtin_alloca# endif#endiftypedef struct			/* NFS_DEV - nfs device structure */    {    DEV_HDR	devHdr;			  /* nfs device header */    char	host[MAXHOSTNAMELEN];	  /* host for this device */    nfs_fh	fileHandle;		  /* handle for mounted file system */    /*     * File system mounted on this dev - though it appears as a single      * character, it is really a character array - the memory for the array     * is allocated when an NFS_DEV struct is allocated. This change was      * required for configurable file path length support.     */    char	fileSystem[1];                } NFS_DEV;/* nfs file descriptor */typedef struct			/* NFS_FD - NFS file descriptor */    {    NFS_DEV	*nfsDev;		/* pointer to this file's NFS device */    nfs_fh	 fileHandle;		/* file's file handle */    nfs_fh	 dirHandle;		/* file's directory file handle */    fattr	 fileAttr;		/* file's attributes */    unsigned int mode;			/* (O_RDONLY, O_WRONLY, O_RDWR) */    unsigned int fileCurByte;		/* number of current byte in file */    SEM_ID	 nfsFdSem;		/* accessing semaphore */    BOOL	 cacheValid;		/* TRUE: cache valid and remaining */					/* fields in structure are valid. */					/* FALSE: cache is empty or */					/* cacheCurByte not the same as the */					/* current byte in the file. */    char	*cacheBuf;		/* pointer to file's read cache */    char 	*cacheCurByte;		/* pointer to current byte in cache */    unsigned int cacheBytesLeft;	/* number of bytes left in cache */					/* between cacheCurByte and the end */					/* of valid cache material.  NOTE: */					/* This number may be smaller than */					/* the amount of room left in for */					/* the cache writing. */    BOOL	 cacheDirty;		/* TRUE: cache is dirty, not flushed */    } NFS_FD;/* globals */int mutexOptionsNfsDrv = SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE;unsigned int nfsCacheSize;		/* size of an nfs cache */BOOL	 nfsAutoClose;			/* TRUE: close client after file close*//* locals */LOCAL int nfsDrvNum;			/* this particular driver number *//* forward declarations */LOCAL int nfsCacheFlush ();LOCAL STATUS nfsClose ();LOCAL int nfsCreate ();LOCAL int nfsDelete ();LOCAL int nfsIoctl ();LOCAL int nfsOpen ();LOCAL int nfsRead ();LOCAL int nfsSeek  ();LOCAL int nfsWrite ();LOCAL int nfsChkFilePerms ();/********************************************************************************* nfsDrv - install the NFS driver** This routine initializes and installs the NFS driver.  It must be * called before any reads, writes, or other NFS calls.* This is done automatically when INCLUDE_NFS is defined.** VXWORKS AE PROTECTION DOMAINS* Under VxWorks AE, you can call this function from within the kernel * protection domain only.  This restriction does not apply under non-AE * versions of VxWorks.  ** RETURNS:* OK, or ERROR if there is no room for the driver.*/STATUS nfsDrv (void)    {    if (nfsDrvNum == 0)	{	nfsCacheSize = nfsMaxMsgLen;	nfsDrvNum = iosDrvInstall (nfsCreate, nfsDelete, nfsOpen, nfsClose,				   nfsRead, nfsWrite, nfsIoctl);	}    return (nfsDrvNum == ERROR ? ERROR : OK);    }/********************************************************************************* nfsDrvNumGet - return the IO system driver number for the nfs driver** This routine returns the nfs driver number allocated by iosDrvInstall during* the nfs driver initialization. If the nfs driver has yet to be initialized,* or if initialization failed, nfsDrvNumGet will return ERROR.** RETURNS: the nfs driver number or ERROR*/int nfsDrvNumGet (void)    {    return (nfsDrvNum == 0 ? ERROR : nfsDrvNum);    }/********************************************************************************* nfsMount - mount an NFS file system** This routine mounts a remote file system.  It creates a* local device <localName> for a remote file system on a specified host.* The host must have already been added to the local host table with* hostAdd().  If <localName> is NULL, the local name will be the same as* the remote name.** RETURNS: OK, or ERROR if the driver is not installed,* <host> is invalid, or memory is insufficient.** SEE ALSO: nfsUnmount(), hostAdd()*/STATUS nfsMount    (    char *host,         /* name of remote host */    char *fileSystem,   /* name of remote directory to mount */    char *localName     /* local device name for remote dir */                        /* (NULL = use fileSystem name) */    )    {    FAST NFS_DEV *pNfsDev;    nfs_fh fileHandle;    if (nfsDrvNum < 1)	{	errnoSet (S_ioLib_NO_DRIVER);	return (ERROR);	}    if (strlen (fileSystem) >= nfsMaxPath)	{	errnoSet (S_nfsLib_NFSERR_NAMETOOLONG);	return (ERROR);	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
a4yy欧美一区二区三区| 在线这里只有精品| 亚洲1区2区3区视频| 久久亚洲一级片| 欧美午夜精品一区| 丰满岳乱妇一区二区三区| 调教+趴+乳夹+国产+精品| 国产精品日韩成人| 精品久久一区二区三区| 日本韩国一区二区| 成人av网站在线观看免费| 美女任你摸久久| 亚洲国产中文字幕在线视频综合 | 欧美精三区欧美精三区| www.激情成人| 国产福利一区二区| 久久国产欧美日韩精品| 亚洲午夜成aⅴ人片| 亚洲婷婷综合色高清在线| 久久九九久久九九| 精品国偷自产国产一区| 5月丁香婷婷综合| 欧美专区日韩专区| 一本大道久久a久久精品综合| 国产电影精品久久禁18| 国内偷窥港台综合视频在线播放| 丝袜国产日韩另类美女| 亚洲国产综合色| 亚洲图片有声小说| 亚洲一区二区欧美激情| 一区二区三区在线视频免费| 中文字幕中文字幕一区| 欧美激情在线一区二区| 国产欧美日韩精品一区| 国产午夜亚洲精品午夜鲁丝片| 日韩精品影音先锋| 欧美xxxxx裸体时装秀| 91精品国产免费久久综合| 91精品国产一区二区人妖| 在线播放中文字幕一区| 91精品国产色综合久久不卡电影| 91精品久久久久久久久99蜜臂| 欧美日本一区二区三区四区| 精品视频999| 91精品国产综合久久福利软件| 欧美一区二区三区系列电影| 欧美一区二区二区| 日韩欧美激情在线| 久久在线观看免费| 日本一区二区在线不卡| 成人欧美一区二区三区视频网页 | 日韩av一区二| 久久国产人妖系列| 国产老妇另类xxxxx| 国产一区二区三区av电影| 国产成人精品影视| 波多野结衣中文字幕一区 | 91免费观看在线| 色嗨嗨av一区二区三区| 欧美精三区欧美精三区| 精品国产制服丝袜高跟| 欧美国产乱子伦| 亚洲综合视频网| 日韩不卡在线观看日韩不卡视频| 国产在线精品免费| 不卡的看片网站| 56国语精品自产拍在线观看| 欧美tickling网站挠脚心| 国产精品私人影院| 亚洲国产美女搞黄色| 蜜桃视频在线观看一区| 成人午夜电影网站| 欧美综合天天夜夜久久| 日韩欧美亚洲国产精品字幕久久久| 久久久综合精品| 亚洲综合色丁香婷婷六月图片| 秋霞电影一区二区| k8久久久一区二区三区| 欧美疯狂做受xxxx富婆| 久久久美女艺术照精彩视频福利播放| 亚洲色图在线视频| 久久国产麻豆精品| 色综合中文字幕国产 | 欧美r级在线观看| 亚洲欧美一区二区在线观看| 日韩高清不卡在线| 99国内精品久久| 欧美精品一区二区三区蜜桃| 亚洲欧美日韩国产综合在线| 极品销魂美女一区二区三区| 97精品久久久久中文字幕 | 日韩色在线观看| 亚洲天堂精品在线观看| 狠狠色丁香久久婷婷综| 欧美日韩一区二区电影| 石原莉奈在线亚洲三区| 久久精品一区蜜桃臀影院| 精品99一区二区| 亚洲成人午夜电影| 99久久免费国产| 26uuu精品一区二区| 亚洲午夜羞羞片| 91视频.com| 久久精品男人的天堂| 青草av.久久免费一区| 色综合av在线| 国产精品久久777777| 激情久久五月天| 91精品国产综合久久婷婷香蕉| 一区二区三区四区国产精品| 国产成人鲁色资源国产91色综| 日韩欧美国产午夜精品| 天堂久久久久va久久久久| 91蝌蚪porny| 综合av第一页| www.亚洲色图.com| 国产午夜精品一区二区| 黑人精品欧美一区二区蜜桃 | 色欧美日韩亚洲| 中文字幕不卡在线| 欧美人妖巨大在线| 一区二区三区视频在线看| av在线播放不卡| 国产精品久久久爽爽爽麻豆色哟哟| 狠狠狠色丁香婷婷综合激情 | 国产精品影音先锋| 久久久精品黄色| 国产精选一区二区三区| 久久综合久久鬼色中文字| 久久精品国产亚洲一区二区三区| 欧美另类高清zo欧美| 亚洲电影激情视频网站| 在线电影欧美成精品| 午夜私人影院久久久久| 制服丝袜一区二区三区| 奇米在线7777在线精品| 日韩一区二区影院| 老司机精品视频线观看86| 欧美xingq一区二区| 精品无人码麻豆乱码1区2区 | 制服视频三区第一页精品| 天天av天天翘天天综合网色鬼国产| 欧美日韩免费观看一区二区三区| 亚洲国产精品视频| 91麻豆精品国产综合久久久久久| 日本欧美在线看| 久久久一区二区三区| 成人精品电影在线观看| 亚洲精品免费视频| 欧美午夜精品一区二区蜜桃| 日本不卡一区二区| 日韩西西人体444www| 国产成人在线观看| 国产精品久久久久久久浪潮网站| 99久久久久久99| 天堂久久久久va久久久久| 欧美va亚洲va国产综合| 丰满亚洲少妇av| 亚洲综合精品久久| 日韩你懂的电影在线观看| 国产激情视频一区二区在线观看| 中文字幕亚洲综合久久菠萝蜜| 欧日韩精品视频| 久久丁香综合五月国产三级网站| 久久久国际精品| 91久久久免费一区二区| 久久精品久久综合| 国产精品久久久久久久久搜平片| 欧美熟乱第一页| 国产美女精品人人做人人爽| 亚洲免费在线看| 日韩精品最新网址| 成人av网在线| 免费观看日韩电影| 中文字幕中文字幕在线一区| 69堂精品视频| 成人综合日日夜夜| 日韩中文字幕91| 欧美国产在线观看| 欧美精品色综合| 成人福利视频在线| 美女精品一区二区| 亚洲免费观看高清完整版在线观看| 日韩欧美黄色影院| 欧美主播一区二区三区美女| 国产传媒日韩欧美成人| 亚洲va韩国va欧美va| 久久精品欧美一区二区三区不卡 | 91精品啪在线观看国产60岁| 国产成人av一区二区三区在线观看| 亚洲成人免费视频| 欧美国产精品一区| 日韩视频中午一区| 日本乱码高清不卡字幕| 国产一区999| 丝袜亚洲精品中文字幕一区| 国产精品伦理一区二区| 制服丝袜亚洲精品中文字幕| 91女厕偷拍女厕偷拍高清| 麻豆高清免费国产一区|