BSPACM
20150113
Board Support Package for ARM Cortex-M Microcontrollers
|
#include <bspacm/newlib/fdops.h>
Data Fields | |
int(* | op_close )(struct sBSPACMnewlibFDOPSfile *fp) |
int(* | op_fstat )(struct sBSPACMnewlibFDOPSfile *fp, struct stat *buf) |
int(* | op_isatty )(struct sBSPACMnewlibFDOPSfile *fp) |
off_t(* | op_lseek )(struct sBSPACMnewlibFDOPSfile *fp, off_t offset, int whence) |
ssize_t(* | op_read )(struct sBSPACMnewlibFDOPSfile *fp, void *buf, size_t count) |
ssize_t(* | op_write )(struct sBSPACMnewlibFDOPSfile *fp, const void *buf, size_t count) |
int(* | op_ioctl )(struct sBSPACMnewlibFDOPSfile *fp, int request, va_list ap) |
Record for the implementations of file descriptor operations that are supported for a particular class of device.
Each operation has the standard POSIX environment interface and semantics, except that a hBSPACMnewlibFDOPSfile is passed instead of a descriptor.
The pointer to any operation may be null; if the corresponding operation is invoked the wrapper function will return an error after setting errno
to EBADF
(generally; some operations may use an alternative error code).
int(* sBSPACMnewlibFDOPSfileOps::op_close) (struct sBSPACMnewlibFDOPSfile *fp) |
Release all resources associated with the file.
In most cases, fBSPACMnewlibFDOPSdriver() will dynamically allocate a sBSPACMnewlibFDOPSfile instance. This operation is the one that must free that memory.
If unimplemented, close() fails with ENOSYS
.
close()
on the corresponding descriptor will remove the descriptor from xBSPACMnewlibFDOPSfile_. int(* sBSPACMnewlibFDOPSfileOps::op_fstat) (struct sBSPACMnewlibFDOPSfile *fp, struct stat *buf) |
Implementation for fstat(). If unimplemented, fstat() fails with ENOSYS
.
int(* sBSPACMnewlibFDOPSfileOps::op_ioctl) (struct sBSPACMnewlibFDOPSfile *fp, int request, va_list ap) |
Implementation for ioctl().
int(* sBSPACMnewlibFDOPSfileOps::op_isatty) (struct sBSPACMnewlibFDOPSfile *fp) |
Implementation for isatty(). If unimplemented, isatty() fails with ENOTTY
.
errno
. Do not return -1 from this implementation. off_t(* sBSPACMnewlibFDOPSfileOps::op_lseek) (struct sBSPACMnewlibFDOPSfile *fp, off_t offset, int whence) |
Implementation for lseek(). If unimplemented, lseek() fails with ENOSYS
.
ssize_t(* sBSPACMnewlibFDOPSfileOps::op_read) (struct sBSPACMnewlibFDOPSfile *fp, void *buf, size_t count) |
Implementation for read(). If unimplemented, read() fails with EBADF
.
ssize_t(* sBSPACMnewlibFDOPSfileOps::op_write) (struct sBSPACMnewlibFDOPSfile *fp, const void *buf, size_t count) |
Implementation for write(). If unimplemented, read() fails with EBADF
.