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

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

?? ioslib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* iosLib.c - I/O system library *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------04n,03oct01,dcb  Fix SPR 20033.  iosFdSet uses malloc without checking return                 code.04m,31aug98,ms   add _func_ioTaskStdSet initialization.04l,24aug96,sgv  fix for spr 6802. Modified iosFdNew to check for maxFiles		 after a fd value is chosen.04k,23aug96,ms   writing to null device no longer an error (SPR 7076)04k,11jan95,rhp  explain "default device" in iosDevFind() man page (SPR#2462)04j,17oct94,rhp  removed obsolete reference to pathLib in doc (SPR#3712).04i,26jul94,dvs  made iosWrite/iosRead consistant so they both return ERROR 		 if no driver routine - also changed doc (SPR #2019 and 2020).04h,14jul94,dvs  made write return 0 if no driver routine (SPR #2020).04g,07dec93,elh  added asynchronous I/O support for Posix.04f,21jan93,jdi  documentation cleanup for 5.1.04e,13nov92,dnw  added include of semLibP.h04d,23aug92,jcf  split show routines into iosShow.c. 		 moved typedefs/defines to private/iosLibP.h.		 changed semMInit->semBInit.  changed lst* to dll*.04c,18jul92,smb  Changed errno.h to errnoLib.h.04b,26may92,rrr  the tree shuffle04a,25nov91,rrr  cleanup of some ansi warnings.03z,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -changed VOID to void		  -changed copyright notice03y,30apr91,jdi  documentation tweaks.03x,26apr91,shl  fixed potential race in iosFdFree() (spr 997).03w,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 moved position of iosDrvShow(); doc review by dnw.03v,08feb92,jaa	 documentation cleanup.03u,05oct90,dnw	 made iosNextDevGet() be NOMANUAL03t,10aug90,kdl  added forward declarations for functions returning void.03s,26jun90,jcf  changed iosSemaphore to mutex.03r,29may90,dnw  fixed iosDevDelete to free memory allocated for name string.		 tweaked documentation for iosDevAdd & iosDevDelete.03q,25may90,dnw  fixed printf format in ios{Dev,Fd}Show to show entire name		   instead of just 1st 20 chars.		 changed iosFdSet to malloc space for filename, unless filename		   is same as device name.  Note that callers should NOT		   malloc the name before calling iosFdSet anymore.		   See doc in iosFdSet.		 made several obscure iosFd... routines be "no manual".03p,11may90,yao  added missing modification history (03o) for the last checkin.03o,09may90,yao  typecasted malloc to (char *).03n,07may90,hjb  added iosFdDevFind routine.03m,14mar90,jdi  documentation cleanup.03l,14nov88,dnw  changed ioTaskStdGet to take taskId arg.03i,08oct88,gae  fixed checking for task specific std. input/output/error fd's.03h,15aug88,jcf  lint.03g,15jul88,llk  changed iosFdSet.  fd names are now allocated before iosFdSet		   is called.03f,30jun88,llk  added iosNextDevGet().		 changed iosDevAdd() so that it will not add devices with		   duplicate names.03e,04jun88,llk  replaced ioDefDev with ioDefPath.03d,30may88,dnw  changed to v4 names.03c,28may88,dnw  made ios{Create,Delete,Open,Close,Read,Write,Ioctl} LOCAL.03b,23apr88,jcf  fixed semaphore calls for new semLib.03a,30mar88,gae  made drvTable & fdTable definition local.		 made fd's 0, 1, & 2 be standard in/out/err a la UNIX.		 added ios{Creat,Delete,Open,Read,Write,Ioctl,Close}() for use		 by ioLib.c.  Got rid of iosFdGetFree() and added iosFdNew()		 to simplify setting up of new file descriptor.		 iosFdCheck() turned into a macro for speed/jsr overhead.		 iosDevList() shows driver number.		 iosFdList() shows driver number and indicates std. in/out/err.02b,20feb88,dnw  fixed missing return value in iosDrvRemove().02a,16dec87,jlf  added iosDevDelete (), iosDrvRemove (), and iosDrvList ().		 changed iosDrvInstall to look for an unused entry, instead		    of just adding new drivers at the end.01p,05nov87,rdc  fixed documentation for iosDevFind.01o,30sep87,gae  made fdTable LOCAL; added iosFdSet() to set values in		   fdTable; now keep file name in table; added iosFdList().01n,28apr87,gae  made iosLock() and iosUnlock() LOCAL.01m,24mar87,jlf  documentation.01l,20dec86,dnw  changed iosDevMatch() to find longest (instead of just first)		   device name that is initial substring of file name.		 changed to not get include files from default directories.01k,01dec86,dnw  changed iosDevAdd() to put device name in allocated memory,		   instead of in fixed length array.01j,14apr86,rdc  changed memAllocates to mallocs.01i,11oct85,dnw  de-linted.01h,20jul85,jlf  documentation.01g,19sep84,jlf  worked on the comments a little.01f,05sep84,jlf  fixed iosDevMatch to work properly.  Added copyright.  Added		 comments.01e,04sep84,dnw  added iosDevList.01d,10aug84,dnw  changed ioDevFind to include "default device" search		   if device name not explicitly specified.01c,07aug84,ecs  added calls to setStatus to iosDevFind, iosDrvInstall,		   iosFdCheck, and iosFdGetFree01b,29jun84,ecs  changed iosDevFind to use new version of cmpbuf01a,11jun84,dnw  culled from old drvLib and ioLib*//*This library is the driver-level interface to the I/O system.  Itsprimary purpose is to route user I/O requests to the proper drivers, usingthe proper parameters.  To do this, iosLib keeps tables describing theavailable drivers (e.g., names, open files).The I/O system should be initialized by calling iosInit(), before callingany other routines in iosLib.  Each driver then installs itself by callingiosDrvInstall().  The devices serviced by each driver are added to the I/Osystem with iosDevAdd().The I/O system is described more fully in the .I "I/O System"chapter of the.I "Programmer's Guide."INCLUDE FILES: iosLib.hSEE ALSO: intLib, ioLib,.pG "I/O System"*/#include "vxWorks.h"#include "dllLib.h"#include "stdlib.h"#include "semLib.h"#include "ioLib.h"#include "string.h"#include "errnoLib.h"#include "stdio.h"#include "private/iosLibP.h"#include "private/semLibP.h"#include "private/funcBindP.h"/* globals */DL_LIST 	iosDvList;			/* list of I/O device headers */DRV_ENTRY *	drvTable;			/* driver entry point table */FD_ENTRY *	fdTable;			/* table of fd entries */int 		maxDrivers;			/* max installed drivers */int 		maxFiles;			/* max open files */char		ioDefPath[MAX_FILENAME_LENGTH];	/* default I/O prefix */int		mutexOptionsIosLib = SEM_Q_FIFO | SEM_DELETE_SAFE;BOOL		iosLibInitialized = FALSE;VOIDFUNCPTR	iosFdNewHookRtn = NULL;VOIDFUNCPTR	iosFdFreeHookRtn = NULL;/* forward static functions */static DEV_HDR *iosDevMatch (char *name);static void 	iosLock (void);static void 	iosUnlock (void);/* locals */LOCAL SEMAPHORE iosSemaphore;	/* semaphore to interlock access to io tables */LOCAL DEV_HDR	nullDevHdr;	/* device header for null device *//******************************************************************************** nullWrite - NULL device write routine*/ static STATUS nullWrite    (    int    dummy,    char * pBuf,    int    nBytes    )    {    return (nBytes);    }/********************************************************************************* iosInit - initialize the I/O system** This routine initializes the I/O system.* It must be called before any other I/O system routine.** RETURNS: OK, or ERROR if memory is insufficient.*/STATUS iosInit    (    int max_drivers,            /* maximum number of drivers allowed */    int max_files,              /* max number of files allowed open at once */    char *nullDevName           /* name of the null device (bit bucket) */    )    {    int i;    int size;    maxDrivers	= max_drivers;    maxFiles	= max_files;    ioDefPath [0] = EOS;    /* allocate file table and make all entries free */    size = maxFiles * sizeof (FD_ENTRY);    fdTable = (FD_ENTRY *) malloc ((unsigned) size);    if (fdTable == NULL)	return (ERROR);    bzero ((char *)fdTable, size);    for (i = 0; i < maxFiles; i++)	iosFdFree (STD_FIX(i));    /* allocate driver table and make all entries null */    size = maxDrivers * sizeof (DRV_ENTRY);    drvTable = (DRV_ENTRY *) malloc ((unsigned) size);    if (drvTable == NULL)	return (ERROR);    bzero ((char *) drvTable, size);    for (i = 0; i < maxDrivers; i++)	drvTable [i].de_inuse = FALSE;    /* initialize the device list and data structure semaphore;     * add the null device to the system      */    semBInit (&iosSemaphore, SEM_Q_PRIORITY, SEM_FULL);    dllInit (&iosDvList);    drvTable [0].de_write = nullWrite;    iosDevAdd (&nullDevHdr, nullDevName, 0);    iosLibInitialized = TRUE;    _func_ioTaskStdSet = (FUNCPTR)ioTaskStdSet;    return (OK);    }/********************************************************************************* iosDrvInstall - install an I/O driver** This routine should be called once by each I/O driver.  It hooks up the* various I/O service calls to the driver service routines, assigns* the driver a number, and adds the driver to the driver table.** RETURNS:* The driver number of the new driver, or ERROR if there is no room for the* driver.*/int iosDrvInstall    (    FUNCPTR pCreate,    /* pointer to driver create function */    FUNCPTR pDelete,    /* pointer to driver delete function */    FUNCPTR pOpen,      /* pointer to driver open function */    FUNCPTR pClose,     /* pointer to driver close function */    FUNCPTR pRead,      /* pointer to driver read function */    FUNCPTR pWrite,     /* pointer to driver write function */    FUNCPTR pIoctl      /* pointer to driver ioctl function */    )    {    FAST DRV_ENTRY *pDrvEntry = NULL;    FAST int drvnum;    iosLock ();    /* Find a free driver table entry.  Never assign driver number 0. */    for (drvnum = 1; drvnum < maxDrivers; drvnum++)	if (! drvTable [drvnum].de_inuse)	    {	    /* We've got a free entry */	    pDrvEntry = &drvTable [drvnum];	    break;	    }    if (pDrvEntry == NULL)	{	/* we couldn't find a free driver table entry */	errnoSet (S_iosLib_DRIVER_GLUT);	iosUnlock ();	return (ERROR);	}    pDrvEntry->de_inuse	= TRUE;    pDrvEntry->de_create= pCreate;    pDrvEntry->de_delete= pDelete;    pDrvEntry->de_open	= pOpen;    pDrvEntry->de_close	= pClose;    pDrvEntry->de_read	= pRead;    pDrvEntry->de_write	= pWrite;    pDrvEntry->de_ioctl	= pIoctl;    iosUnlock ();    return (drvnum);    }/********************************************************************************* iosDrvRemove - remove an I/O driver** This routine removes an I/O driver (added by iosDrvInstall()) from * the driver table.* ** RETURNS: OK, or ERROR if the driver has open files.** SEE ALSO: iosDrvInstall()*/STATUS iosDrvRemove    (    int drvnum,       /* no. of driver to remove,             */		      /* returned by iosDrvInstall()          */    BOOL forceClose   /* if TRUE, force closure of open files */    )    {    DEV_HDR *pDevHdr;    FAST int fd;    FAST FD_ENTRY *pFdEntry;    FAST DRV_ENTRY *pDrvEntry = &drvTable [drvnum];    FUNCPTR drvClose = pDrvEntry->de_close;    iosLock ();    /* See if there are any open fd's for this driver */    for (fd = 0; fd < maxFiles; fd++)	{	pFdEntry = &fdTable [fd];	if (pFdEntry->inuse && pFdEntry->pDevHdr->drvNum == drvnum)	    {	    if (! forceClose)		{		iosUnlock ();		return (ERROR);		}	    else		{		if (drvClose != NULL)		    (* drvClose) (pFdEntry->value);		iosFdFree (STD_FIX(fd));		}	    }	}    /* remove any devices for this driver */    for (pDevHdr = (DEV_HDR *) DLL_FIRST (&iosDvList); pDevHdr != NULL;				pDevHdr = (DEV_HDR *) DLL_NEXT (&pDevHdr->node))	{	if (pDevHdr->drvNum == drvnum)	    {	    free (pDevHdr->name);	    dllRemove (&iosDvList, &pDevHdr->node);	    }	}    pDrvEntry->de_inuse	= FALSE;    pDrvEntry->de_create= NULL;    pDrvEntry->de_delete= NULL;    pDrvEntry->de_open	= NULL;    pDrvEntry->de_close	= NULL;    pDrvEntry->de_read	= NULL;    pDrvEntry->de_write	= NULL;    pDrvEntry->de_ioctl	= NULL;    iosUnlock ();    return (OK);    }/********************************************************************************* iosDevAdd - add a device to the I/O system** This routine adds a device to the I/O system device list, making the* device available for subsequent open() and creat() calls.** The parameter <pDevHdr> is a pointer to a device header, DEV_HDR (defined* in iosLib.h), which is used as the node in the device list.  Usually this* is the first item in a larger device structure for the specific device* type.  The parameters <name> and <drvnum> are entered in <pDevHdr>.** RETURNS: OK, or ERROR if there is already a device with the specified name.*/STATUS iosDevAdd    (    DEV_HDR *pDevHdr, /* pointer to device's structure */    char *name,       /* name of device */    int drvnum        /* no. of servicing driver, */		      /* returned by iosDrvInstall() */    )    {    DEV_HDR *pDevMatch = iosDevMatch (name);    /* don't add a device with a name that already exists in the device list.     * iosDevMatch will return NULL if a device name is a substring of the     * named argument, so check that the two names really are identical.     */    if ((pDevMatch != NULL) && (strcmp (pDevMatch->name, name) == 0))	{	errnoSet (S_iosLib_DUPLICATE_DEVICE_NAME);	return (ERROR);	}    pDevHdr->name   = (char *) malloc ((unsigned) (strlen (name) + 1));    pDevHdr->drvNum = drvnum;    if (pDevHdr->name == NULL)	return (ERROR);    strcpy (pDevHdr->name, name);    iosLock ();    dllAdd (&iosDvList, &pDevHdr->node);    iosUnlock ();    return (OK);    }/********************************************************************************* iosDevDelete - delete a device from the I/O system** This routine deletes a device from the I/O system device list, making it* unavailable to subsequent open() or creat() calls.  No interaction with* the driver occurs, and any file descriptors open on the device or pending* operations are unaffected.** If the device was never added to the device list, unpredictable results* may occur.** RETURNS: N/A*/void iosDevDelete    (    DEV_HDR *pDevHdr            /* pointer to device's structure */    )    {    iosLock ();    dllRemove (&iosDvList, &pDevHdr->node);    iosUnlock ();    free (pDevHdr->name);    }/********************************************************************************* iosDevFind - find an I/O device in the device list** This routine searches the device list for a device whose name matches the* first portion of <name>.  If a device is found, iosDevFind() sets the* character pointer pointed to by <pNameTail> to point to the first* character in <name>, following the portion which matched the device name.* It then returns a pointer to the device.  If the routine fails, it returns* a pointer to the default device (that is, the device where the current* working directory is mounted) and sets <pNameTail> to point to the* beginning of <name>.  If there is no default device, iosDevFind() * returns NULL.** RETURNS:* A pointer to the device header, or NULL if the device is not found.**/DEV_HDR *iosDevFind    (    char *name,                 /* name of the device */    char **pNameTail            /* where to put ptr to tail of name */    )    {    FAST DEV_HDR *pDevHdr = iosDevMatch (name);    if (pDevHdr != NULL)	*pNameTail = name + strlen (pDevHdr->name);    else	{	pDevHdr = iosDevMatch (ioDefPath);	*pNameTail = name;	}    if (pDevHdr == NULL)	errnoSet (S_iosLib_DEVICE_NOT_FOUND);    return (pDevHdr);    }/************************************************************************ iosDevMatch - find device whose name matches specified string** RETURNS: Pointer to device header, or NULL if device not found.*/LOCAL DEV_HDR *iosDevMatch    (    char *name    )    {    FAST DEV_HDR *pDevHdr;    FAST int len;    DEV_HDR *pBestDevHdr = NULL;    int maxLen = 0;    iosLock ();    for (pDevHdr = (DEV_HDR *) DLL_FIRST (&iosDvList); pDevHdr != NULL;				pDevHdr = (DEV_HDR *) DLL_NEXT (&pDevHdr->node))	{	len = strlen (pDevHdr->name);	if (strncmp (pDevHdr->name, name, len) == 0)	    {	    /* this device name is initial substring of name;	     *   if it is longer than any other such device name so far,	     *   remember it.	     */	    if (len > maxLen)		{		pBestDevHdr = pDevHdr;		maxLen = len;		}	    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲主播在线播放| 国产精品另类一区| 精品国产欧美一区二区| 国产九九视频一区二区三区| 国产精品1区二区.| 在线观看欧美日本| 欧美日韩精品欧美日韩精品| 欧美特级限制片免费在线观看| 欧美视频日韩视频在线观看| 欧美一区二区三区不卡| 久久免费视频色| 首页综合国产亚洲丝袜| 一本色道久久加勒比精品| 在线精品观看国产| 中文字幕国产一区| 亚洲国产欧美一区二区三区丁香婷| 老司机免费视频一区二区三区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 国产精品久久久一区麻豆最新章节| 亚洲精品水蜜桃| 美国毛片一区二区三区| av电影在线不卡| 欧美一区二区啪啪| 日韩国产欧美一区二区三区| 国内外精品视频| 91精品1区2区| 成人免费在线播放视频| 国产成人一级电影| 精品99一区二区三区| 五月天激情综合网| 欧美日韩你懂得| 亚洲狼人国产精品| 丁香亚洲综合激情啪啪综合| 国产亚洲精品资源在线26u| 视频一区视频二区在线观看| 色哟哟一区二区| 亚洲人成人一区二区在线观看| 国产精品一区二区视频| 欧美精品一区二区三区四区 | 日韩在线a电影| 欧美少妇xxx| 国产欧美日韩激情| 国产69精品久久久久777| 久久久国际精品| 成人性生交大片免费看中文| 国产精品丝袜91| 91麻豆福利精品推荐| 亚洲色图在线视频| 欧美午夜影院一区| 日韩和欧美的一区| 欧美专区在线观看一区| 亚洲成人一区二区在线观看| 欧美日韩在线综合| 久久精品国产亚洲a| 精品国产髙清在线看国产毛片| 国产露脸91国语对白| 国产精品九色蝌蚪自拍| 色哟哟日韩精品| 视频在线观看一区二区三区| 91同城在线观看| 日韩一区精品字幕| 337p粉嫩大胆噜噜噜噜噜91av| 不卡欧美aaaaa| 亚洲国产日韩精品| 91精品国产91久久综合桃花| 国产精品一区一区三区| 亚洲精品国产无套在线观| 欧美一区二区三区视频在线 | 日韩免费一区二区三区在线播放| 国产成人av影院| 亚洲国产视频一区二区| 色琪琪一区二区三区亚洲区| 午夜视频一区二区三区| 国产日韩欧美综合一区| 91视频在线看| 国产在线观看一区二区| 亚洲美女视频一区| 精品免费国产二区三区| 色综合欧美在线| 国产美女一区二区三区| 伊人一区二区三区| 精品久久99ma| 欧美色图在线观看| 成人国产精品免费| 另类成人小视频在线| 亚洲人午夜精品天堂一二香蕉| 日韩一级免费一区| 91美女片黄在线观看91美女| 国产一区二区三区在线观看免费视频 | 久久久久久久久免费| 一本久久a久久免费精品不卡| 精品在线观看免费| 亚洲国产一区二区三区| 欧美国产精品v| 日韩欧美一级片| 91福利国产成人精品照片| 国内一区二区视频| 日本欧美大码aⅴ在线播放| 国产精品大尺度| 久久久一区二区| 欧美欧美午夜aⅴ在线观看| 99久久99久久久精品齐齐| 久久国产尿小便嘘嘘| 亚洲国产一区在线观看| 一色屋精品亚洲香蕉网站| 久久亚洲免费视频| 欧美一区二区在线观看| 欧美日韩第一区日日骚| 91免费精品国自产拍在线不卡| 国产河南妇女毛片精品久久久 | 国产一本一道久久香蕉| 麻豆国产91在线播放| 午夜视黄欧洲亚洲| 亚洲综合999| 亚洲精选在线视频| 一区二区高清免费观看影视大全| 国产欧美在线观看一区| 久久久久一区二区三区四区| 精品毛片乱码1区2区3区| 欧美一区二区在线观看| 91精品欧美久久久久久动漫 | 精品国产一区二区三区久久影院 | 成人综合在线视频| 国产精品一区二区在线观看网站| 国产高清精品在线| 成人永久aaa| 色综合欧美在线视频区| 在线精品国精品国产尤物884a| 欧美午夜精品久久久久久超碰| 欧美日韩一区二区三区四区| 欧美久久久一区| 精品久久人人做人人爱| 久久久影视传媒| 成人欧美一区二区三区黑人麻豆 | 99国产精品国产精品久久| 色综合一区二区| 7777精品伊人久久久大香线蕉完整版| 欧美一区二区三区视频| 久久精品视频网| 亚洲图片激情小说| 日韩精品一级二级 | 亚洲电影视频在线| 人人爽香蕉精品| 粉嫩av一区二区三区在线播放| 91视频观看免费| 欧美精品乱码久久久久久按摩| 欧美日韩一级二级| 精品福利av导航| 亚洲人午夜精品天堂一二香蕉| 亚洲一二三四区| 国产又粗又猛又爽又黄91精品| 本田岬高潮一区二区三区| 日本精品裸体写真集在线观看 | 一区二区三区在线观看视频 | 久久精品国产在热久久| 成人教育av在线| 在线不卡免费欧美| 久久久久久久综合色一本| 亚洲欧美另类小说| 日韩成人伦理电影在线观看| 国产成人av电影免费在线观看| 一本色道**综合亚洲精品蜜桃冫| 日韩精品一区二区在线| 国产精品沙发午睡系列990531| 日日摸夜夜添夜夜添精品视频| 久久66热re国产| 在线观看av不卡| 久久久精品影视| 人人爽香蕉精品| 色哟哟日韩精品| 中文字幕第一区二区| 午夜欧美在线一二页| 成人ar影院免费观看视频| 91精品国产综合久久精品图片 | 久久久www成人免费毛片麻豆| 亚洲综合丝袜美腿| 成人国产视频在线观看| 欧美va日韩va| 日韩电影在线观看一区| 9人人澡人人爽人人精品| 久久女同精品一区二区| 天堂久久一区二区三区| 91看片淫黄大片一级在线观看| 久久久www成人免费无遮挡大片| 日韩成人精品在线| 欧美在线色视频| 亚洲精品国产a| 成人国产精品视频| 欧美激情一区二区三区在线| 狠狠色2019综合网| 日韩一区二区在线看片| 亚洲国产欧美在线人成| 91成人免费网站| 亚洲激情图片一区| 91色视频在线| 一区二区三区四区精品在线视频| 不卡高清视频专区| 久久久亚洲综合| 日韩电影免费一区| 91麻豆精品国产91久久久更新时间 |