|
Open Model Railroad Network (OpenMRN)
|
#include "Devtab.hxx"#include <cstdarg>#include <fcntl.h>#include <reent.h>#include <unistd.h>#include <sys/select.h>Go to the source code of this file.
Functions | |
| int | _open_r (struct _reent *reent, const char *path, int flags, int mode) |
| Open a file or device. | |
| int | _close_r (struct _reent *reent, int fd) |
| Close a file or device. | |
| ssize_t | _read_r (struct _reent *reent, int fd, void *buf, size_t count) |
| Read from a file or device. | |
| ssize_t | _write_r (struct _reent *reent, int fd, const void *buf, size_t count) |
| Write to a file or device. | |
| int | _stat_r (struct _reent *reent, const char *path, struct stat *stat) |
| Get the status information of a file or device. | |
| int | _fstat_r (struct _reent *reent, int fd, struct stat *stat) |
| Get the status information of a file or device. | |
| int | _isatty_r (struct _reent *reent, int fd) |
| Get the tty information of a file or device. | |
| int | _unlink_r (struct _reent *reent, const char *path) |
| remove a file. | |
| _off_t | _lseek_r (struct _reent *reent, int fd, _off_t offset, int whence) |
| Change the offset index of a file or device. | |
| int | fsync (int fd) |
| Synchronize (flush) a file to disk. | |
| int | ioctl (int fd, unsigned long int key,...) |
| Request and ioctl transaction. | |
| int | select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) |
| POSIX select(). | |
| int | fcntl (int fd, int cmd,...) |
| Manipulate a file descriptor. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This file implements the generic fileio.
Definition in file Fileio.cxx.
| int _close_r | ( | struct _reent * | reent, |
| int | fd | ||
| ) |
Close a file or device.
| reent | thread safe reentrant structure |
| fd | file descriptor to close |
Definition at line 347 of file Fileio.cxx.
| int _fstat_r | ( | struct _reent * | reent, |
| int | fd, | ||
| struct stat * | stat | ||
| ) |
Get the status information of a file or device.
| reent | thread safe reentrant structure |
| fd | file descriptor to get status of |
| stat | structure to fill status info into |
Definition at line 400 of file Fileio.cxx.
| int _isatty_r | ( | struct _reent * | reent, |
| int | fd | ||
| ) |
Get the tty information of a file or device.
| reent | thread safe reentrant structure |
| fd | file descriptor determine if it is a tty |
Definition at line 410 of file Fileio.cxx.
| _off_t _lseek_r | ( | struct _reent * | reent, |
| int | fd, | ||
| _off_t | offset, | ||
| int | whence | ||
| ) |
Change the offset index of a file or device.
| reent | thread safe reentrant structure |
| fd | file descriptor to seek |
| offset | offset within file |
| whence | type of seek to complete |
Definition at line 432 of file Fileio.cxx.
| int _open_r | ( | struct _reent * | reent, |
| const char * | path, | ||
| int | flags, | ||
| int | mode | ||
| ) |
Open a file or device.
| reent | thread safe reentrant structure |
| path | file or device name |
| flags | open flags |
| mode | open mode, ignored in this implementation |
Definition at line 331 of file Fileio.cxx.
| ssize_t _read_r | ( | struct _reent * | reent, |
| int | fd, | ||
| void * | buf, | ||
| size_t | count | ||
| ) |
Read from a file or device.
| reent | thread safe reentrant structure |
| fd | file descriptor to read |
| buf | location to place read data |
| count | number of bytes to read |
Definition at line 360 of file Fileio.cxx.
| int _stat_r | ( | struct _reent * | reent, |
| const char * | path, | ||
| struct stat * | stat | ||
| ) |
Get the status information of a file or device.
| reent | thread safe reentrant structure |
| path | file or device name |
| stat | structure to fill status info into |
Definition at line 383 of file Fileio.cxx.
| int _unlink_r | ( | struct _reent * | reent, |
| const char * | path | ||
| ) |
remove a file.
| reent | thread safe reentrant structure |
| path | file name |
Definition at line 420 of file Fileio.cxx.
| ssize_t _write_r | ( | struct _reent * | reent, |
| int | fd, | ||
| const void * | buf, | ||
| size_t | count | ||
| ) |
Write to a file or device.
| reent | thread safe reentrant structure |
| fd | file descriptor to write |
| buf | location to find write data |
| count | number of bytes to write |
Definition at line 372 of file Fileio.cxx.
| int fcntl | ( | int | fd, |
| int | cmd, | ||
| ... | |||
| ) |
Manipulate a file descriptor.
| fd | file descriptor |
| cmd | operation to perform |
| ... | parameter to the cmd operation |
Definition at line 494 of file Fileio.cxx.
| int fsync | ( | int | fd | ) |
Synchronize (flush) a file to disk.
| fd | file descriptor to synch |
Definition at line 441 of file Fileio.cxx.
| int ioctl | ( | int | fd, |
| unsigned long int | key, | ||
| ... | |||
| ) |
Request and ioctl transaction.
| fd | file descriptor |
| key | ioctl key |
| ... | key data |
Definition at line 452 of file Fileio.cxx.
| int select | ( | int | nfds, |
| fd_set * | readfds, | ||
| fd_set * | writefds, | ||
| fd_set * | exceptfds, | ||
| struct timeval * | timeout | ||
| ) |
POSIX select().
| nfds | highest numbered file descriptor in any of the three, sets plus 1 |
| readfds | fd_set of file descritpors to pend on read active |
| writefds | fd_set of file descritpors to pend on write active |
| exceptfds | fd_set of file descritpors to pend on error active |
| timeout | timeout value to wait, if 0, return immediately, if NULL wait forever |
Definition at line 473 of file Fileio.cxx.