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

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

?? iolib.c

?? VxWorks操作系統內核源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* ioLib.c - I/O interface library *//* Copyright 1984-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------04z,31jan03,pmr  SPR 82273: fixed linkCount declaration in ioCreateOrOpen().		 SPR 80447: fixed remove() to follow symbolic links.04y,13jan03,gls  moved check for NULL name in ioCreateOrOpen() (SPR #82909)04x,02Aug00,jgn  merge DOT-4 pthreads code +		 add validation of null pointer for name as well as null string04w,03oct01,dcb  Fix SPR 20033 side effect --- handle new return code from                 iosFdSet.  Combine open() and creat() into one function.04v,01mar99,yp   SPR 21655 - if iosDevFind() fails open() dosn't free fd04u,21feb99,jdi  doc: listed errnos.04t,03sep97,dgp  doc: SPR 9023 - correct reference to FIOGETNAME in ioctl()04s,10jul97,dgp  doc: fix SPR 6117, rename() not supported on all devices04r,20oct95,jdi  doc: addition for rename() (SPR 4167); added bit values		    for open() and creat() flags (SPR 4276).04q,10feb95,rhp  added names of stdio fd macros to ioLib man page04p,26jul94,dvs  added doc for read/write if no driver routine (SPR #2019/2020).04o,30sep93,jmm  resubmitted change originally in scd 1014804n,08feb93,smb  changed int to size_t for read and write.04m,21jan93,jdi  documentation cleanup for 5.1.04l,29jul92,smb  added isatty for use by stdio library.04k,22jul92,kdl  Replaced delete() with remove().04j,18jul92,smb  Changed errno.h to errnoLib.h.04i,04jul92,jcf  scalable/ANSI/cleanup effort.04h,26may92,rrr  the tree shuffle04g,28feb92,wmd  added bzero() call in ioFullFileNameGet() to init to 0's		 fullPathName[] buffer before it is passed to subordinates.04f,05dec91,rrr  made lseek take posix arguments (SEEK_)04e,25nov91,llk  ansi stuff.  Modified remove() and rename().		 included stdio.h.04d,25nov91,rrr  cleanup of some ansi warings.04c,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 notice04b,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.04a,08feb91,jaa	 documentation cleanup.03z,15oct90,dnw  made ioFullFileNameGet() be NOMANUAL03y,05oct90,dnw  made readv, writev, ioDefDevGet, ioDefDirGet be NOMANUAL		 made ioFullFileNameGet() use pathCat()		 added chdir(), getcwd(), rename() for POSIX compliance		 added remove() for ANSI compliance		 added ioDefPathCat() (NOMANUAL)03x,06jun90,rdc  added readv and writev.03w,25may90,dnw  changed creat and open to NOT malloc filename before calling		   iosFdSet.  This is now left up to iosFdSet.03v,11may90,yao	 added missing modification history (03u) for the last checkin.03u,09may90,yao	 typecasted malloc to (char *).03t,01may90,llk  changed call to pathCat().  Now, pathCat() checks if a name		   is too long, and returns ERROR if it is.03s,14apr90,jcf  removed tcb extension dependencies.03r,01apr90,llk  changed ioFullFileNameGet() and ioDefPathSet() so that only		   filenames of MAX_FILENAME_LENGTH characters or less will		   be accepted.03q,14mar90,jdi  documentation cleanup.03p,12dec89,dab  documentation.03o,15nov89,dab  changed variable name mode to flag in creat().  documentation.            rdc  added unlink, getwd for unix compatibility.03n,02may89,dab  documentation touchup in lseek().03m,23mar89,dab  made L_XTND option work in lseek(); fixed L_INCR bug in		 lseek(); documentation touchup in creat().03l,23nov88,llk  fixed bug in handling multiple links.	    dnw  changed ioTaskStd{Set,Get} to take taskId arg.03k,08oct88,gae  made global standard fd array local.03j,07sep88,gae  documentation.03i,29aug88,gae  documentation.03h,15aug88,jcf  lint.03g,15jul88,llk  changed to allocate an fd name before calling iosFdSet or		   iosFdNew.03f,30jun88,llk  changed open and create so that they handle links.03e,04jun88,llk  uses a default path instead of a default device.		 changed ioDefDev to ioDefPath.		 added ioDefPathPrompt, ioDefPathShow, ioDefPathSet,		    ioDefPathGet, ioDefDirGet.		 rewrote ioDefDevGet.		 removed ioSetDefDev.		 added ioFullFileNameGet.03d,30may88,dnw  changed to v4 names.03c,28may88,dnw  deleted obsolete create().03b,27may88,llk  see change 03e above.03a,30mar88,gae  made I/O system, i.e. iosLib, responsible for low-level		   creat,open,read,write,close calls to drivers as		   fdTable & drvTable are now hidden.                 added parameters to open() for UNIX compatibility.		 made L_INCR option work in lseek().		 added io{G,S}et{Global,Task}Std().02u,19apr88,llk  added a parameter to open.  Inspired by NFS and aspirations		   toward UNIX compatibility.02t,31dec87,jlf  made creat and open follow links.02s,05nov87,jlf  documentation02r,30sep87,gae  removed usage of fdTable by using new iosFdSet().		 added FIOGETNAME to ioctl.02q,28aug87,dnw  changed creat() and open() to only treat ERROR (-1) as error		   indication from driver routines instead of < 0 to allow		   driver values (i.e. structure pointers) to be in memory		   with high bit set.02p,28apr87,gae  close() now returns status; added UNIX compatible creat().02o,24mar87,jlf  documentation02n,25feb87,ecs  minor documentation.		 added include of strLib.h.02m,14feb87,dnw  changed create(), open(), delete() to return ERROR if null		   filename is specified.  However, filename "." is turned		   into null filename before being passed to driver routine.02l,20dec86,dnw  fixed ioGetDefDevTail() to require complete match of dev name.		 changed to not get include files from default directories.02k,07oct86,gae	 added ioGetDefDevTail().02j,04sep86,jlf  minor documentation02i,01jul86,jlf  minor documentation02h,03apr86,llk	 fixed syntax error in lseek.02g,03mar86,jlf  changed ioctrl calls to ioctl.		 added lseek....deleted pre 86 history - see RCS*//*DESCRIPTIONThis library contains the interface to the basic I/O system.It includes:.iP "" 4Interfaces to the seven basic driver-provided functions:creat(), remove(), open(), close(), read(), write(), and ioctl()..iPInterfaces to several file system functions, includingrename() and lseek()..iPRoutines to set and get the current working directory..iPRoutines to assign task and global standard file descriptors.FILE DESCRIPTORSAt the basic I/O level, files are referred to by a file descriptor.A file descriptor is a small integer returned by a call to open() or creat().  The other basic I/O calls take a file descriptor as a parameter to specify the intended file.Three file descriptors are reserved and have special meanings:    0 (`STD_IN')  - standard input    1 (`STD_OUT') - standard output    2 (`STD_ERR') - standard error outputVxWorks allows two levels of redirection.  First, there is a globalassignment of the three standard file descriptors.  By default, new tasks usethis global assignment.  The global assignment of the three standardfile descriptors is controlled by the routines ioGlobalStdSet() and ioGlobalStdGet().Second, individual tasks may override the global assignment of thesefile descriptors with their own assignments that apply only to that task.  The assignment of task-specific standard file descriptors is controlled by the routines ioTaskStdSet() and ioTaskStdGet().  INCLUDE FILES: ioLib.hSEE ALSO: iosLib, ansiStdio,.pG "I/O System"*//* LINTLIBRARY */#include "vxWorks.h"#include "sys/types.h"#include "memLib.h"#include "ioLib.h"#include "iosLib.h"#include "string.h"#include "taskLib.h"#include "net/uio.h"#include "errnoLib.h"#include "stdio.h"#include "fcntl.h"#include "unistd.h"#include "pathLib.h"#include "string.h"#define __PTHREAD_SRC#include "pthread.h"IMPORT char ioDefPath [MAX_FILENAME_LENGTH];	/* current default i/o prefix */#define	STD_VALID(fd)	(((fd) >= 0) && ((fd) < 3))/* globals */BOOL ioMaxLinkLevels = 20;	/* maximum number of symlinks to traverse *//* forward declarations */LOCAL int ioCreateOrOpen (const char *name, int flags, int mode, BOOL create);/* locals */LOCAL int ioStdFd [3];		/* global standard input/output/error *//********************************************************************************* creat - create a file** This routine creates a file called <name> and opens it with a specified* <flag>.  This routine determines on which device to create the file; * it then calls the create routine of the device driver to do most of the work.* Therefore, much of what transpires is device/driver-dependent.** The parameter <flag> is set to O_RDONLY (0), O_WRONLY (1), or O_RDWR (2)* for the duration of time the file is open.  To create NFS files with a* UNIX chmod-type file mode, call open() with the file mode specified in* the third argument.** INTERNAL* A driver's create routine will return FOLLOW_LINK if any part of the file name* contains a link (in the directory path).  In this case, it will also* have changed the name of the file being opened to incorporate the name of* the link.  The new file name is then repeatedly resubmitted to the driver's* open routine until all links are resolved.** NOTE* For more information about situations when there are no file descriptors* available, see the manual entry for iosInit().** RETURNS:* A file descriptor number, or ERROR if a filename is not specified, the* device does not exist, no file descriptors are available, or the driver* returns ERROR.** SEE ALSO: open()**/int creat    (    const char *name,   /* name of the file to create    */    int        flag   	/* O_RDONLY, O_WRONLY, or O_RDWR */    )    {    return ioCreateOrOpen (name, flag, 0, TRUE);    }/********************************************************************************* open - open a file** This routine opens a file for reading, writing, or updating, and returns* a file descriptor for that file.  The arguments to open() are the filename * and the type of access:** .TS* tab(|);* 8l l l.* O_RDONLY  (0)    |(or READ)   |- open for reading only.* O_WRONLY  (1)    |(or WRITE)  |- open for writing only.* O_RDWR  (2)      |(or UPDATE) |- open for reading and writing.* O_CREAT  (0x0200)|            |- create a file.* .TE** In general, open() can only open pre-existing devices and files.  However,* for NFS network devices only, files can also be created with open() by* performing a logical OR operation with O_CREAT and the <flags> argument.* In this case, the file is created with a UNIX chmod-style file mode, as* indicated with <mode>.  For example:* .CS*     fd = open ("/usr/myFile", O_CREAT | O_RDWR, 0644);* .CE* Only the NFS driver uses the <mode> argument.** INTERNAL* A driver's open routine will return FOLLOW_LINK if any part of the file name* contains a link (directory path or file name).  In this case, it will also* have changed the name of the file being opened to incorporate the name of* the link.  The new file name is then repeatedly resubmitted to the driver's* open routine until all links are resolved.** NOTE* For more information about situations when there are no file descriptors* available, see the manual entry for iosInit().** RETURNS:* A file descriptor number, or ERROR if a file name is not specified, the* device does not exist, no file descriptors are available, or the driver* returns ERROR.** ERRNO: ELOOP** SEE ALSO: creat()** VARARGS2**/int open    (    const char *name,   /* name of the file to open                  */    int flags,          /* O_RDONLY, O_WRONLY, O_RDWR, or O_CREAT    */    int mode            /* mode of file to create (UNIX chmod style) */    )    {    return ioCreateOrOpen (name, flags, mode, FALSE);    }/********************************************************************************* ioCreateOrOpen - creat() or open() a file** This is the worker function for creat() and for open().  See their* descriptions.** NOMANUAL*/LOCAL int ioCreateOrOpen    (    const char *name,   /* name of the file to create    */    int        flags,   /* O_RDONLY, O_WRONLY, O_RDWR or O_CREAT (open call) */    int        mode,    /* mode of ile to create (if open call) */    BOOL       create   /* set to TRUE if this is a creat() call */    )    {    DEV_HDR *pDevHdr1;    DEV_HDR *pDevHdr2 = NULL;    int     value;    int     fd = (int)ERROR;    char    fullFileName [MAX_FILENAME_LENGTH];    int     error = 0;    int linkCount = 1;    char *pPartFileName;    int savtype;        /* don't allow null filename (for user protection) but change     * "." into what null filename would be if we allowed it */    if ((name == NULL) || (name[0] == EOS))	{	errnoSet (S_ioLib_NO_FILENAME);	/* fd is already defined as ERROR */	return (fd);	}    if (_func_pthread_setcanceltype != NULL)        {        _func_pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &savtype);        }    if (strcmp (name, ".") == 0)	{	/* point to EOS (turn it into null filename) */	++name;	}        if (ioFullFileNameGet (name, &pDevHdr1, fullFileName) == ERROR)	{	error = 1;	goto handleError;	}        if ((fd = iosFdNew (pDevHdr1, (char *)NULL, 0)) == ERROR)	{	error = 1;	goto handleError;	}        if (create == TRUE)	{	value = iosCreate (pDevHdr1, fullFileName, flags);	}    else	{	value = iosOpen (pDevHdr1, fullFileName, flags, mode);	}        if (value == ERROR)	{	error = 2;	goto handleError;	}        /* In case the path does not follow the while loop, get the pDevHdr1       recorded in pDevHdr2 for error handling. */    pDevHdr2 = pDevHdr1;        while (value == FOLLOW_LINK)	{	/* if a file name contains a link, the driver's create routine changed	 * fullFileName to incorporate the link's name. Try to create the file	 * that the driver's create routine handed back.	 */	if (linkCount++ > ioMaxLinkLevels)	    {	    errno = ELOOP;	    error = 2;	    goto handleError;	    }	if ((pDevHdr2 = iosDevFind (fullFileName, &pPartFileName)) == NULL)	    {	    error = 2;	    goto handleError;	    }	if (fullFileName != pPartFileName)	    {	    /* link file name starts with a vxWorks device name,	     * possibly a different device from the current one.	     */	    strncpy (fullFileName, pPartFileName, MAX_FILENAME_LENGTH);	    pDevHdr1 = pDevHdr2;	    }		if (create == TRUE)	    {	    value = iosCreate (pDevHdr1, fullFileName, flags);	    }	else	    {	    value = iosOpen (pDevHdr1, fullFileName, flags, mode);	    }		if (value == ERROR)	    {	    error = 2;	    goto handleError;	    }		}        if ((iosFdSet (fd, pDevHdr1, CHAR_FROM_CONST(name), value)) == ERROR)	{	error = 3;   	goto handleError;	}    if (_func_pthread_setcanceltype != NULL)        {        _func_pthread_setcanceltype(savtype, NULL);        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产999大香线蕉| 亚洲国产精品二十页| 在线免费观看视频一区| 99九九99九九九视频精品| 国产一区美女在线| 国内精品嫩模私拍在线| 美女看a上一区| 国产综合久久久久影院| 国产一区二区三区四区在线观看| 韩国一区二区三区| 国产黄色精品视频| 99国产精品国产精品毛片| 91毛片在线观看| 777色狠狠一区二区三区| 日韩欧美一二三| 国产精品免费视频一区| 亚洲伦理在线精品| 免费不卡在线视频| 国产成人精品网址| 欧美午夜不卡视频| 欧美大片一区二区| 成人欧美一区二区三区| 亚洲国产成人porn| 国产一区二区三区在线观看免费视频| 高清beeg欧美| 欧美伦理影视网| 精品国产免费视频| 综合精品久久久| 视频一区二区国产| 成人app网站| 3d成人动漫网站| 国产精品无圣光一区二区| 亚洲一区二区精品视频| 国产伦精品一区二区三区免费 | 欧美mv日韩mv国产| 国产精品麻豆一区二区| 一区二区免费看| 日本女优在线视频一区二区| av在线不卡网| 精品国产99国产精品| 亚洲人成小说网站色在线| 蓝色福利精品导航| 欧美性大战久久久久久久蜜臀 | 成人永久aaa| 欧美精品一卡两卡| 国产精品久久影院| 麻豆久久久久久久| 99精品一区二区| 精品国产乱码久久久久久1区2区| 亚洲男人电影天堂| 国产成人精品免费网站| 日韩精品中文字幕在线不卡尤物| 国产精品国产三级国产三级人妇| 久久99精品一区二区三区三区| 97久久精品人人做人人爽50路| 精品伦理精品一区| 日韩二区三区四区| 在线电影院国产精品| 一区二区三区毛片| 99免费精品在线观看| 久久精品亚洲精品国产欧美kt∨| 日韩精品成人一区二区在线| 在线亚洲人成电影网站色www| 欧美激情中文不卡| 国产一区二区成人久久免费影院| 欧美一区二区美女| 青青草一区二区三区| 欧美色图天堂网| 亚洲精品免费在线| 色综合久久88色综合天天免费| 国产亚洲欧美中文| 精品一区二区三区影院在线午夜| 91精品国模一区二区三区| 日韩制服丝袜av| 欧美亚洲禁片免费| 亚洲第一久久影院| 欧美日韩三级在线| 青青草国产精品亚洲专区无| 欧美一区二区三区免费在线看| 午夜精品久久久久影视| 7777精品伊人久久久大香线蕉| 午夜久久久影院| 欧美一区二区成人| 精品一区二区精品| 国产欧美精品日韩区二区麻豆天美| 国产精品一区二区x88av| 久久精品免费在线观看| 波多野结衣中文字幕一区二区三区 | 日本不卡一区二区| 欧美一级高清大全免费观看| 美女在线观看视频一区二区| www成人在线观看| 国产成人免费视频一区| 亚洲欧美国产77777| 欧美性色aⅴ视频一区日韩精品| 婷婷开心激情综合| 国产午夜精品一区二区三区嫩草| 成人午夜av在线| 亚洲一区在线看| 精品电影一区二区三区| 国产不卡一区视频| 亚洲五码中文字幕| 欧美成人乱码一区二区三区| 国产91精品露脸国语对白| 亚洲视频在线观看一区| 欧美精品亚洲二区| 国产.精品.日韩.另类.中文.在线.播放| 国产精品久久国产精麻豆99网站| 欧美午夜视频网站| 精品国产一区二区在线观看| 久久国产精品露脸对白| 国产精品天干天干在线综合| 欧美四级电影在线观看| 国产一区二区成人久久免费影院 | 中文无字幕一区二区三区| 色综合天天性综合| 亚洲激情中文1区| 日韩一区二区三区高清免费看看| 国产盗摄精品一区二区三区在线 | 成人黄色综合网站| 天天射综合影视| 日韩一区中文字幕| 精品国产乱码久久久久久久久| 精品无码三级在线观看视频| 久久久精品国产免大香伊| 色国产综合视频| 日本国产一区二区| 久久97超碰国产精品超碰| 天堂在线亚洲视频| 丁香一区二区三区| 中文字幕的久久| 91视频在线观看| 一区二区三区四区在线播放| 日韩午夜小视频| 日韩一级片网址| 成人av在线网| 国产精品色眯眯| 精品视频999| 精品一区二区三区视频| 不卡视频在线观看| 婷婷久久综合九色综合绿巨人 | 成人午夜视频网站| 国产精品免费av| 91首页免费视频| 亚洲精品久久久蜜桃| 日韩一区二区免费在线电影| 91福利在线观看| 国产成人av影院| 欧美精品九九99久久| 成人免费毛片嘿嘿连载视频| 国精产品一区一区三区mba视频| 亚洲123区在线观看| 亚洲r级在线视频| 天天色天天操综合| 日本不卡123| 久久99国产精品尤物| 国产一区二区三区四区五区入口 | 欧美区视频在线观看| 色哦色哦哦色天天综合| 色哟哟一区二区| 91国在线观看| 欧美日韩免费在线视频| 欧美日韩国产影片| 欧美成人一区二区三区片免费| 欧美一区二区免费视频| 精品国产乱码久久久久久久久| 久久精品一区二区三区av| 亚洲欧洲精品成人久久奇米网| 亚洲欧洲中文日韩久久av乱码| 伊人一区二区三区| 日韩国产一区二| 国产精品18久久久久久久久 | 捆绑调教美女网站视频一区| 美女www一区二区| 国产成人啪免费观看软件| 色悠久久久久综合欧美99| 欧美日韩国产在线播放网站| 欧美精品一区视频| 亚洲欧美影音先锋| 男人操女人的视频在线观看欧美| 国产成人一区在线| 欧美午夜一区二区三区免费大片| 精品国产成人在线影院 | 欧美一区二区三区四区五区 | 国产寡妇亲子伦一区二区| 97久久超碰精品国产| 欧美一区二区三区在线| 国产精品美女久久福利网站| 性做久久久久久久久| 国产成人午夜99999| 欧洲一区在线电影| 国产亚洲精品超碰| 图片区小说区区亚洲影院| 国产成人高清视频| 欧美精品第1页| 亚洲欧美视频在线观看视频| 国产一区在线视频| 91精品国产欧美一区二区成人| 中文字幕视频一区| 国产精品白丝av|