⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iolib.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<hr><a name="close"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>close</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>close</i>(&nbsp;)</strong> - close a file</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS close    (    int fd /* file descriptor to close */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine closes the specified file and frees the file descriptor.It calls the device driver to do the work.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The status of the driver close routine, or ERROR if the file descriptor is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b><hr><a name="rename"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>rename</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>rename</i>(&nbsp;)</strong> - change the name of a file</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int rename    (    const char * oldname, /* name of file to rename */    const char * newname  /* name with which to rename file */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine changes the name of a file from <i>oldfile</i> to <i>newfile</i>.<p></blockquote><h4>NOTE</h4><blockquote><p>Only certain devices support <b><i><a href="./ioLib.html#rename">rename</a></i>(&nbsp;)</b>.  To confirm that your devicesupports it, consult the respective <b>xxDrv</b> or xxFs listings to verify thatioctl FIORENAME exists.  For example, dosFs and rt11Fs support <b><i><a href="./ioLib.html#rename">rename</a></i>(&nbsp;)</b>,but <b><a href="./netDrv.html#top">netDrv</a></b> and <b><a href="./nfsDrv.html#top">nfsDrv</a></b> do not.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the file could not be opened or renamed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b><hr><a name="read"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>read</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>read</i>(&nbsp;)</strong> - read bytes from a file or device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int read    (    int    fd,      /* file descriptor from which to read */    char * buffer,  /* pointer to buffer to receive bytes */    size_t maxbytes /* max no. of bytes to read into buffer */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine reads a number of bytes (less than or equal to <i>maxbytes</i>)from a specified file descriptor and places them in <i>buffer</i>.  It callsthe device driver to do the work.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of bytes read (between 1 and <i>maxbytes</i>, 0 if end of file), orERROR if the file descriptor does not exist, the driver does not havea read routines, or the driver returns ERROR. If the driver does not have a read routine, errno is set to ENOTSUP.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b><hr><a name="write"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>write</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>write</i>(&nbsp;)</strong> - write bytes to a file</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int write    (    int    fd,     /* file descriptor on which to write */    char * buffer, /* buffer containing bytes to be written */    size_t nbytes  /* number of bytes to write */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine writes <i>nbytes</i> bytes from <i>buffer</i> to a specified filedescriptor <i>fd</i>.  It calls the device driver to do the work.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of bytes written (if not equal to <i>nbytes</i>, an error hasoccurred), or ERROR if the file descriptor does not exist, the driverdoes not have a write routine, or the driver returns ERROR. If the driverdoes not have a write routine, errno is set to ENOTSUP.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b><hr><a name="ioctl"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ioctl</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ioctl</i>(&nbsp;)</strong> - perform an I/O control function</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ioctl    (    int fd,       /* file descriptor */    int function, /* function code */    int arg       /* arbitrary argument */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine performs an I/O control function on a device.  The controlfunctions used by VxWorks device drivers are defined in the header file<b>ioLib.h</b>.  Most requests are passed on to the driver for handling.Since the availability of <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> functions is driver-specific, thesefunctions are discussed separately in <b><a href="./tyLib.html#top">tyLib</a></b>, <b><a href="./pipeDrv.html#top">pipeDrv</a></b>, <b><a href="./nfsDrv.html#top">nfsDrv</a></b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>,<b><a href="./rt11FsLib.html#top">rt11FsLib</a></b>, and rawFsLib.<p>The following example renames the file or directory to the string "newname":<p><pre>    ioctl (fd, FIORENAME, "newname");</pre>Note that the function FIOGETNAME is handled by the I/O interface level andis not passed on to the device driver itself.  Thus this function code valueshould not be used by customer-written drivers.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The return value of the driver, or ERROR if the file descriptor does not exist.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b>, <b><a href="./tyLib.html#top">tyLib</a></b>, <b><a href="./pipeDrv.html#top">pipeDrv</a></b>, <b><a href="./nfsDrv.html#top">nfsDrv</a></b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./rt11FsLib.html#top">rt11FsLib</a></b>, <b><a href="./rawFsLib.html#top">rawFsLib</a></b>,  <i>VxWorks Programmer's Guide: I/O System, Local File Systems</i><p>VARARGS2<hr><a name="lseek"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lseek</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lseek</i>(&nbsp;)</strong> - set a file read/write pointer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int lseek    (    int  fd,     /* file descriptor */    long offset, /* new byte offset to seek to */    int  whence  /* relative file position */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the file read/write pointer of file <i>fd</i> to <i>offset</i>.The argument <i>whence</i>, which affects the file position pointer,has three values:<p><table><tr valign=top><td align=left><b>SEEK_SET</b>  (0) </td><td align=left>- set to <i>offset</i></tr><tr valign=top><td align=left><b>SEEK_CUR</b>  (1) </td><td align=left>- set to current position plus <i>offset</i></tr><tr valign=top><td align=left><b>SEEK_END</b>  (2) </td><td align=left>- set to the size of the file plus <i>offset</i></tr><tr valign=top><td align=left></tr></tr></table>This routine calls <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> with functions FIOWHERE, FIONREAD, and FIOSEEK.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The new offset from the beginning of the file, or ERROR.<p></blockquote><h4>ARGSUSED</h4><blockquote><p>SEE ALSO<b><a href="./ioLib.html#top">ioLib</a></b><hr><a name="ioDefPathSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ioDefPathSet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ioDefPathSet</i>(&nbsp;)</strong> - set the current default path</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ioDefPathSet    (    char * name /* name of the new default device and path */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the default I/O path.  All relative pathnames specifiedto the I/O system will be prepended with this pathname.  This pathnamemust be an absolute pathname, i.e., <i>name</i> must begin with an existingdevice name.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the first component of the pathname is not an existingdevice.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b>, <b><i><a href="./ioLib.html#ioDefPathGet">ioDefPathGet</a></i>(&nbsp;)</b>, <b><i><a href="./ioLib.html#chdir">chdir</a></i>(&nbsp;)</b>, <b><i><a href="./ioLib.html#getcwd">getcwd</a></i>(&nbsp;)</b><hr><a name="ioDefPathGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ioDefPathGet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ioDefPathGet</i>(&nbsp;)</strong> - get the current default path</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void ioDefPathGet    (

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -