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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? netdrv.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* netDrv.c - network remote file I/O driver *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------05j,10jun02,elr  Correct unresolved reference to netDrvFileDoesNotExist()05i,06jun02,elr  Documentation corrections (SPRs 78010, 78020)05h,07may02,kbw  man page edits05g,31mar02,jkf  SPR#74251, increase path length05f,14mar02,elr  added more debugging facilities via netDrvDebugLevelSet()                 split if statements for more precise debugging                 fixed compilation warnings concerning checking of print                   specifiers                 fixed netFileExists with new configlette for flexibility                 fixed netOpen so that O_CREAT now works (SPR 8283)                 Made all error messages optional (SPR 71496)05e,05nov01,vvv  fixed compilation warnings05d,15oct01,rae  merge from truestack ver 05k, base 05b (compile warnings, etc.)05c,21jun00,rsh  upgrade to dosFs 2.005c,28seo99,jkf  fixed SPR#28927, netLsByName() causes exception.05b,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).05a,12mar99,p_m  Fixed SPR 8295 by adding documentation on FIOFSTATGET.04z,24mar95,jag  netLs ftpXfer call was change to send just "NLST" when the		 remote directory is "." (SPR #4160)04x,18jan95,rhp  doc: explain cannot always distinguish directories over netDrv04w,11aug94,dzb  initialize variables.04v,22apr93,caf  ansification: added cast to netIoctl().04u,30sep93,jmm  netLsByName now frees the NET_FD it uses04t,30aug93,jag  Changed netCreate to delete the end slash from a directory		 name (SPR #2492)04s,11aug93,jmm  Changed ioctl.h and socket.h to sys/ioctl.h and sys/socket.h04r,23jul93,jmm  added netLsByName() (spr 2305)04q,08feb93,jmm  added doc for FIOFSTATGET ioctl call04p,08feb93,jmm  added support for FIOFSTATGET ioctl call (needed for windX)                 SPR #185604o,01feb93,jdi  documentation cleanup for 5.1; added third param to ioctl()		 examples.04n,13nov92,dnw  added include of semLibP.h04m,21oct92,jdi  removed mangen SECTION designation.04l,02oct92,srh  added ioctl(FIOGETFL) to return file's open mode04k,19jul92,smb  added include fcntl.h.04j,18jul92,smb  Changed errno.h to errnoLib.h.04i,26may92,rrr  the tree shuffle04h,08may92,jmm  Fixed ansi prototype warnings04g,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 notice04f,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.04e,20feb91,jaa	 documentation cleanup.04d,01oct90,jcf  changed network fd semaphore to not be inversion safe.04c,18sep90,kdl  removed forward declaration of netWhere().04b,30jul90,dnw  changed pathLastName() to pathLastNamePtr().		 added forward declaration of void routines.04a,26jun90,jcf  changed network fd semaphore to mutex.		 removed super semaphores.03z,20jun90,jcf  changed binary semaphore interface.03y,11may90,yao  added missing modification history (03x) for the last checkin.03x,09may90,yao  typecasted malloc to (char *).03w,01may90,llk  changed call to pathCat().  Now, pathCat() checks if a name		   is too long, and returns ERROR if it is.  03v,17apr90,jcf  changed semaphores to binary for efficiency.  03u,25aug89,dab  fixed coding convention violations.  03t,23aug89,dab  lint.03s,11jul89,dab  made netOpen() check for O_CREAT flag and create a file that		 doesn't already exist.  made netLs() check for ftp protocol.		 added netFileExists().  added netDelete ().  closed all data		 sockets before calling ftpReplyGet(). QUIT ftp command now		 sent before closing a ftp control socket. made netOpen()		 check for O_TRUNC flag.03r,06jul89,llk  included pathLib.h.		 changed call to pathLastName().03q,04apr89,gae  allowed open() to succeed for NFS directories so that ls()	   +dab  would work correctly.  Added NET_LS_STRING variable.03p,07jul88,jcf  lint.03o,22jun88,dnw  name tweaks.		 coalesced 3 malloc's into 1 in netCreate().03n,16jun88,llk  added netLs.03m,04jun88,llk  changed how netCreate retrieves directory and file name.		 moved pathCat to pathLib.03l,30may88,dnw  changed to v4 names.03k,04may88,jcf  changed semaphores to be compatible with new semLib.03j,21apr88,gae  fixed documentation about fseek().03i,17mar88,gae  fixed netPut() bug.		 fixed potential ssemGive() & releaseNetFd() ordering bug.		 fixed bug in netCreate() - file not created if nothing written.03h,28jan88,jcf  made kernel independent.03g,18nov87,ecs  documentation.03f,06nov87,ecs  documentation.03e,16oct87,gae  fixed bug in netClose() - return value indeterminate.		 changed "cd/cat" to use pathCat to construct UNIX filename.		 Added pathCat().  Semaphored fd usage.		 Added "super semaphores" to allow successive semTake's on		 the same semaphore by the same task (needed for recursion).03d,25mar87,jlf  documentation	    dnw  added missing parameter on ftpGetReply calls.		 prepended FTP_ to ftp reply codes.03c,12feb86,dnw  fixed bug in netPut.  This time for sure.03b,14jan87,dnw  fixed bug in netPut.03a,01dec86,dnw  added ftp protocol option.		 changed to not get include files from default directories.02h,08nov86,llk  documentation.02g,07oct86,gae	 made netCreate() use ioGetDefDevTail() instead of global		 'currentDirectory' to conclude the remote directory name.		 Use remGetCurId() to get 'currentIdentity'...included remLib.h02f,05sep86,jlf  made netIoctrl return nbytes for FIONREAD in arg.		 minor documentation.02e,29jul86,llk  cleaned up netGet.02d,27jul86,llk  receives standard error messages from Unix when giving		 a remote command (remRcmd).  Forwards it on to user.		 Added getNetStatus.02c,02jul86,jlf  documentation02b,21jun86,rdc  fixed bug in netCreate - wasn't allocating sufficient space		 for strings.02a,21may86,llk	 got rid of ram disk.  Implemented network file desciptors.		 Wrote all routines except netDrv and netDevCreate.01c,03mar86,jlf  changed ioctrl calls to ioctl.		 changed netIoctrl to netIoctl.01b,28jan86,jlf  documentation, made netIoctrl be LOCAL.01a,14sep85,rdc  written.*//*This driver provides facilities for accessing files transparently over thenetwork via FTP or RSH.  By creating a network device with netDevCreate(),files on a remote UNIX machine may be accessed as if they were local.When a remote file is opened, the entire file is copied over the networkto a local buffer.  When a remote file is created, an empty local bufferis opened.  Any reads, writes, or ioctl() calls are performed on the localcopy of the file.  If the file was opened with the flags O_WRONLY or O_RDWRand modified, the local copy is sent back over the network to the UNIXmachine when the file is closed.Note that this copying of the entire file back and forth can make netDrvdevices awkward to use.  A preferable mechanism is NFS as provided bynfsDrv.USER-CALLABLE ROUTINESMost of the routines in this driver are accessible only through the I/Osystem.  However, two routines must be called directly: netDrv() toinitialize the driver and netDevCreate() to create devices.FILE OPERATIONSThis driver supports the creation, deletion, opening, reading,writing, and appending of files.  The renaming of files is notsupported.INITIALIZATIONBefore using the driver, it must be initialized by calling the routinenetDrv().  This routine should be called only once, before any reads,writes, netDevCreate(), or netDevCreate2() calls.  Initialization isperformed automatically when INCLUDE_NET_DRV is defined.CREATING NETWORK DEVICESTo access files on a remote host, a network device must be created bycalling netDevCreate() or netDevCreate2().  The arguments to netDevCreate()are the name of the device, the name of the host the device will access,and the remote file access protocol to be used -- RSH or FTP.The arguments to netDevCreate2() are ones described above and a size ofbuffer used in the network device as a fourth argument.By convention, a network device name is the remote machine name followedby a colon ":".  For example, for a UNIX host on the network "wrs", filescan be accessed by creating a device called "wrs:".  For more information,see the manual entry for netDevCreate() and netDevCreate2().IOCTL FUNCTIONSThe network driver responds to the following ioctl() functions:.iP "FIOGETNAME" 18 3Gets the file name of the file descriptor <fd> and copies it to the bufferspecified 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 changes to the new position, and the new space isfilled with zeroes:.CS    status = ioctl (fd, FIOSEEK, newOffset);.CE.iP "FIOWHERE"Returns the current byte position in the file.This is the byte offset of the next byte to be read or written.It takes no additional argument:.CS    position = ioctl (fd, FIOWHERE, 0);.CE.iP "FIOFSTATGET"Gets file status information.  The argument <statStruct> is a pointerto a stat structure that is filled with data describing the specifiedfile.  Normally, the stat() or fstat() routine is used to obtain fileinformation, rather than using the FIOFSTATGET function directly.netDrv only fills in three fields of the stat structure: st_dev,st_mode, and st_size. st_mode is always filled with S_IFREG..CS    struct stat statStruct;    fd = open ("file", O_RDONLY);    status = ioctl (fd, FIOFSTATGET, &statStruct);.CELIMITATIONSThe netDrv implementation strategy implies that directories cannotalways be distinguished from plain files.  Thus, opendir() does notwork for directories mounted on netDrv devices, and ll() does not flagsubdirectories with the label "DIR" in listings from netDrv devices.When the access method is FTP, operations can only be done on files thatthe FTP server allows to download. In particular it is not possible to'stat' a directory, doing so will result in "<dirname>: not a plain file"error.INCLUDE FILES: netDrv.hSEE ALSO: remLib, netLib, sockLib, hostAdd()*/#include "vxWorks.h"#include "sys/socket.h"#include "iosLib.h"#include "ioLib.h"#include "logLib.h"#include "memLib.h"#include "memPartLib.h"#include "semLib.h"#include "string.h"#include "remLib.h"#include "fcntl.h"#include "ftpLib.h"#include "lstLib.h"#include "netDrv.h"#include "errnoLib.h"#include "unistd.h"#include "stdio.h"#include "pathLib.h"#include "fioLib.h"#include "stdlib.h"#include "private/semLibP.h"#include "private/iosLibP.h"#include "private/funcBindP.h"#include "sys/stat.h"#define	FD_DIRTY	4	/* mask for the dirty bit */				/* in the options field of NET_FD, bit [2] */#define DATASIZE	512	/* bytes per block of data *//* remote file access protocols */#define PROTO_RSH	0	/* UNIX RSH protocol */#define PROTO_FTP	1	/* ARPA FTP protocol */#define	RSHD	514		/* rshd service */#define NETDRV_DEBUG(string, param1, param2, param3, param4, param5, param6)\    {\    if ((_func_logMsg != NULL) && (netDrvDebugErrors ))\        (* _func_logMsg) (string, param1, param2, param3, param4, param5, \        param6);\    }STATUS netDrvFileDoesNotExist (char *filename, char *response);FUNCPTR	_func_fileDoesNotExist	 = netDrvFileDoesNotExist; /* Use default configlette */typedef struct			/* NET_DEV */    {    DEV_HDR	devHdr;				/* device header */    char	host[MAX_FILENAME_LENGTH];	/* host for this device	*/    int		protocol;			/* remote file access protocol*/    UINT	bufSize;			/* size of buffer */    int		fdMode;				/* FD_MODE of this device */    } NET_DEV;/* A network file descriptor consists of a NET_FD header with a linked list * of DATABLOCKs maintained by lstLib.  The file pointer (filePtrByte) and * end of file pointer (endOfFile) contain absolute byte numbers starting * at 0.  For instance, the first byte in the first block is #0.  The first * byte in the second block is #512 for 512 byte blocks.  The first byte in * the third block is #1024, etc.  Therefore, a byte number modulo 512 gives * the index of the byte in databuf. */typedef struct			/* DATA_BLOCK */    {    NODE	link;			/* link to adjacent BLOCKs in file */    int		used;			/* bytes used in databuf (offset) */    char	databuf[DATASIZE];	/* store data here */    } DATABLOCK;/* network file descriptor */typedef struct			/* NET_FD */    {    LIST	 dataLst;		/* list of data blocks */    NET_DEV *	 pNetDev;		/* file descriptors network device */    DATABLOCK *	 filePtrBlock;		/* pointer to current datablock */    int		 filePtrByte;		/* number of current byte */    int		 endOfFile;		/* byte number after last file byte */    int		 options;		/* contains mode and dirty bit */    char *	 remDirName;   		/* directory name on remote machine */    char *	 remFileName;  		/* file name on remote machine */    SEM_ID	 netFdSem;		/* mutex semaphore */    char *	 buf;			/* read buffer */    int		 bufBytes;		/* available bytes in the buffer */    int		 bufOffset;		/* current offset in the buffer */    int		 dataSock;		/* data socket */    int		 ctrlSock;		/* control socket */    int		 status [8];		/* status counter */    } NET_FD;/* globals */#define NET_LS_STRING "/bin/ls -a %s"int mutexOptionsNetDrv = SEM_Q_PRIORITY | SEM_DELETE_SAFE;/* locals */LOCAL BOOL netDrvDebugStats = FALSE; LOCAL BOOL netDrvDebugErrors = FALSE; LOCAL int netDrvNum;		/* this particular driver number *//* forward static functions */static int netCreate (NET_DEV *pNetDev, char *name, int mode);static int netCreate2 (NET_FD *pNetFd, char *name, int mode);static STATUS netDelete (NET_DEV *pNetDev, char *name);static int netOpen (NET_DEV *pNetDev, char *name, int mode, int perm);static STATUS netClose (NET_FD *pNetFd);static STATUS netLs (NET_FD *pNetFd);static STATUS netFileExists (NET_DEV *pNetDev, char *name);static void getNetStatus (char *buf);static int netRead (NET_FD *pNetFd, char *buf, int maxBytes);static int netWrite (NET_FD *pNetFd, char *buffer, int nBytes);static int netIoctl (NET_FD *pNetFd, int function, int arg);static int netFdCreate (NET_DEV *pNetDev, char *name, int mode);static void netFdRelease (NET_FD *pNetFd);static STATUS netGet (NET_FD *pNetFd);static STATUS netPut (NET_FD *pNetFd);static int netSeek (NET_FD *pNetFd, int newPos);static STATUS moveEndOfFile (NET_FD *pNetFd, int newPos);static STATUS netSockOpen (NET_FD *pNetFd);static STATUS netSockClose (NET_FD *pNetFd);extern STATUS netDevCreate2 (char *devName, char *host, int protocol, 			     UINT bufSize);/* forward declarations */IMPORT void lstInternalFree (LIST *pList, VOIDFUNCPTR freeFunc);/********************************************************************************* netDrv - install the network remote file driver** This routine initializes and installs the network driver.* It must be called before other network remote file functions are performed.* It is called automatically when INCLUDE_NET_DRV 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.*/STATUS netDrv (void)    {    if (netDrvNum > 0)        return (OK); /* driver already installed */    netDrvNum = iosDrvInstall (netCreate, netDelete, netOpen, netClose,                                netRead, netWrite, netIoctl);    return (netDrvNum == ERROR ? ERROR : OK);    }/********************************************************************************* netDevCreate - create a remote file device** This routine creates a remote file device.  Normally, a network device is* created for each remote machine whose files are to be accessed.  By* convention, a network device name is the remote machine name followed by a* colon ":".  For example, for a UNIX host on the network whose name is* "wrs", files can be accessed by creating a device called "wrs:".  Files* can be accessed via RSH as follows:** .CS*     netDevCreate ("wrs:", "wrs", rsh);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久久动漫 | 欧美日韩一区二区三区在线| 欧美电影一区二区三区| 久久久久国产精品免费免费搜索| 国产欧美日韩综合| 久久精品国产久精国产| 欧美性感一区二区三区| 中文字幕第一区二区| 亚洲精品午夜久久久| 国产sm精品调教视频网站| 日韩精品专区在线影院观看| 成人三级在线视频| 欧美视频在线观看一区二区| 亚洲欧美在线高清| 国产成人精品影院| 日韩欧美一区二区久久婷婷| 亚洲伦理在线免费看| 丁香婷婷深情五月亚洲| 日韩欧美激情在线| 偷拍亚洲欧洲综合| 正在播放一区二区| 人禽交欧美网站| 777午夜精品视频在线播放| 性做久久久久久久久| 一本一道久久a久久精品| 亚洲精品视频观看| 在线观看www91| 午夜精品免费在线观看| 欧美日韩精品免费观看视频| 亚洲一区免费在线观看| 欧美日韩精品综合在线| 日韩中文字幕91| 精品国产制服丝袜高跟| 韩国精品一区二区| 国产精品视频一二三区| 99久久免费精品| 亚洲高清免费观看高清完整版在线观看| 色综合久久综合中文综合网| 亚洲综合丁香婷婷六月香| 欧美日韩久久久| 国产一区不卡在线| 欧美国产成人在线| 欧美色图在线观看| 久久国产综合精品| 成人免费小视频| 欧美日韩在线观看一区二区 | 精品sm捆绑视频| 成人激情av网| 国产精品久久久一本精品 | 色哟哟国产精品免费观看| 亚洲va在线va天堂| 久久久国产综合精品女国产盗摄| 99精品欧美一区二区蜜桃免费| 亚洲va国产天堂va久久en| 久久久99久久精品欧美| 成人在线综合网站| 五月婷婷欧美视频| 自拍偷自拍亚洲精品播放| 日韩欧美中文字幕一区| 欧美亚洲综合在线| bt欧美亚洲午夜电影天堂| 日韩不卡在线观看日韩不卡视频| 18涩涩午夜精品.www| 国产日韩精品一区| 日韩欧美国产综合| 精品视频在线免费| 国产99精品在线观看| 丝袜美腿亚洲综合| 香蕉加勒比综合久久| 亚洲精品成人在线| 亚洲蜜臀av乱码久久精品| 国产人伦精品一区二区| 国产农村妇女精品| 国产欧美日韩久久| 日本一区二区免费在线| 精品久久人人做人人爽| 日韩精品一区二区在线观看| 制服丝袜亚洲精品中文字幕| 欧美精品xxxxbbbb| 欧美日韩一本到| 在线不卡一区二区| 日韩欧美一区二区视频| 精品人伦一区二区色婷婷| 欧美老肥妇做.爰bbww| 91激情五月电影| 欧美色图激情小说| 色悠悠亚洲一区二区| 丰满白嫩尤物一区二区| 色婷婷国产精品| 欧美福利视频导航| 亚洲精品一线二线三线| 国产精品嫩草影院av蜜臀| 日韩伦理电影网| 亚洲18色成人| 国产精品一品二品| 97久久超碰国产精品| 欧美日韩高清一区二区不卡| 日韩欧美国产不卡| 国产三级一区二区三区| 亚洲卡通欧美制服中文| 日韩不卡免费视频| 北岛玲一区二区三区四区| 色噜噜狠狠色综合中国| 日韩欧美专区在线| 综合色天天鬼久久鬼色| 亚洲美女免费在线| 精品一区二区免费在线观看| 91丨porny丨国产入口| 欧美videos大乳护士334| 亚洲品质自拍视频网站| 久久不见久久见免费视频7| 成人va在线观看| 精品国免费一区二区三区| 亚洲国产裸拍裸体视频在线观看乱了| 麻豆中文一区二区| 日本韩国欧美一区二区三区| 久久午夜电影网| 日本欧美加勒比视频| 在线观看91精品国产入口| 中文字幕成人网| 亚洲va欧美va人人爽午夜| 日本免费新一区视频| 欧美精品123区| 强制捆绑调教一区二区| 日韩一区二区三区av| 日本亚洲欧美天堂免费| 91精品国产麻豆| 久久精品99国产精品| 久久综合色8888| 国产精品一区二区在线观看网站| 久久久精品欧美丰满| 国产传媒欧美日韩成人| 国产精品久久久久aaaa樱花 | 久久人人97超碰com| 顶级嫩模精品视频在线看| 亚洲国产精品二十页| eeuss国产一区二区三区| 亚洲精品国产无天堂网2021| 欧美日韩国产天堂| 另类成人小视频在线| 国产精品乱人伦一区二区| 一本到一区二区三区| 水野朝阳av一区二区三区| 久久伊人中文字幕| av高清久久久| 日本欧美一区二区三区乱码| 久久精品亚洲精品国产欧美 | 欧美中文字幕一区| 极品少妇xxxx精品少妇偷拍| 亚洲欧洲99久久| 日韩午夜小视频| 色综合天天综合网国产成人综合天| 亚洲成人一区在线| 久久久www成人免费毛片麻豆 | 乱中年女人伦av一区二区| 中文无字幕一区二区三区 | 欧美一区二区三区视频免费| 不卡的av网站| 精品一区二区三区免费观看| 一区二区三国产精华液| 精品88久久久久88久久久| 欧美性猛交xxxxxx富婆| 国产麻豆午夜三级精品| 日韩黄色免费电影| 亚洲天堂成人在线观看| 日本一区二区三区在线不卡| 91 com成人网| 欧美日韩精品福利| 91黄视频在线| 91免费看片在线观看| 国产一区二区不卡在线| 麻豆成人综合网| 日韩av一二三| 五月天网站亚洲| 亚洲一区在线观看网站| 亚洲综合丝袜美腿| 亚洲一区av在线| 亚洲一区二三区| 亚洲国产成人av网| 午夜久久久久久电影| 午夜av电影一区| 日韩国产欧美三级| 青青草视频一区| 狠狠久久亚洲欧美| 国产精品自拍在线| 风流少妇一区二区| 成人自拍视频在线观看| 国产精品99久久久久久似苏梦涵| 老司机精品视频导航| 九九在线精品视频| 国产精品一区二区三区乱码| 国产成人综合精品三级| proumb性欧美在线观看| 91久久精品日日躁夜夜躁欧美| 欧美在线影院一区二区| 欧美一区二区福利在线| 久久精品亚洲精品国产欧美| 亚洲欧美另类小说| 亚洲高清免费观看高清完整版在线观看| 日本一二三四高清不卡|