13#if defined(OS_USE_OS_APP_CONFIG_H)
14#include <cmsis-plus/os-app-config.h>
17#if !defined(OS_USE_SEMIHOSTING_SYSCALLS)
41#pragma clang diagnostic ignored "-Wc++98-compat"
89 va_start(args, oflag);
100 return io->file_descriptor ();
133 return io->read (buf, nbyte);
143 if (fildes == 1 || fildes == 2)
150 return io->write (buf, nbyte);
162 return io->writev (iov, iovcnt);
176 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::char_device)) == 0)
183 va_start(args, request);
201 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::file)) == 0)
207 return (
static_cast<posix::file*
> (io))->lseek (offset, whence);
228 return io->isatty ();
242 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::tty)) == 0)
248 return (
static_cast<posix::tty*
> (io))->tcdrain ();
262 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::tty)) == 0)
268 return (
static_cast<posix::tty*
> (io))->tcgetattr (termios_p);
283 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::tty)) == 0)
289 return (
static_cast<posix::tty*
> (io))->tcsetattr (optional_actions,
304 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::tty)) == 0)
310 return (
static_cast<posix::tty*
> (io))->tcflush (queue_selector);
324 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::tty)) == 0)
330 return (
static_cast<posix::tty*
> (io))->tcsendbreak (duration);
345 int ret = io->vfcntl (cmd, args);
360 return io->fstat (buf);
374 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::file)) == 0)
380 return (
static_cast<posix::file*
> (io))->fstatvfs (buf);
394 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::file)) == 0)
400 return (
static_cast<posix::file*
> (io))->ftruncate (length);
414 if ((io->get_type () &
static_cast<posix::io::type_t>(posix::io::type::file)) == 0)
501#pragma GCC diagnostic push
502#pragma GCC diagnostic ignored "-Wcast-align"
504#pragma GCC diagnostic pop
518 return ((ssize_t) -1);
525#pragma GCC diagnostic push
526#pragma GCC diagnostic ignored "-Wcast-align"
528#pragma GCC diagnostic pop
540#pragma GCC diagnostic push
541#pragma GCC diagnostic ignored "-Wcast-align"
543#pragma GCC diagnostic pop
549 return dir->
close ();
555#pragma GCC diagnostic push
556#if defined(__clang__)
557#elif defined(__GNUC__)
558#pragma GCC diagnostic ignored "-Wunused-parameter"
576 return sock->file_descriptor ();
597 auto*
const new_socket = io->accept (address, address_len);
598 return new_socket->file_descriptor ();
610 return io->bind (address, address_len);
623 return io->connect (address, address_len);
636 return io->getpeername (address, address_len);
649 return io->getsockname (address, address_len);
662 return io->getsockopt (level, option_name, option_value, option_len);
674 return io->listen (backlog);
686 return io->recv (buffer, length, flags);
699 return io->recvfrom (buffer, length, flags, address, address_len);
711 return io->recvmsg (message, flags);
723 return io->send (buffer, length, flags);
735 return io->sendmsg (message, flags);
748 return io->sendto (message, length, flags, dest_addr, dest_len);
753 const void* option_value,
socklen_t option_len)
761 return io->setsockopt (level, option_name, option_value, option_len);
773 return io->shutdown (how);
785 return io->sockatmark ();
788#pragma GCC diagnostic pop
801#pragma GCC diagnostic push
802#if defined(__clang__)
803#pragma clang diagnostic ignored "-Wunused-parameter"
804#elif defined(__GNUC__)
805#pragma GCC diagnostic ignored "-Wunused-parameter"
811int __attribute__((weak))
818int __attribute__((weak))
829 ptimeval->tv_usec = 0;
846 return static_cast<clock_t
> (-1);
870 return static_cast<clock_t
> (-1);
885#pragma GCC diagnostic push
886#if defined(__clang__)
887#elif defined(__GNUC__)
888#pragma GCC diagnostic ignored "-Wuseless-cast"
891 return static_cast<pid_t
> (-1);
893#pragma GCC diagnostic push
901#pragma GCC diagnostic push
902#if defined(__clang__)
903#elif defined(__GNUC__)
904#pragma GCC diagnostic ignored "-Wuseless-cast"
907 return static_cast<pid_t
> (-1);
909#pragma GCC diagnostic pop
938#pragma GCC diagnostic push
939#if defined(__clang__)
940#elif defined(__GNUC__)
941#pragma GCC diagnostic ignored "-Wuseless-cast"
944 return static_cast<pid_t
> (-1);
946#pragma GCC diagnostic pop
974 return static_cast<ssize_t
> (-1);
977#pragma GCC diagnostic pop
991#if defined(__ARM_EABI__) && (__STDC_HOSTED__ != 0)
996#if defined(OS_INCLUDE_NEWLIB_POSIX_FUNCTIONS)
int __posix_statvfs(const char *path, struct statvfs *buf)
pid_t __posix_getpid(void)
int __posix_tcsetattr(int fildes, int optional_actions, const termios *termios_p)
clock_t __posix_clock(void)
int __posix_tcflush(int fildes, int queue_selector)
int __posix_fstatvfs(int fildes, struct statvfs *buf)
int __posix_tcdrain(int fildes)
void initialise_monitor_handles(void)
int __posix_tcgetattr(int fildes, termios *termios_p)
int __posix_tcsendbreak(int fildes, int duration)
virtual dirent * read(void)
virtual void rewind(void)
static class socket * socket(int fildes)
static class io * io(int fildes)
virtual timestamp_t now(void) override
Tell the current time adjusted for epoch.
int stat(const char *path, struct stat *buf)
clock_t times(struct tms *buf)
int socket(int domain, int type, int protocol)
int utime(const char *path, const utimbuf *times)
int unlink(const char *path)
io * vopen(const char *path, int oflag, std::va_list args)
int rmdir(const char *path)
int statvfs(const char *path, struct statvfs *buf)
int rename(const char *existing, const char *_new)
int stat(const char *path, struct stat *buf)
int chmod(const char *path, mode_t mode)
int truncate(const char *path, off_t length)
directory * opendir(const char *dirname)
Open directory.
int mkdir(const char *path, mode_t mode)
clock_rtc rtclock
The real time clock object instance.
Single file µOS++ RTOS definitions.
#define __posix_sockatmark
#define __posix_getsockopt
#define __posix_rewinddir
#define __posix_readdir_r
#define __posix_getsockname
#define __posix_gettimeofday
#define __posix_setsockopt
#define __posix_socketpair
#define __posix_ftruncate
#define __posix_getpeername
ssize_t trace_write(const void *buf, size_t nbyte)