/* Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ ssize_t __readlink (const char *path, char *buf, size_t len) { size_t nread; return NACL_CALL (__nacl_irt_dev_filename.readlink (path, buf, len, &nread), nread); }
ssize_t internal_function __getdents (int fd, char *buf, size_t nbytes) { size_t nread; return NACL_CALL (__nacl_irt_fdio.getdents (fd, (void *) buf, nbytes, &nread), nread); }
/* Write NBYTES of BUF to FD. Return the number written, or -1. */ ssize_t __libc_write (int fd, const void *buf, size_t nbytes) { size_t wrote; return NACL_CALL (__nacl_irt_fdio.write (fd, buf, nbytes, &wrote), wrote); }
int __munmap (__ptr_t addr, size_t len) { return NACL_CALL (__nacl_irt_memory.munmap (addr, len), 0); }
/* Get the process ID of the calling process. */ pid_t __getpid (void) { int pid; return NACL_CALL (__nacl_irt_dev_getpid.getpid (&pid), pid); }
/* Duplicate FD, returning a new file descriptor open on the same file. */ int __dup (int fd) { int result; return NACL_CALL (__nacl_irt_fdio.dup (fd, &result), result); }
/* Change the current directory to PATH. */ int __chdir (const char *path) { return NACL_CALL (__nacl_irt_dev_filename.chdir (path), 0); }
/* Truncate the file referenced by FD to LENGTH bytes. */ int __ftruncate (int fd, off_t length) { return NACL_CALL (__nacl_irt_dev_fdio.ftruncate (fd, length), 0); }
/* Make a link to FROM called TO. */ int __link (const char *from, const char *to) { return NACL_CALL (__nacl_irt_dev_filename.link (from, to), 0); }
/* Change the permissions of the file referenced by FD to MODE. */ int __fchmod (int fd, mode_t mode) { return NACL_CALL (__nacl_irt_dev_fdio.fchmod (fd, mode), 0); }
/* Read NBYTES into BUF from FD. Return the number read or -1. */ ssize_t __libc_read (int fd, void *buf, size_t nbytes) { size_t nread; return NACL_CALL (__nacl_irt_fdio.read (fd, buf, nbytes, &nread), nread); }
/* Get current value of CLOCK and store it in TP. */ int __clock_gettime (clockid_t clock_id, struct timespec *tp) { return NACL_CALL (__nacl_irt_clock.clock_gettime (clock_id, tp), 0); }
/* Return the time used by the program so far (user time + system time). */ clock_t clock (void) { nacl_irt_clock_t result; return NACL_CALL (__nacl_irt_basic.clock (&result), result); }
int __mprotect (__ptr_t addr, size_t len, int prot) { return NACL_CALL (__nacl_irt_memory.mprotect (addr, len, prot), 0); }
/* Yield the processor. */ int __sched_yield (void) { return NACL_CALL (__nacl_irt_basic.sched_yield (), 0); }
/* Synchronize at least the data part of a file with the underlying media. */ int fdatasync (int fd) { return NACL_CALL (__nacl_irt_dev_fdio.fdatasync (fd), 0); }
/* Pause execution for a number of nanoseconds. */ int __libc_nanosleep (const struct timespec *requested_time, struct timespec *remaining) { return NACL_CALL (__nacl_irt_basic.nanosleep (requested_time, remaining), 0); }
/* Change the current directory to FD. */ int __fchdir (int fd) { return NACL_CALL (__nacl_irt_dev_fdio.fchdir (fd), 0); }
/* Test for access to FILE. */ int __access (const char *file, int type) { return NACL_CALL (__nacl_irt_dev_filename.access (file, type), 0); }