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

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

?? netdrv.c

?? vxwork源代碼
?? 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三区| 欧美成人a∨高清免费观看| 久久五月婷婷丁香社区| 国产精品久久久久7777按摩| 一区二区三区在线免费播放| 蜜桃视频一区二区三区| 成人污污视频在线观看| 欧美猛男男办公室激情| 久久精品在这里| 一区二区三区中文免费| 国产在线视频不卡二| 日本道精品一区二区三区 | 九一九一国产精品| 不卡视频一二三| 欧美一级生活片| 1区2区3区国产精品| 奇米影视一区二区三区| 97se狠狠狠综合亚洲狠狠| 日韩一级片在线播放| 亚洲欧洲性图库| 久久精品国产一区二区三区免费看 | 91精品国产一区二区人妖| 国产精品免费视频观看| 日韩电影一区二区三区四区| 成人av免费在线| 日韩你懂的在线观看| 一区二区三区欧美| 国产激情一区二区三区桃花岛亚洲| 欧美午夜片在线观看| 国产日韩av一区二区| 日本三级韩国三级欧美三级| 91在线你懂得| 国产拍揄自揄精品视频麻豆| 日本一区中文字幕| 欧洲在线/亚洲| 国产精品色一区二区三区| 蜜桃久久av一区| 欧美吻胸吃奶大尺度电影| 欧美精彩视频一区二区三区| 蜜桃视频在线一区| 欧美日韩视频专区在线播放| 亚洲日本va午夜在线影院| 一本久道久久综合中文字幕| www国产成人| 日韩精品亚洲一区二区三区免费| 91丨九色丨尤物| 国产视频不卡一区| 精品一区二区影视| 91精品国产色综合久久不卡电影| 亚洲人妖av一区二区| 成人开心网精品视频| 久久色在线观看| 久久精品国产99国产精品| 欧美精品一卡两卡| 亚洲一级不卡视频| 91福利在线播放| 亚洲美女一区二区三区| 99re这里都是精品| 中文字幕一区二区三区av| 成人性视频免费网站| 国产欧美一区二区在线观看| 黄页视频在线91| 精品成人私密视频| 久久99最新地址| 精品卡一卡二卡三卡四在线| 另类小说一区二区三区| 欧美一级高清片| 精品一区二区在线免费观看| 日韩精品一区二区三区在线播放| 日本亚洲一区二区| 日韩欧美国产综合一区| 免费在线观看成人| 日韩午夜电影在线观看| 麻豆精品国产传媒mv男同| 日韩欧美一区在线| 极品少妇xxxx精品少妇偷拍| 2020国产精品久久精品美国| 国产经典欧美精品| 一区在线观看视频| 91极品美女在线| 亚洲二区在线观看| 日韩免费电影网站| 国产在线麻豆精品观看| 国产日韩欧美一区二区三区综合| 成人一级黄色片| 亚洲自拍偷拍av| 欧美一区二区二区| 久久99精品视频| 久久九九99视频| 91尤物视频在线观看| 亚洲电影一区二区| 日韩一区二区三区免费观看| 精品一区二区三区不卡| 国产日产欧产精品推荐色| 99精品国产99久久久久久白柏| 亚洲蜜臀av乱码久久精品蜜桃| 欧美日本一区二区| 狠狠色伊人亚洲综合成人| xvideos.蜜桃一区二区| 国产99久久精品| 国产精品色婷婷久久58| 欧美色手机在线观看| 午夜av一区二区| 日韩精品一区二区三区三区免费| 国产精品一区二区在线看| 亚洲丝袜自拍清纯另类| 欧美精品亚洲二区| 国产酒店精品激情| 亚洲欧美日韩系列| 日韩欧美国产一区二区在线播放| 国产综合色精品一区二区三区| 国产精品国产三级国产| 欧美军同video69gay| 国产精品一区在线| 亚洲午夜电影在线| 日韩精品一级中文字幕精品视频免费观看 | 久久久久久影视| 91麻豆免费观看| 另类专区欧美蜜桃臀第一页| 中文字幕在线不卡一区| 在线不卡免费欧美| 岛国精品在线播放| 午夜激情久久久| 久久影院午夜片一区| 欧洲国内综合视频| 国产99久久久国产精品潘金网站| 午夜欧美大尺度福利影院在线看| 国产日韩三级在线| 欧美女孩性生活视频| 99免费精品视频| 麻豆成人久久精品二区三区红 | 国产不卡视频一区二区三区| 亚洲国产视频网站| 国产欧美一区二区三区在线看蜜臀 | 日韩理论在线观看| 精品国产乱子伦一区| 欧美午夜电影一区| thepron国产精品| 精品一区免费av| 日韩高清不卡一区二区三区| 中文字幕一区二区日韩精品绯色| 精品国产91乱码一区二区三区| 在线观看三级视频欧美| 波多野结衣中文一区| 精品一区二区三区在线播放视频| 99精品久久久久久| 看片网站欧美日韩| 亚洲五月六月丁香激情| 国产精品国产自产拍高清av| 精品剧情v国产在线观看在线| 欧美日韩亚洲高清一区二区| 99在线精品免费| 国产成人免费在线观看| 久色婷婷小香蕉久久| 首页国产欧美久久| 亚洲国产视频一区| 一区二区三区日韩精品| 国产精品成人免费精品自在线观看| 日韩欧美一级二级三级久久久| 欧美日韩在线播放三区四区| 91网站最新地址| 99久久久久免费精品国产| 成人免费毛片高清视频| 国产乱色国产精品免费视频| 久久av资源网| 精品一区二区三区蜜桃| 蜜桃av一区二区在线观看| 日本成人中文字幕| 午夜在线成人av| 亚洲网友自拍偷拍| 国产成人免费视频网站高清观看视频 | 色婷婷激情久久| av成人老司机| 成人不卡免费av| 99久久免费国产| 色综合久久综合网欧美综合网| 成人国产精品免费观看| 成人深夜视频在线观看| 成人h动漫精品一区二| 成人av网站在线观看免费| 成人h精品动漫一区二区三区| 成人妖精视频yjsp地址| 成人国产精品免费观看动漫| av在线不卡网| 色老综合老女人久久久| 色综合激情久久| 欧美日韩精品一区二区三区| 欧美三级午夜理伦三级中视频| 精品视频在线免费观看| 欧美色图免费看| 日韩三级免费观看| 精品国产成人系列| 久久久久97国产精华液好用吗| 国产亚洲精品aa| 一色桃子久久精品亚洲| 一区二区三区四区蜜桃 | 日韩欧美中文字幕公布| 精品乱码亚洲一区二区不卡| 国产欧美日韩综合精品一区二区|