APM:Libraries
|
POSIX wrapper for FatFS. More...
Go to the source code of this file.
Functions | |
int | isatty (int fileno) |
Test POSIX fileno if it is a Serial Console/TTY. More... | |
int | fgetc (FILE *stream) |
Get byte from a TTY device or FatFs file stream open() or fopen() sets stream->get = fatfs_getc() for FatFs functions See fdevopen() sets stream->get for TTY devices. More... | |
int | getc (FILE *fp) |
int | fputc (int c, FILE *stream) |
Put a byte to TTY device or FatFs file stream open() or fopen() sets stream->put = fatfs_outc() for FatFs functions See fdevopen() sets stream->put get for TTY devices. More... | |
void | clearerr (FILE *stream) |
int | getchar () |
functions normally defined as macros More... | |
int | putchar (int c) |
put a character to stdout See fdevopen() sets stream->put get for TTY devices More... | |
int | putc (int c, FILE *stream) |
Un-Get byte from a TTY device or FatFs file stream. More... | |
char * | fgets (char *str, int size, FILE *stream) |
get a string from stdin See fdevopen() sets stream->put get for TTY devices More... | |
char * | gets (char *p) |
int | fputs (const char *str, FILE *stream) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices More... | |
int | puts (const char *str) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices More... | |
int | feof (FILE *stream) |
feof reports if the stream is at EOF More... | |
int | fgetpos (FILE *stream, size_t *pos) |
POSIX get position of file stream. More... | |
int | fseek (FILE *stream, long offset, int whence) |
POSIX seek to file possition. More... | |
int | fsetpos (FILE *stream, size_t *pos) |
POSIX set position of file stream. More... | |
long | ftell (FILE *stream) |
POSIX file position of open stream. More... | |
off_t | lseek (int fileno, off_t position, int whence) |
POSIX seek to file position. More... | |
void | rewind (FILE *stream) |
POSIX rewind file to the beginning. More... | |
int | close (int fileno) |
POSIX Close a file with fileno handel. More... | |
int | fileno (FILE *stream) |
Convert POSIX stream pointer to POSIX fileno (index of __iob[]) More... | |
FILE * | fileno_to_stream (int fileno) |
Convert POSIX fileno to POSIX FILE stream pointer. NOT POSIX. More... | |
FILE * | fopen (const char *path, const char *mode) |
POSIX Open a file with path name and ascii file mode string. More... | |
size_t | __wrap_fread (void *ptr, size_t size, size_t nmemb, FILE *stream) |
POSIX read nmemb elements from buf, size bytes each, to the stream fd. More... | |
int | ftruncate (int fd, off_t length) |
POSIX truncate open file to length. More... | |
size_t | fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) |
POSIX write nmemb elements from buf, size bytes each, to the stream fd. More... | |
int | open (const char *pathname, int flags) |
POSIX Open a file with integer mode flags. More... | |
ssize_t | read (int fd, void *buf, size_t count) |
POSIX read count bytes from *buf to fileno fd. More... | |
void | sync (void) |
POSIX Sync all pending file changes and metadata on ALL files. More... | |
int | syncfs (int fd) |
POSIX Sync pending file changes and metadata for specified fileno. More... | |
int | truncate (const char *path, off_t length) |
POSIX truncate named file to length. More... | |
ssize_t | write (int fd, const void *buf, size_t count) |
POSIX Write count bytes from *buf to fileno fd. More... | |
FILE * | __wrap_freopen (const char *filename, const char *mode, FILE *stream) |
int | __wrap_fclose (FILE *stream) |
POSIX close a file stream. More... | |
int | stat (const char *name, struct stat *buf) |
Display struct stat, from POSIX stat(0 or fstat(), in ASCII. NOT POSIX. More... | |
int | utime (const char *filename, const struct utimbuf *times) |
Set Modification and Access time of a file. More... | |
int64_t | fs_getfree () |
int64_t | fs_gettotal () |
char * | basename (const char *str) |
POSIX Basename of filename. More... | |
char * | baseext (char *str) |
File extention of a file name. NOT POSIX. More... | |
int | chdir (const char *pathname) |
POSIX change directory. More... | |
int | chmod (const char *pathname, mode_t mode) |
POSIX chmod function - change file access permission Unfortunately file f_open modes and f_chmod modes are not the same Files that are open have way more options - but only while the file is open. More... | |
int | dirname (char *str) |
POSIX directory name of a filename. Return the index of the last '/' character. More... | |
char * | getcwd (char *pathname, int len) |
POSIX get current working directory. More... | |
int | mkdir (const char *pathname, mode_t mode) |
POSIX make a directory. More... | |
int | rename (const char *oldpath, const char *newpath) |
POSIX rename a file by name. More... | |
int | rmdir (const char *pathname) |
POSIX delete a directory. More... | |
int | unlink (const char *pathname) |
POSIX delete a file. More... | |
int | remove (const char *pathname) |
int | closedir (DIR *dirp) |
POSIX closedir. More... | |
DIR * | opendir (const char *pathdir) |
dirent_t * | readdir (DIR *dirp) |
void | clrerror (FILE *stream) |
clrerror resets stream EOF and error flags More... | |
int | ferror (FILE *stream) |
ferror reports if the stream has an error flag set More... | |
void | perror (const char *s) |
POSIX perror() - convert POSIX errno to text with user message. More... | |
char * | strerror (int errnum) |
POSIX strerror() - convert POSIX errno to text with user message. More... | |
char * | __wrap_strerror_r (int errnum, char *buf, size_t buflen) |
POSIX strerror_r() - convert POSIX errno to text with user message. More... | |
FILE * | fdevopen (int(*put)(char, FILE *), int(*get)(FILE *)) |
Device open functions. More... | |
int | fatfs_getc (FILE *stream) |
Formt SD card. More... | |
int | fatfs_putc (char c, FILE *stream) |
Private FatFs function called by fputc() to put a byte from file stream NOT POSIX open() assigns stream->put = fatfs_putc() More... | |
int | fatfs_to_errno (FRESULT Result) |
Convert FafFs error result to POSIX errno. NOT POSIX. More... | |
int | fatfs_to_fileno (FIL *fh) |
Convert FatFS file handle to POSIX fileno. NOT POSIX. More... | |
static time_t | replace_mktime (const struct tm *t) |
time_t | fat_time_to_unix (uint16_t date, uint16_t time) |
Convert FatFs file date and time to POSIX epoch seconds. NOT POSIX. More... | |
void | unix_time_to_fat (time_t epoch, uint16_t *date, uint16_t *time) |
Convert Linux POSIX time_t to FAT32 date and time. NOT POSIX. More... | |
FIL * | fileno_to_fatfs (int fileno) |
Convert POSIX fileno to FatFS handle NOT POSIX. More... | |
int | free_file_descriptor (int fileno) |
Free POSIX fileno FILE descriptor. NOT POSIX. More... | |
int | new_file_descriptor (void) |
Allocate a POSIX FILE descriptor. NOT POSIX. More... | |
int | posix_fopen_modes_to_open (const char *mode) |
Convert POSIX fopen mode to POSIX open mode flags. NOT POSIX. More... | |
int | fprintf (FILE *fp, const char *fmt,...) |
fprintf character write function More... | |
int | fsync (int fileno) |
Variables | |
int | errno |
Note: fdevopen assigns stdin,stdout,stderr. More... | |
FILE * | __iob [MAX_FILES] |
POSIX fileno to POSIX FILE stream table. More... | |
const char * | sys_errlist [] |
POSIX error messages for each errno value. More... | |
static DIR | _dp |
POSIX opendir. More... | |
static dirent_t | _de |
POSIX opendir. More... | |
POSIX wrapper for FatFS.
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file posix.c.
int __wrap_fclose | ( | FILE * | stream | ) |
size_t __wrap_fread | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
FILE * | stream | ||
) |
POSIX read nmemb elements from buf, size bytes each, to the stream fd.
[in] | ptr | buffer. |
[in] | nmemb | number of items to read. |
[in] | size | size of each item in bytes. |
[in] | stream | POSIX file stream. |
Definition at line 793 of file posix.c.
FILE* __wrap_freopen | ( | const char * | filename, |
const char * | mode, | ||
FILE * | stream | ||
) |
char* __wrap_strerror_r | ( | int | errnum, |
char * | buf, | ||
size_t | buflen | ||
) |
POSIX strerror_r() - convert POSIX errno to text with user message.
[in] | errnum | index for sys_errlist[] |
[in] | buf | user buffer for error message |
[in] | buflen | length of user buffer for error message |
char* baseext | ( | char * | str | ) |
char* basename | ( | const char * | str | ) |
int chdir | ( | const char * | pathname | ) |
POSIX change directory.
[in] | pathname | directory to change to |
Definition at line 1489 of file posix.c.
Referenced by SITL::JSBSim::start_JSBSim().
int chmod | ( | const char * | pathname, |
mode_t | mode | ||
) |
POSIX chmod function - change file access permission Unfortunately file f_open modes and f_chmod modes are not the same Files that are open have way more options - but only while the file is open.
man page chmod (2).
[in] | pathname | filename string. |
[in] | mode | POSIX chmod modes. |
Definition at line 1514 of file posix.c.
Referenced by mkdir().
int close | ( | int | fileno | ) |
POSIX Close a file with fileno handel.
[in] | fileno | fileno of file. |
Definition at line 675 of file posix.c.
Referenced by __wrap_fclose(), __wrap_freopen(), HALSITL::UARTDriver::_check_reconnect(), Linux::GPIO_Sysfs::_export_pin(), PX4::PX4Storage::_mtd_load(), VRBRAIN::VRBRAINStorage::_mtd_load(), PX4::PX4Storage::_mtd_write(), VRBRAIN::VRBRAINStorage::_mtd_write(), Linux::OpticalFlow_Onboard::_run_optflow(), Linux::Storage::_storage_create(), PX4::PX4Storage::_storage_open(), VRBRAIN::VRBRAINStorage::_storage_open(), HALSITL::UARTDriver::_tcp_start_client(), HALSITL::UARTDriver::_tcp_start_connection(), Linux::Storage::_timer_tick(), AP_RPM_PX4_PWM::AP_RPM_PX4_PWM(), AP_RangeFinder_BBB_PRU::detect(), AP_RangeFinder_PX4_PWM::detect(), VRBRAIN::VRBRAINRCOutput::enable_px4io_sbus_out(), PX4::PX4RCOutput::enable_px4io_sbus_out(), PX4::PX4UARTDriver::end(), VRBRAIN::VRBRAINUARTDriver::end(), GCS_MAVLINK::handle_preflight_reboot(), Linux::RCOutput_ZYNQ::init(), Linux::RCInput_ZYNQ::init(), Linux::RCInput_PRU::init(), Linux::RCOutput_PRU::init(), Linux::Storage::init(), Linux::RCOutput_AioPRU::init(), Linux::RCInput_SBUS::init(), Linux::RCInput_AioPRU::init(), Linux::GPIO_RPI::init(), Linux::GPIO_BBB::init(), Linux::RCInput_RPI::map_peripheral(), Linux::Memory_table::Memory_table(), Linux::VideoIn::open_device(), Linux::Poller::Poller(), AP_BoardConfig::px4_setup_pwm(), AP_BoardConfig::px4_setup_safety_mask(), PX4::PX4RCInput::rc_bind(), Linux::GPIO_Sysfs::read(), PX4::PX4Util::run_debug_shell(), VRBRAIN::VRBRAINUtil::run_debug_shell(), AnalogSource_Navio2::set_channel(), AP_Camera::setup_feedback_callback(), Linux::TimerPollable::setup_timer(), PX4::NSHShellStream::shell_thread(), VRBRAIN::NSHShellStream::shell_thread(), SITL::JSBSim::start_JSBSim(), SITL::last_letter::start_last_letter(), Linux::GPIO_Sysfs::write(), Linux::Util::write_file(), AP_RangeFinder_PX4_PWM::~AP_RangeFinder_PX4_PWM(), AP_RPM_PX4_PWM::~AP_RPM_PX4_PWM(), Linux::DigitalSource_Sysfs::~DigitalSource_Sysfs(), Linux::I2CBus::~I2CBus(), Linux::Led_Sysfs::~Led_Sysfs(), Linux::Pollable::~Pollable(), Linux::Poller::~Poller(), Linux::PWM_Sysfs_Base::~PWM_Sysfs_Base(), Linux::RCInput_UART::~RCInput_UART(), and Linux::SPIBus::~SPIBus().
int closedir | ( | DIR * | dirp | ) |
POSIX closedir.
[in] | dirp | DIR * directory handle |
Definition at line 1730 of file posix.c.
Referenced by Linux::I2CDeviceManager::get_device().
void clrerror | ( | FILE * | stream | ) |
int dirname | ( | char * | str | ) |
POSIX directory name of a filename. Return the index of the last '/' character.
[in] | str | string to examine. |
Definition at line 1552 of file posix.c.
Referenced by Linux::I2CDeviceManager::get_device().
time_t fat_time_to_unix | ( | uint16_t | date, |
uint16_t | time | ||
) |
Convert FatFs file date and time to POSIX epoch seconds. NOT POSIX.
[in] | date | FatFs date. |
[in] | time | FatFs time. |
Definition at line 2282 of file posix.c.
Referenced by stat().
int fatfs_getc | ( | FILE * | stream | ) |
Formt SD card.
[in] | *name | device name void Private FatFs function called by fgetc() to get a byte from file stream FIXME buffer this function call NOT POSIX open() assigns stream->get = fatfs_getc() |
[in] | stream | POSIX stream pointer. |
Definition at line 1997 of file posix.c.
Referenced by open().
int fatfs_putc | ( | char | c, |
FILE * | stream | ||
) |
Private FatFs function called by fputc() to put a byte from file stream NOT POSIX open() assigns stream->put = fatfs_putc()
[in] | c | character. |
[in] | stream | POSIX stream pointer. |
Definition at line 2087 of file posix.c.
Referenced by fputc(), and open().
int fatfs_to_errno | ( | FRESULT | Result | ) |
Convert FafFs error result to POSIX errno. NOT POSIX.
[in] | Result | FatFs Result code. |
Definition at line 2127 of file posix.c.
Referenced by chdir(), chmod(), close(), closedir(), fatfs_getc(), fatfs_putc(), fsync(), ftruncate(), getcwd(), lseek(), mkdir(), open(), opendir(), read(), readdir(), remove(), rename(), rmdir(), stat(), syncfs(), truncate(), unlink(), utime(), and write().
int fatfs_to_fileno | ( | FIL * | fh | ) |
FILE* fdevopen | ( | int(*)(char, FILE *) | put, |
int(*)(FILE *) | get | ||
) |
int feof | ( | FILE * | stream | ) |
int ferror | ( | FILE * | stream | ) |
int fgetc | ( | FILE * | stream | ) |
Get byte from a TTY device or FatFs file stream open() or fopen() sets stream->get = fatfs_getc() for FatFs functions See fdevopen() sets stream->get for TTY devices.
[in] | stream | POSIX stream pointer. |
Definition at line 205 of file posix.c.
Referenced by fgets(), getc(), getchar(), and read().
int fgetpos | ( | FILE * | stream, |
size_t * | pos | ||
) |
char* fgets | ( | char * | str, |
int | size, | ||
FILE * | stream | ||
) |
get a string from stdin See fdevopen() sets stream->put get for TTY devices
POSIX string I/O
[in] | stream | POSIX stream pointer. |
Definition at line 398 of file posix.c.
Referenced by Linux::UtilRPI::_check_rpi_version(), atob(), Linux::Util::get_hw_arm32(), gets(), and AP_Param::parse_param_line().
int fileno | ( | FILE * | stream | ) |
Convert POSIX stream pointer to POSIX fileno (index of __iob[])
[in] | stream | stream pointer |
Definition at line 714 of file posix.c.
Referenced by __wrap_fclose(), __wrap_fread(), __wrap_freopen(), fileno_to_stream(), fopen(), free_file_descriptor(), fseek(), ftell(), fwrite(), and open().
FIL* fileno_to_fatfs | ( | int | fileno | ) |
Convert POSIX fileno to FatFS handle NOT POSIX.
[in] | fileno | fileno of file |
Definition at line 2331 of file posix.c.
Referenced by close(), fsync(), ftell(), ftruncate(), lseek(), open(), read(), sync(), syncfs(), and write().
FILE* fileno_to_stream | ( | int | fileno | ) |
Convert POSIX fileno to POSIX FILE stream pointer. NOT POSIX.
[in] | fileno | POSIX fileno is the index of __iob[]. |
Definition at line 744 of file posix.c.
Referenced by close(), fileno_to_fatfs(), fopen(), free_file_descriptor(), fsync(), lseek(), open(), read(), syncfs(), and write().
FILE* fopen | ( | const char * | path, |
const char * | mode | ||
) |
POSIX Open a file with path name and ascii file mode string.
[in] | path | filename string. |
[in] | mode | POSIX open mode strings. |
Definition at line 772 of file posix.c.
Referenced by __wrap_freopen(), Linux::UtilRPI::_check_rpi_version(), Linux::RCInput::_process_rc_pulse(), SITL::JSBSim::create_templates(), AP_RangeFinder_BBB_PRU::detect(), Linux::Util::get_hw_arm32(), main(), AP_Param::parse_param_line(), AP_GPS_NMEA::read(), Linux::Util::read_file(), and srxl_decode().
int fprintf | ( | FILE * | fp, |
const char * | fmt, | ||
... | |||
) |
fprintf character write function
[in] | *p | printf user buffer |
[in] | ch | character TODO if fputc fails we might want to also set an error in the *p structure - error in the stream will already be set fprintf function Example user defined printf function using fputc for I/O This method allows I/O to devices and strings without typical C++ overhead |
[in] | *fp | FILE stream pointer |
[in] | fmt | printf forat string |
[in] | ... | vararg list or arguments |
Definition at line 2539 of file posix.c.
Referenced by HALSITL::UARTDriver::_check_connection(), HALSITL::UARTDriver::_check_reconnect(), Linux::UtilRPI::_check_rpi_version(), Linux::Perf::_debug_counters(), Linux::Scheduler::_debug_stack(), HALSITL::SITL_State::_parse_command_line(), Linux::RCInput::_process_rc_pulse(), HALSITL::SITL_State::_setup_fdm(), _sig_fpe(), HALSITL::SITL_State::_sitl_setup(), Linux::Storage::_storage_create(), HALSITL::UARTDriver::_tcp_start_client(), HALSITL::UARTDriver::_tcp_start_connection(), VRBRAIN::DeviceBus::adjust_timer(), PX4::DeviceBus::adjust_timer(), BM_Crop8bpp(), BM_YuyvToGrey(), consumer_thread(), SITL::JSBSim::create_templates(), Linux::Scheduler::delay(), SITL::JSBSim::drain_control_socket(), SITL::Gazebo::drain_sockets(), DataFlash_Class::dump_structure_field(), DataFlash_Class::dump_structures(), fail(), SITL::Gazebo::Gazebo(), Linux::Memory_table::Memory_table(), UARTDevice::open(), parse_gpio_pin_number(), Linux::Poller::Poller(), SITL::JSBSim::send_servos(), ConsoleDevice::set_blocking(), UARTDevice::set_blocking(), Linux::UARTDriver::set_device_path(), SITL::Gazebo::set_interface_ports(), SITL::Gripper_Servo::update(), SITL::Gripper_EPM::update_from_demand(), SITL::Vicon::update_vicon_position_estimate(), and Linux::Poller::wakeup().
int fputc | ( | int | c, |
FILE * | stream | ||
) |
Put a byte to TTY device or FatFs file stream open() or fopen() sets stream->put = fatfs_outc() for FatFs functions See fdevopen() sets stream->put get for TTY devices.
[in] | stream | POSIX stream pointer. |
Definition at line 264 of file posix.c.
Referenced by fprintf(), fputs(), putc(), putchar(), puts(), and write().
int fputs | ( | const char * | str, |
FILE * | stream | ||
) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 452 of file posix.c.
int free_file_descriptor | ( | int | fileno | ) |
Free POSIX fileno FILE descriptor. NOT POSIX.
[in] | fileno | POSIX file number __iob[] index. |
Definition at line 2366 of file posix.c.
Referenced by close(), and open().
int64_t fs_getfree | ( | ) |
int64_t fs_gettotal | ( | ) |
int fseek | ( | FILE * | stream, |
long | offset, | ||
int | whence | ||
) |
POSIX seek to file possition.
[in] | stream | POSIX file stream. |
[in] | offset | offset to seek to. |
[in] | whence |
|
Definition at line 540 of file posix.c.
Referenced by fsetpos(), and rewind().
int fsetpos | ( | FILE * | stream, |
size_t * | pos | ||
) |
int fsync | ( | int | fileno | ) |
Definition at line 2562 of file posix.c.
Referenced by Linux::Storage::_storage_create(), and Linux::Storage::_timer_tick().
long ftell | ( | FILE * | stream | ) |
POSIX file position of open stream.
[in] | stream | POSIX file stream. |
Definition at line 580 of file posix.c.
Referenced by fgetpos().
int ftruncate | ( | int | fd, |
off_t | length | ||
) |
POSIX truncate open file to length.
[in] | fd | open file number. |
[in] | length | length to truncate to. |
Definition at line 817 of file posix.c.
Referenced by HALSITL::EEPROMStorage::_eeprom_open(), and Linux::Storage::_storage_create().
size_t fwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
FILE * | stream | ||
) |
POSIX write nmemb elements from buf, size bytes each, to the stream fd.
[in] | ptr | buffer. |
[in] | nmemb | number of items to write. |
[in] | size | size of each item in bytes. |
[in] | stream | POSIX file stream. |
Definition at line 858 of file posix.c.
Referenced by AP_GPS_NMEA::read().
int getc | ( | FILE * | fp | ) |
int getchar | ( | ) |
functions normally defined as macros
get a character from stdin See fdevopen() sets stream->get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 314 of file posix.c.
char* getcwd | ( | char * | pathname, |
int | len | ||
) |
char* gets | ( | char * | p | ) |
int isatty | ( | int | fileno | ) |
Test POSIX fileno if it is a Serial Console/TTY.
[in] | fileno | POSIX fileno of open file. |
Definition at line 185 of file posix.c.
Referenced by __wrap_fclose(), fileno_to_fatfs(), free_file_descriptor(), ftell(), ftruncate(), lseek(), new_file_descriptor(), sync(), and syncfs().
off_t lseek | ( | int | fileno, |
off_t | position, | ||
int | whence | ||
) |
POSIX seek to file position.
[in] | fileno | POSIX fileno of open file. |
[in] | position | offset to seek to. |
[in] | whence |
|
Definition at line 612 of file posix.c.
Referenced by PX4::PX4Storage::_mtd_write(), VRBRAIN::VRBRAINStorage::_mtd_write(), Linux::Storage::_timer_tick(), HALSITL::SITL_State::_update_gps_file(), fseek(), and Linux::Memory_table::Memory_table().
int mkdir | ( | const char * | pathname, |
mode_t | mode | ||
) |
POSIX make a directory.
[in] | pathname | directory to create |
Definition at line 1620 of file posix.c.
Referenced by mkdir_p(), and sdcard_init().
int new_file_descriptor | ( | void | ) |
int open | ( | const char * | pathname, |
int | flags | ||
) |
POSIX Open a file with integer mode flags.
[in] | pathname | filename string. |
[in] | flags | POSIX open modes. |
Seek to end of the file
Definition at line 885 of file posix.c.
Referenced by HALSITL::EEPROMStorage::_eeprom_open(), Linux::GPIO_Sysfs::_export_pin(), AP_InertialSensor_PX4::_init_sensor(), PX4::PX4Storage::_mtd_load(), VRBRAIN::VRBRAINStorage::_mtd_load(), Linux::GPIO_Sysfs::_open_pin_value(), Linux::OpticalFlow_Onboard::_run_optflow(), Linux::Storage::_storage_create(), VRBRAIN::VRBRAINStorage::_storage_open(), PX4::PX4Storage::_storage_open(), Linux::RCInput_SBUS::_timer_tick(), VRBRAIN::VRBRAINStorage::_timer_tick(), PX4::PX4Storage::_timer_tick(), HALSITL::UARTDriver::_uart_start_connection(), HALSITL::SITL_State::_update_gps_file(), AP_RangeFinder_PX4_PWM::AP_RangeFinder_PX4_PWM(), AP_RPM_PX4_PWM::AP_RPM_PX4_PWM(), VRBRAIN::VRBRAINUARTDriver::begin(), PX4::PX4UARTDriver::begin(), AP_RangeFinder_BBB_PRU::detect(), AP_RangeFinder_PX4_PWM::detect(), dsm_decode(), VRBRAIN::VRBRAINRCOutput::enable_px4io_sbus_out(), PX4::PX4RCOutput::enable_px4io_sbus_out(), fopen(), GCS_MAVLINK::handle_preflight_reboot(), Linux::RCOutput_ZYNQ::init(), PX4::PX4RCOutput::init(), VRBRAIN::VRBRAINRCOutput::init(), Linux::RCInput_ZYNQ::init(), Linux::RCInput_PRU::init(), Linux::PWM_Sysfs_Base::init(), Linux::RCOutput_PRU::init(), Linux::Storage::init(), VRBRAIN::VRBRAINGPIO::init(), Linux::RCOutput_AioPRU::init(), Linux::Led_Sysfs::init(), ToneAlarm_PX4::init(), Linux::RCInput_SBUS::init(), Linux::RCInput_115200::init(), Linux::RCInput_AioPRU::init(), PX4::PX4GPIO::init(), OreoLED_PX4::init(), Linux::GPIO_RPI::init(), PX4::PX4AnalogIn::init(), VRBRAIN::VRBRAINAnalogIn::init(), Linux::GPIO_BBB::init(), AP_Gripper_EPM::init_gripper(), AnalogSource_IIO::init_pins(), Linux::RCInput_RPI::map_peripheral(), Linux::Memory_table::Memory_table(), Linux::SPIBus::open(), Linux::RCInput_Navio2::open_channel(), Linux::VideoIn::open_device(), AP_BoardConfig::px4_setup_pwm(), AP_BoardConfig::px4_setup_safety_mask(), PX4::PX4RCInput::rc_bind(), Linux::RCInput_UART::RCInput_UART(), AnalogSource_Navio2::set_channel(), Linux::CameraSensor::set_format(), VRBRAIN::VRBRAINUtil::set_imu_temp(), PX4::PX4Util::set_imu_temp(), setup(), AP_Camera::setup_feedback_callback(), srxl_decode(), SITL::JSBSim::start_JSBSim(), SITL::last_letter::start_last_letter(), AP_OpticalFlow_Pixart::timer(), Linux::ToneAlarm::ToneAlarm(), and Linux::Util::write_file().
DIR* opendir | ( | const char * | pathdir | ) |
Definition at line 1749 of file posix.c.
Referenced by Linux::I2CDeviceManager::get_device().
void perror | ( | const char * | s | ) |
POSIX perror() - convert POSIX errno to text with user message.
[in] | s | User message displayed before the error message |
Definition at line 1827 of file posix.c.
Referenced by dsm_decode(), Linux::RCOutput_Bebop::init(), srxl_decode(), SITL::JSBSim::start_JSBSim(), and SITL::last_letter::start_last_letter().
int posix_fopen_modes_to_open | ( | const char * | mode | ) |
Convert POSIX fopen mode to POSIX open mode flags. NOT POSIX.
[in] | mode | POSIX file mode string. |
Definition at line 2473 of file posix.c.
Referenced by fopen().
int putc | ( | int | c, |
FILE * | stream | ||
) |
Un-Get byte from a TTY device or FatFs file stream.
[in] | c | Character to unget |
[in] | stream | POSIX stream pointer. |
[in] | stream | POSIX stream pointer. |
Definition at line 379 of file posix.c.
int putchar | ( | int | c | ) |
put a character to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 329 of file posix.c.
int puts | ( | const char * | str | ) |
put a string to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 475 of file posix.c.
ssize_t read | ( | int | fd, |
void * | buf, | ||
size_t | count | ||
) |
POSIX read count bytes from *buf to fileno fd.
[in] | fd | POSIX fileno. |
[in] | buf | buffer. |
[in] | count | number of bytes to write. |
Definition at line 995 of file posix.c.
Referenced by __wrap_fread(), AP_InertialSensor_PX4::_get_accel_sample(), AP_InertialSensor_PX4::_get_gyro_sample(), PX4::PX4Storage::_mtd_load(), VRBRAIN::VRBRAINStorage::_mtd_load(), PX4::PX4AnalogIn::_timer_tick(), VRBRAIN::VRBRAINAnalogIn::_timer_tick(), HALSITL::SITL_State::_update_gps(), HALSITL::SITL_State::_update_gps_file(), SITL::JSBSim::check_stdout(), dsm_decode(), SITL::JSBSim::expect(), Linux::RCOutput_Bebop::from(), Linux::CAN::getFileDescriptor(), HALSITL::SITL_State::gps_read(), Linux::Storage::init(), loop(), Linux::Memory_table::Memory_table(), Linux::TimerPollable::on_can_read(), Linux::WakeupPollable::on_can_read(), ConsoleDevice::read(), UARTDevice::read(), RC_Channels::read_input(), srxl_decode(), SITL::JSBSim::start_JSBSim(), AP_RPM_PX4_PWM::update(), and AP_RangeFinder_PX4_PWM::update().
dirent_t* readdir | ( | DIR * | dirp | ) |
Definition at line 1768 of file posix.c.
Referenced by Linux::I2CDeviceManager::get_device().
int remove | ( | const char * | pathname | ) |
int rename | ( | const char * | oldpath, |
const char * | newpath | ||
) |
|
static |
Definition at line 2232 of file posix.c.
Referenced by fat_time_to_unix().
void rewind | ( | FILE * | stream | ) |
int rmdir | ( | const char * | pathname | ) |
int stat | ( | const char * | name, |
struct stat * | buf | ||
) |
Display struct stat, from POSIX stat(0 or fstat(), in ASCII. NOT POSIX.
[in] | sp | struct stat pointer. |
[in] | name | file name. |
[in] | buf | struct stat buffer to return results in. |
Definition at line 1319 of file posix.c.
Referenced by __attribute__(), __wrap_fclose(), Linux::UARTDriver::_parseDevicePath(), f_getfree(), f_mkfs(), find_volume(), get_stack_top(), PX4::PX4RCOutput::init(), Linux::Util::is_chardev_node(), and is_dir().
char* strerror | ( | int | errnum | ) |
POSIX strerror() - convert POSIX errno to text with user message.
[in] | errnum | index for sys_errlist[] |
Definition at line 1852 of file posix.c.
Referenced by Linux::VideoIn::_dequeue_frame(), Linux::VideoIn::_queue_buffer(), Linux::RCOutput_Bebop::_run_rcout(), Linux::VideoIn::_set_streaming(), HALSITL::SITL_State::_setup_fdm(), HALSITL::UARTDriver::_tcp_start_client(), HALSITL::UARTDriver::_tcp_start_connection(), Linux::VideoIn::allocate_buffers(), SITL::JSBSim::drain_control_socket(), SITL::Gazebo::drain_sockets(), Linux::RCInput_UART::init(), Linux::PWM_Sysfs_Base::init(), Linux::Scheduler::init(), Linux::RCInput_115200::init(), UARTDevice::open(), TCPServerDevice::open(), Linux::SPIBus::open(), Linux::VideoIn::open_device(), Linux::RCInput_UART::RCInput_UART(), SITL::JSBSim::send_servos(), UARTDevice::set_blocking(), ConsoleDevice::set_blocking(), AnalogSource_Navio2::set_channel(), Linux::VideoIn::set_crop(), Linux::VideoIn::set_format(), SITL::Gazebo::set_interface_ports(), Linux::Thread::start(), Linux::SPIDevice::transfer(), and Linux::SPIDevice::transfer_fullduplex().
void sync | ( | void | ) |
int syncfs | ( | int | fd | ) |
POSIX Sync pending file changes and metadata for specified fileno.
[in] | fd | POSIX fileno to sync. |
Definition at line 1085 of file posix.c.
Referenced by sync().
int truncate | ( | const char * | path, |
off_t | length | ||
) |
void unix_time_to_fat | ( | time_t | epoch, |
uint16_t * | date, | ||
uint16_t * | time | ||
) |
int unlink | ( | const char * | pathname | ) |
POSIX delete a file.
[in] | pathname | filename to delete. |
Definition at line 1693 of file posix.c.
Referenced by HALSITL::SITL_State::_parse_command_line().
int utime | ( | const char * | filename, |
const struct utimbuf * | times | ||
) |
ssize_t write | ( | int | fd, |
const void * | buf, | ||
size_t | count | ||
) |
POSIX Write count bytes from *buf to fileno fd.
[in] | fd | POSIX fileno. |
[in] | buf | buffer. |
[in] | count | number of bytes to write. |
Definition at line 1169 of file posix.c.
Referenced by HALSITL::SITL_State::_gps_write(), PX4::PX4Storage::_mtd_write(), VRBRAIN::VRBRAINStorage::_mtd_write(), Linux::OpticalFlow_Onboard::_run_optflow(), PX4::PX4Storage::_storage_open(), VRBRAIN::VRBRAINStorage::_storage_open(), Linux::Storage::_timer_tick(), SITL::JSBSim::check_stdout(), SITL::JSBSim::expect(), Linux::RCOutput_Bebop::from(), fwrite(), Linux::CAN::getFileDescriptor(), ToneAlarm_PX4::play_string(), SITL::Vicon::update_vicon_position_estimate(), Linux::Poller::wakeup(), PX4::NSHShellStream::write(), VRBRAIN::NSHShellStream::write(), and ConsoleDevice::write().
FILE* __iob[MAX_FILES] |
POSIX fileno to POSIX FILE stream table.
Definition at line 128 of file posix.c.
Referenced by fatfs_to_fileno(), fileno(), fileno_to_stream(), free_file_descriptor(), and new_file_descriptor().
|
static |
|
static |
int errno |
Note: fdevopen assigns stdin,stdout,stderr.
POSIX errno.
Definition at line 118 of file posix.c.
Referenced by HALSITL::UARTDriver::_check_reconnect(), Linux::VideoIn::_dequeue_frame(), _kill(), VRBRAIN::VRBRAINStorage::_mtd_load(), PX4::PX4Storage::_mtd_load(), Linux::VideoIn::_queue_buffer(), Linux::VideoIn::_set_streaming(), HALSITL::SITL_State::_setup_fdm(), HALSITL::UARTDriver::_tcp_start_client(), HALSITL::UARTDriver::_tcp_start_connection(), Linux::VideoIn::allocate_buffers(), chdir(), chmod(), close(), closedir(), SITL::JSBSim::drain_control_socket(), SITL::Gazebo::drain_sockets(), fatfs_getc(), fatfs_putc(), fatfs_to_fileno(), fgetc(), fileno(), fileno_to_fatfs(), fileno_to_stream(), fputc(), free_file_descriptor(), fsync(), ftell(), ftruncate(), Linux::Util::get_hw_arm32(), getcwd(), Linux::RCInput_UART::init(), Linux::PWM_Sysfs_Base::init(), Linux::Scheduler::init(), Linux::RCInput_115200::init(), is_dir(), lseek(), Linux::Scheduler::microsleep(), mkdir(), mkdir_p(), new_file_descriptor(), Linux::WakeupPollable::on_can_read(), TCPServerDevice::open(), UARTDevice::open(), Linux::I2CBus::open(), Linux::SPIBus::open(), open(), Linux::VideoIn::open_device(), opendir(), perror(), Linux::Poller::poll(), Linux::RCInput_UART::RCInput_UART(), read(), Linux::Util::read_file(), readdir(), remove(), rename(), rmdir(), SITL::JSBSim::send_servos(), UARTDevice::set_blocking(), ConsoleDevice::set_blocking(), AnalogSource_Navio2::set_channel(), Linux::VideoIn::set_crop(), Linux::VideoIn::set_format(), SITL::Gazebo::set_interface_ports(), stat(), syncfs(), Linux::SPIDevice::transfer(), Linux::SPIDevice::transfer_fullduplex(), truncate(), unlink(), Linux::Poller::wakeup(), write(), and Linux::Util::write_file().
const char* sys_errlist[] |
POSIX error messages for each errno value.
Definition at line 133 of file posix.c.
Referenced by __wrap_strerror_r(), perror(), and strerror().