--- /dev/null
+/* Change working directory given a file descriptor. NaCl version.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <nacl-interfaces.h>
+
+/* Change the current directory to FD. */
+int
+__fchdir (int fd)
+{
+ return NACL_CALL (__nacl_irt_dev_fdio.fchdir (fd), 0);
+}
+weak_alias (__fchdir, fchdir)
--- /dev/null
+/* Change a file's permissions given a file descriptor. NaCl version.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <nacl-interfaces.h>
+
+/* Change the current directory to FD. */
+int
+__fchmod (int fd, mode_t mode)
+{
+ return NACL_CALL (__nacl_irt_dev_fdio.fchmod (fd, mode), 0);
+}
+weak_alias (__fchmod, fchmod)
--- /dev/null
+/* Make all changes done to file data actually appear on disk. NaCl version.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <nacl-interfaces.h>
+
+/* 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);
+}
--- /dev/null
+/* Make all changes done to FD actually appear on disk. NaCl version.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <nacl-interfaces.h>
+
+/* Make all changes done to FD actually appear on disk. */
+int
+fsync (int fd)
+{
+ return NACL_CALL (__nacl_irt_dev_fdio.fsync (fd), 0);
+}
--- /dev/null
+/* Truncate a file. NaCl version.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <nacl-interfaces.h>
+
+/* 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);
+}
+weak_alias (__ftruncate, ftruncate)
+
+/* ftruncate64 is the same as ftruncate. */
+strong_alias (__ftruncate, __ftruncate64)
+weak_alias (__ftruncate64, ftruncate64)
--- /dev/null
+/* ftruncate64 is the same as ftruncate. */
--- /dev/null
+/* Determine if a file descriptor refers to a terminal. NaCl version.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <nacl-interfaces.h>
+
+/* Return 1 if FD is a terminal, 0 if not. */
+int
+__isatty (int fd)
+{
+ int result;
+ return NACL_CALL (__nacl_irt_dev_fdio.isatty (fd, &result), result);
+}
+weak_alias (__isatty, isatty)
NACL_IRT_DEV_GETPID_v0_1, nacl_irt_dev_getpid)
NACL_OPTIONAL_INTERFACE (rtld,
NACL_IRT_DEV_FILENAME_v0_3, nacl_irt_dev_filename)
+NACL_OPTIONAL_INTERFACE (libc,
+ NACL_IRT_DEV_FDIO_v0_3, nacl_irt_dev_fdio)