28#if !defined(OS_USE_SEMIHOSTING_SYSCALLS)
52#pragma clang diagnostic ignored "-Wc++98-compat"
100 va_start(args, oflag);
111 return io->file_descriptor ();
144 return io->read (buf, nbyte);
154 if (fildes == 1 || fildes == 2)
161 return io->write (buf, nbyte);
173 return io->writev (iov, iovcnt);
187 if ((io->get_type () & posix::io::type::char_device) == 0)
194 va_start(args, request);
212 if ((io->get_type () & posix::io::type::file) == 0)
218 return (
static_cast<posix::file*
> (io))->lseek (offset, whence);
239 return io->isatty ();
253 if ((io->get_type () & posix::io::type::tty) == 0)
259 return (
static_cast<posix::tty*
> (io))->tcdrain ();
273 if ((io->get_type () & posix::io::type::tty) == 0)
279 return (
static_cast<posix::tty*
> (io))->tcgetattr (termios_p);
284 const struct termios *termios_p)
294 if ((io->get_type () & posix::io::type::tty) == 0)
300 return (
static_cast<posix::tty*
> (io))->tcsetattr (optional_actions,
315 if ((io->get_type () & posix::io::type::tty) == 0)
321 return (
static_cast<posix::tty*
> (io))->tcflush (queue_selector);
335 if ((io->get_type () & posix::io::type::tty) == 0)
341 return (
static_cast<posix::tty*
> (io))->tcsendbreak (duration);
356 int ret = io->vfcntl (cmd, args);
371 return io->fstat (buf);
385 if ((io->get_type () & posix::io::type::file) == 0)
391 return (
static_cast<posix::file*
> (io))->fstatvfs (buf);
405 if ((io->get_type () & posix::io::type::file) == 0)
411 return (
static_cast<posix::file*
> (io))->ftruncate (length);
425 if ((io->get_type () & posix::io::type::file) == 0)
526 return ((ssize_t) -1);
551 return dir->
close ();
557#pragma GCC diagnostic push
558#pragma GCC diagnostic ignored "-Wunused-parameter"
575 return sock->file_descriptor ();
596 auto*
const new_socket = io->accept (address, address_len);
597 return new_socket->file_descriptor ();
609 return io->bind (address, address_len);
622 return io->connect (address, address_len);
635 return io->getpeername (address, address_len);
648 return io->getsockname (address, address_len);
661 return io->getsockopt (level, option_name, option_value, option_len);
673 return io->listen (backlog);
685 return io->recv (buffer, length, flags);
698 return io->recvfrom (buffer, length, flags, address, address_len);
710 return io->recvmsg (message, flags);
722 return io->send (buffer, length, flags);
734 return io->sendmsg (message, flags);
747 return io->sendto (message, length, flags, dest_addr, dest_len);
752 const void* option_value,
socklen_t option_len)
760 return io->setsockopt (level, option_name, option_value, option_len);
772 return io->shutdown (how);
784 return io->sockatmark ();
787#pragma GCC diagnostic pop
800#pragma GCC diagnostic push
801#pragma GCC diagnostic ignored "-Wunused-parameter"
806int __attribute__((weak))
813int __attribute__((weak))
824 ptimeval->tv_usec = 0;
831 struct timeval* timeout)
841 return static_cast<clock_t
> (-1);
865 return static_cast<clock_t
> (-1);
879 return static_cast<pid_t
> (-1);
886 return static_cast<pid_t
> (-1);
914 return static_cast<pid_t
> (-1);
942 return static_cast<ssize_t
> (-1);
945#pragma GCC diagnostic pop
959#if defined(__ARM_EABI__) && (__STDC_HOSTED__ != 0)
964#if defined(OS_INCLUDE_NEWLIB_POSIX_FUNCTIONS)
int __posix_tcgetattr(int fildes, struct termios *termios_p)
int __posix_statvfs(const char *path, struct statvfs *buf)
pid_t __posix_getpid(void)
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_tcsetattr(int fildes, int optional_actions, const struct termios *termios_p)
int __posix_tcsendbreak(int fildes, int duration)
virtual struct 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 unlink(const char *path)
io * vopen(const char *path, int oflag, std::va_list args)
int utime(const char *path, const struct utimbuf *times)
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)