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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wdbtsfsdrv.c

?? vxworks的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* wdbTsfsDrv.c - virtual generic file I/O driver for the WDB agent *//* Copyright 1996-2001 Wind River Systems, Inc. *//*modification history--------------------01s,09oct01,jhw  Fixed memory leak in tsfsOpen(). SPR 67981.01r,03mar99,dgp  update to reference project facility, make tsfsOpen() NOMANUAL01q,28jan99,jmp  added initialization of semGiveAddr in WDB_TSFS_GENERIC_INFO                 structure, for TSFS_BOOT facility (SPR# 24466).01p,23nov98,cth  added explicit setting of WDB_TSFS_O_TEXT open mode (SPR 23467)01o,31aug98,dgp  final editing for WV 2.0 FCS, corrections to tgtsvr stuff01n,28aug98,dgp  FCS man page edit, add tgtsvr info01m,25aug98,cth  added errno mapping for ECONNREFUSED01l,10aug98,cth  FIORENAME now handles prepended device names, updated docs01k,27may98,cth  modified docs, removed get snd/rcv buf ioctls01j,05may98,dgp  clean up man pages for WV 2.0 beta release01i,16apr98,cth  removed debug print statements01h,16apr98,cth  mapped errnos from tsfs portable definitions to vxworks'      		 added errno reset in open, updated docs01g,03apr98,cjtc i960 port for WV2001f,19mar98,cth  added ioctl support for sockets01e,25feb98,cth  added O_APPEND, _EXCL modes, doc changes, added FIORENAME01d,30jan98,cth  added directory creation/deletion, added man page01c,18aug97,cth  added FIOSNDURGB ioctl command01b,18nov96,dbt  replaced the field delete in WDB_TSFS_INFO struct for C++                 compatibility, with field remove.01a,28aug96,c_s  written, based on wdbVioDrv.c by ms.*//*DESCRIPTIONThis library provides a virtual file I/O driver for use with the WDBagent.  I/O is performed on this virtual I/O device exactly as it would beon any device referencing a VxWorks file system.  File operations, such asread() and write(), move data over a virtual I/O channel created between theWDB agent and the Tornado target server.  The operations are then executed on the host file system.  Because file operations are actually performed on the host file system by the target server, the file system presented by this virtual I/O device is known as the target-server file system, or TSFS.The driver is installed with wdbTsfsDrv(), creating a device typicallycalled '/tgtsvr'.  See the manual page for wdbTsfsDrv() for more informationabout using this function.  The initialization is done automatically,enabling access to TSFS, when INCLUDE_WDB_TSFS is defined.The target server also must have TSFS enabled in order to use TSFS.  See the.I WindView User's Guide: Data Uploadand the target server documentation.TSFS SOCKETSTSFS provides all of the functionality of other VxWorks file systems.For details, see the .pG "I/O System and Local File Systems."In addition to normalfiles, however, TSFS also provides basic access to TCP sockets.  Thisincludes opening the client side of a TCP socket, reading, writing, andclosing the socket.  Basic setsockopt() commands are also supported.To open a TCP socket using TSFS, use a filename of the form:.tS    TCP:<server_name> | <server_ip>:<port_number>.tETo open and connect a TCP socket to a server socket located on a server named 'mongoose', listening on port 2010, use the following:.CS    fd = open ("/tgtsvr/TCP:mongoose:2010", 0, 0).CEThe open flags and permission arguments to the open call are ignored whenopening a socket through TSFS.  If the server 'mongoose' has an IPnumber of '144.12.44.12', you can use the following equivalent form of the command:.CS    fd = open ("/tgtsvr/TCP:144.12.44.12:2010", 0, 0).CEDIRECTORIESAll directory functions, such as mkdir(), rmdir(), opendir(), readdir(),closedir(), and rewinddir() are supported by TSFS, regardless ofwhether the target server providing TSFS is being run on a UNIX or Windows host.While it is possible to open and close directories using open() and close(),it is not possible to read from a directory using read(). Instead, readdir() must be used.  It is also not possible to write to an open directory, and opening a directory for anything other than read-only results in an error, with 'errno' set to 'EISDIR'.  Calling read() on a directory returns 'ERROR' with 'errno' set to 'EISDIR'.OPEN FLAGSWhen the target server that is providing the TSFS is running on a Windowshost, the default file-translation mode is binary translation.  If texttranslation is required, then WDB_TSFS_O_TEXT can be included in the modeargument to open().  For example:.CS    fd = open ("/tgtsvr/foo", O_CREAT | O_RDWR | WDB_TSFS_O_TEXT, 0777).CEIf the target server providing TSFS services is running on a UNIX host, WDB_TSFS_O_TEXT is ignored.TGTSVRFor general information on the target server, see the referenceentry for 'tgtsvr'. In order to use this library, the target server mustsupport and be configured with the following options:.iP "-R <root>" 20Specify the root of the host's file system that is visible to target processesusing TSFS.  This flag is required to use TSFS.  Files under this root are bydefault read only.  To allow read/write access, specify -RW..iP "-RW"Allow read and write access to host files by target processes usingTSFS.  When this option is specified, access to thetarget server is restricted as if `-L' were also specified.IOCTL SUPPORTTSFS supports the following ioctl() functions for controlling filesand sockets. Details about each function can be found in the documentation listed below..iP 'FIOSEEK'.iP 'FIOWHERE'.iP 'FIOMKDIR'Create a directory.  The path, in this case '/tgtsvr/tmp', must be anabsolute path prefixed with the device name. To create the directory '/tmp' on the root of the TSFS file system use the following:.CS    status = ioctl (fd, FIOMKDIR, "/tgtsvr/tmp").CE.iP 'FIORMDIR'Remove a directory.  The path, in this case '/tgtsvr/foo', must be an absolute path prefixed with the device name.  To remove the directory '/foo' from the root of the TSFS file system, use the following:.CS    status = ioctl (fd, FIORMDIR, "/tgtsvr/foo").CE.iP 'FIORENAME'Rename the file or directory represented by 'fd' to the name in the stringpointed to by 'arg'.  The path indicated by 'arg' may be prefixed with thedevice name or not.  Using this ioctl() function with the path '/foo/goo'produces the same outcome as the path '/tgtsvr/foo/goo'.  The path is notmodified to account for the current working directory, and therefore mustbe an absolute path..CS    char *arg = "/tgtsvr/foo/goo";     status = ioctl (fd, FIORENAME, arg);.CE.iP 'FIOREADDIR'.iP 'FIONREAD'Return the number of bytes ready to read on a TSFS socket filedescriptor..iP 'FIOFSTATGET'.iP 'FIOGETFL'.LPThe following ioctl() functions can be used only on socket filedescriptors.  Using these functions with ioctl() provides similar behaviorto the setsockopt() and getsockopt() functions usually used with socketdescriptors.  Each command's name is derived from agetsockopt()/setsockopt() command and works in exactly the same way as therespective getsockopt()/setsockopt() command.  The functions setsockopt()and getsockopt() can not be used with TSFS socket file descriptors.For example, to enable recording of debugging information on the TSFS socketfile descriptor, call:.CS    int arg = 1;    status = ioctl (fd, SO_SETDEBUG, arg);.CETo determine whether recording of debugging information for the TSFS-socketfile descritptor is enabled or disabled, call:.CS    int arg;    status = ioctl (fd, SO_GETDEBUG, & arg);.CEAfter the call to ioctl(), 'arg' contains the state of the debugging attribute.The ioctl() functions supported for TSFS sockets are:.iP SO_SETDEBUGEquivalent to setsockopt() with the SO_DEBUG command..iP SO_GETDEBUGEquivalent to getsockopt() with the SO_DEBUG command..iP SO_SETSNDBUFThis command changes the size of the send buffer of the host socket.  The configuration of the WDB channel between the host and target also affects thenumber of bytes that can be written to the TSFS file descriptor in a singleattempt..iP SO_SETRCVBUFThis command changes the size of the receive buffer of the host socket.  The configuration of the WDB channel between the host and target also affects thenumber of bytes that can be read from the TSFS file descriptor in a singleattempt..iP SO_SETDONTROUTEEquivalent to setsockopt() with the SO_DONTROUTE command..iP SO_GETDONTROUTEEquivalent to getsockopt() with the SO_DONTROUTE command..iP SO_SETOOBINLINEEquivalent to setsockopt() with the SO_OOBINLINE command..iP SO_GETOOBINLINEEquivalent to getsockopt() with the SO_OOBINLINE command..iP SO_SNDURGBThe SO_SNDURGB command sends one out-of-band byte (pointed to by 'arg') through the socket.ERROR CODESThe routines in this library return the VxWorks error codes that most closely match the errnos generated by the corresponding host function.If an error is encountered that is due to a WDB failure, a WDB erroris returned instead of the standard VxWorks 'errno'.  If an 'errno' generatedon the host has no reasonable VxWorks counterpart, the host 'errno' ispassed to the target calling routine unchanged.SEE ALSO:.I "Tornado User's Guide,".I "VxWorks Programmer's Guide: I/O System, Local File Systems"INTERNALopendir(), closedir(), readdir() and rewinddir() are supported whenthe tgtsvr is running on a Unix host.  All of these, with the exception ofrewinddir() are supported on Win32.  Win32 provides directory listings withan iterator model (findfirst(), findnext(), findclose()).  There is noway to back up this iterator, like rewinddir does.There are times when the host must return an error code that is not defined on the target.  These error codes are defined in wdb.h.  Eachtime the errno is set in this function, it is first mapped from theportable error codes defined in wdb.h to a vxWorks' error code.  Common,usually Posix, errnos are passed through this mapping unchanged.  Ifan errno generated on the host is not understood by the mapping routines,then it is passed through unchanged.  This may give the user useful information about what has happened when vxWorks doesn't have an equivalent errno.  Many of the errnos mapped are the Win32 socket andnetworking errnos, which have vxWorks counterparts, but are very differentfrom unix and vxWorks definitions.The ioctl command FIORENAME does not work ideally.  It should modify the pathit is handed to account for the current working directory.  Doing this howeverrequires that this wdb-virtual-io driver call into ioLib, something that hasbeen avoided so far.  This creates a problem with rename() that is not seenin dosFsLib.  The rename function, in ioLib, does not patch up the path namewith the current working directory, letting the ioctl in dosFsLib do itinstead.  When the current working directory is '/tgtsvr/foo/goo', and it contains the file 'file1', and the tsfsRoot is '/folk/blimpy', calling 'rename ("file1", "file-renamed") results in /folk/blimpy/foo/goo/file1being renamed to /folk/blimpy/file-renamed.  Notice the /foo/goo workingdirectory was ignored.  By the way, passFsLib has the same problem.*/#include "vxWorks.h"#include "ioLib.h"#include "iosLib.h"#include "tyLib.h"#include "stdlib.h"#include "stdio.h"#include "intLib.h"#include "string.h"#include "sys/stat.h"#include "dirent.h"#include "wdb/wdb.h"#include "wdb/wdbLibP.h"#include "wdb/wdbEvtLib.h"#include "wdb/wdbVioLib.h"#include "wdb/wdbLibP.h"#if (defined (CPU_FAMILY) && (CPU_FAMILY==I960) && (defined __GNUC__))#pragma align 1                 /* tell gcc960 not to optimize alignments */#endif  /* CPU_FAMILY==I960 */typedef struct    {    DEV_HDR		devHdr;			/* device header */    } TSFS_DEV;typedef struct    {    int			channel;		/* tsfs channel number */    int			openmode;		/* used for FIOGETFL */    SEMAPHORE		tsfsSem;		/* mutex sem for access */    SEMAPHORE		waitSem;		/* used to wait for tgtsvr */    WDB_EVT_NODE	evtNode;		/* agent event node */    WDB_TSFS_INFO	info;			/* event contents */    struct	{	TGT_INT_T	value;			/* value to return to caller */	TGT_INT_T	errNo;			/* errno to return to caller */	TGT_INT_T	extra1;			/* for ioctl extra results */	TGT_INT_T	extra2;			/* for ioctl extra results */	}		result;    } TSFS_CHANNEL_DESC;#if (defined (CPU_FAMILY) && (CPU_FAMILY==I960) && (defined __GNUC__))#pragma align 0                 /* turn off alignment requirement */#endif  /* CPU_FAMILY==I960 */static int		tsfsDrvNum;		/* drvnum for this driver */static int		tsfsChanNum;		/* next channel number */static TSFS_DEV		tsfsDev;		/* virtual I/O device *//* globals */int mutexOptionsTsfsDrv   = SEM_Q_PRIORITY | SEM_DELETE_SAFE;int binaryOptionsTsfsDrv  = SEM_Q_FIFO;int wdbTsfsDefaultDirPerm = DEFAULT_DIR_PERM;	/* created directory perms *//* forward declarations */static int 		tsfsCreate   (TSFS_DEV *pDev, char *name, int mode);static int     		tsfsOpen     (TSFS_DEV *pDev, char * name, int mode, 				      int perm);static int     		tsfsDelete   (TSFS_DEV *pDev, char * name);static STATUS  		tsfsClose    (TSFS_CHANNEL_DESC *pChannelDesc);static int 		tsfsRead     (TSFS_CHANNEL_DESC *pNetFd, char *buf,				      int maxBytes);static int 		tsfsWrite    (TSFS_CHANNEL_DESC *pNetFd, char *buf,				      int maxBytes);static STATUS		tsfsIoctl    (TSFS_CHANNEL_DESC *pChannelDesc,				      int request, int arg);static int		tsfsErrnoMap (int hostErrno);static void		tsfsEventGet (void * pChannelDesc,				      WDB_EVT_DATA *pEvtData);static void		tsfsEventDeq (void * pChannelDesc);/********************************************************************************* wdbTsfsDrv - initialize the TSFS device driver for a WDB agent** This routine initializes the VxWorks virtual I/O "2" driver and creates* a TSFS device of the specified name.** This routine should be called exactly once, before any reads, writes, or* opens.  Normally, it is called by usrRoot() in usrConfig.c,* and the device name created is '/tgtsvr'.** After this routine has been called, individual virtual I/O channels* can be opened by appending the host file name to the virtual I/O* device name.  For example, to get a file descriptor for the host* file '/etc/passwd', call open() as follows:* .CS*     fd = open ("/tgtsvr/etc/passwd", O_RDWR, 0)* .CE** RETURNS: OK, or ERROR if the driver can not be installed.*/STATUS wdbTsfsDrv    (    char *		name		/* root name in i/o system */    )    {    /* check if driver already installed */    if (tsfsDrvNum > 0)	return (OK);    tsfsDrvNum = iosDrvInstall (tsfsCreate, tsfsDelete, tsfsOpen,				tsfsClose, tsfsRead, tsfsWrite, 				tsfsIoctl);    if (tsfsDrvNum <= 0)        return (ERROR);    /* Add the device to the I/O systems device list */    return (iosDevAdd (&tsfsDev.devHdr, name, tsfsDrvNum));    }/********************************************************************************* tsfsCreate - open a virtual I/O channel** RETURNS: tsfsDev handle*/static int tsfsCreate    (    TSFS_DEV *		pDev,		/* I/O system device entry */    char *		name,		/* name of file to open */    int			mode		/* VxWorks open mode */    )    {    return tsfsOpen (pDev, name, mode | O_CREAT | O_TRUNC, 0666);    }/********************************************************************************* tsfsOpen - open a virtual I/O channel** This routine opens a virtual I/O channel and returns a device handle* for the channel.  It does this by creating a WDB event containing the* information necessary for the tgtsvr to perform the requested open* operation.  This routine waits, after the event is sent to the tgtsvr,* until the tgtsvr stores the results of the request back to target memory.* These results are handed back to the caller.** This routine is also used to create files and directories.  After the file* or directory is created, it is opened and a valid device handle is handed* back to the caller.** Note, when creating a directory, the mode argument (O_RDWR, O_RDONLY...)* is not necessary, except to indicate O_CREAT.  It is illegal in most file* systems, including all of VxWorks' file systems, to open a directory in* any mode other than O_RDONLY.  Because the directory is created, as well* as opened in this routine, it is unreasonable to expect that the mode be* O_RDONLY in order to succeed.  After all, the user wants to create the* directory, not open it.  This is confused by our implementation of mkdir,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久男人中文字幕资源站| 色一情一乱一乱一91av| 精品国产制服丝袜高跟| 日韩av一级片| 337p日本欧洲亚洲大胆精品| 国产福利一区在线| 久久久久高清精品| 国产91精品免费| 亚洲免费观看在线视频| 欧美日韩美女一区二区| 日本在线不卡视频一二三区| 日韩欧美中文字幕制服| 成人污污视频在线观看| 亚洲天堂久久久久久久| 欧美日精品一区视频| 免费一级欧美片在线观看| 精品久久人人做人人爰| 99精品视频在线免费观看| 亚洲一区在线视频| 精品欧美黑人一区二区三区| 成人h动漫精品一区二| 亚洲福利视频一区| 精品久久久久av影院| www.日韩大片| 日本午夜一本久久久综合| 国产亚洲一区字幕| 欧美做爰猛烈大尺度电影无法无天| 天堂蜜桃91精品| 国产精品理伦片| 欧美日本精品一区二区三区| 国产精品资源站在线| 一区二区在线免费观看| 精品国产凹凸成av人导航| 一本久久a久久免费精品不卡| 男人操女人的视频在线观看欧美| 国产精品色婷婷| 欧美一区二区观看视频| 色94色欧美sute亚洲13| 国产美女一区二区三区| 首页国产丝袜综合| 中文字幕一区二区三| 精品区一区二区| 欧美裸体一区二区三区| 成人18视频日本| 毛片av一区二区三区| 亚洲精品少妇30p| 国产欧美综合在线| 日韩一区二区三区电影在线观看| 色香色香欲天天天影视综合网| 国产麻豆视频一区二区| 日韩中文字幕1| 依依成人精品视频| 国产精品久久久久久久久动漫| 欧美tickle裸体挠脚心vk| 欧美三级日韩在线| 91国产精品成人| 国产麻豆精品久久一二三| 免费成人在线播放| 午夜天堂影视香蕉久久| 亚洲一区二区精品视频| 最新国产の精品合集bt伙计| 日韩一二在线观看| 欧美精品视频www在线观看| 91久久人澡人人添人人爽欧美| 成人禁用看黄a在线| 国产成人精品一区二区三区四区 | 国产女同性恋一区二区| 欧美变态tickle挠乳网站| 欧美日韩精品系列| 欧美午夜片在线看| 欧美日韩国产一区| 欧美日韩一区在线| 欧美色图片你懂的| 欧美日韩中文字幕一区| 欧美亚洲综合一区| 欧美日韩视频在线第一区| 欧洲视频一区二区| 欧美理论在线播放| 欧美一区二区三区视频| 91精品国产乱码久久蜜臀| 337p亚洲精品色噜噜噜| 日韩一卡二卡三卡四卡| 欧美电影免费观看高清完整版在 | 99久久久精品| 91在线视频免费观看| 91麻豆成人久久精品二区三区| aa级大片欧美| 在线亚洲精品福利网址导航| 欧美视频一区二区三区在线观看| 欧美色图12p| 欧美一级生活片| 精品区一区二区| 国产精品天干天干在观线| 国产精品三级视频| 一区二区三区欧美亚洲| 婷婷六月综合网| 久久99最新地址| 成人小视频在线观看| 色网站国产精品| 91精品国产综合久久久蜜臀粉嫩| 精品少妇一区二区三区 | 日韩欧美一区在线| 久久一二三国产| 亚洲日本丝袜连裤袜办公室| 亚洲精品成人在线| 麻豆精品在线看| 成人动漫一区二区三区| 欧美亚洲精品一区| 欧美大片国产精品| 中文字幕亚洲一区二区av在线 | 久久精品99国产精品| 国产精品一区在线| 91极品视觉盛宴| 精品国产一区二区三区忘忧草 | 91社区在线播放| 日韩一区二区免费电影| 日本一区二区三区电影| 亚洲欧美日韩国产另类专区| 视频在线观看一区| 不卡的看片网站| 日韩欧美在线观看一区二区三区| 国产精品污www在线观看| 亚洲r级在线视频| 成人午夜看片网址| 69堂国产成人免费视频| 国产精品久久久久9999吃药| 偷拍一区二区三区| eeuss鲁片一区二区三区在线观看| 欧美日韩免费不卡视频一区二区三区| 久久精品人人做人人综合| 五月天久久比比资源色| 菠萝蜜视频在线观看一区| 日韩一区二区精品葵司在线 | 欧美高清视频www夜色资源网| 久久久亚洲高清| 视频一区在线播放| 91视频国产观看| 亚洲国产成人私人影院tom| 蜜臀av性久久久久蜜臀aⅴ| 91福利视频久久久久| 国产婷婷一区二区| 久久99国产精品尤物| 在线看不卡av| 综合av第一页| 丁香天五香天堂综合| 欧美本精品男人aⅴ天堂| 日韩av不卡在线观看| 在线免费观看日本欧美| 综合色天天鬼久久鬼色| 国产suv精品一区二区883| 精品理论电影在线观看 | 成人精品免费看| 国产亚洲人成网站| 国产呦萝稀缺另类资源| 欧美一区二区日韩一区二区| 亚洲大片在线观看| 91国偷自产一区二区开放时间 | 不卡一区二区中文字幕| 久久九九全国免费| 国产河南妇女毛片精品久久久 | 2021中文字幕一区亚洲| 蜜臀久久99精品久久久久久9| 欧美日韩不卡在线| 亚洲一区二区三区四区中文字幕| 99久久亚洲一区二区三区青草| 国产蜜臀av在线一区二区三区| 国内精品免费**视频| 精品国产一区二区三区四区四| 精品一区二区三区在线观看 | 成人免费电影视频| 国产精品每日更新| 不卡欧美aaaaa| 亚洲免费视频成人| 欧美日韩精品三区| 蜜桃av一区二区三区电影| 精品欧美一区二区三区精品久久 | 国产日韩欧美一区二区三区综合| 韩日欧美一区二区三区| 久久久.com| 白白色亚洲国产精品| 亚洲视频一区在线| 欧美性videosxxxxx| 日本不卡一区二区三区| 精品va天堂亚洲国产| 国产激情一区二区三区四区| 国产精品蜜臀在线观看| 色婷婷综合久久久久中文| 亚洲国产一区视频| 91超碰这里只有精品国产| 美女视频黄 久久| 久久久91精品国产一区二区精品| 成人动漫一区二区| 一区二区成人在线| 日韩欧美中文字幕精品| 成人综合婷婷国产精品久久| 一区二区三区在线免费| 日韩久久免费av| 国产99久久久精品| 亚洲国产精品久久一线不卡| 日韩欧美视频在线|