--- /dev/null
+/* Change current working directory. 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 PATH. */
+int
+__chdir (const char *path)
+{
+ return NACL_CALL (__nacl_irt_dev_filename.chdir (path), 0);
+}
+weak_alias (__chdir, chdir)
--- /dev/null
+/* Change a file's permissions. 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 protections of FILE to MODE. */
+int
+__chmod (const char *file, mode_t mode)
+{
+ return NACL_CALL (__nacl_irt_dev_filename.chmod (file, mode), 0);
+}
+weak_alias (__chmod, chmod)
#include <unistd.h>
#include <nacl-interfaces.h>
-/* Change the current directory to FD. */
+/* Change the permissions of the file referenced by FD to MODE. */
int
__fchmod (int fd, mode_t mode)
{
--- /dev/null
+/* Make a hard link. 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 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);
+}
+weak_alias (__link, link)
--- /dev/null
+/* Get stat information from a file name 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/>. */
+
+/* Avoid the declaration so the compiler doesn't complain about the alias
+ with a different type signature. It doesn't know that 'struct stat'
+ and 'struct stat64' are ABI-compatible. */
+#define __lxstat64 __lxstat64_avoid
+#include <sys/stat.h>
+#undef __lxstat64
+
+#include <errno.h>
+#include <stddef.h>
+
+#include <xstatconv.h>
+
+#undef lstat
+
+/* Get file attributes about FILE and put them in BUF.
+ If FILE is a symbolic link, do not follow it. */
+int
+__lxstat (int vers, const char *file, struct stat *buf)
+{
+ nacl_abi_stat_t abi_buf;
+ return NACL_CALL (__nacl_irt_dev_filename.lstat (file, &abi_buf),
+ __xstat_conv (vers, &abi_buf, buf));
+}
+hidden_def (__lxstat)
+weak_alias (__lxstat, _lxstat)
+
+strong_alias (__lxstat, __lxstat64)
+hidden_ver (__lxstat, __lxstat64)
--- /dev/null
+/* lxstat.c defines __lxstat64 as an alias. */
--- /dev/null
+/* Read the contents of a symbolic link. 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>
+
+/* 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);
+}
+weak_alias (__readlink, readlink)
--- /dev/null
+/* Make a hard link. 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>
+
+/* Rename the file OLD to NEW. */
+int
+rename (const char *old, const char *new)
+{
+ return NACL_CALL (__nacl_irt_dev_filename.rename (old, new), 0);
+}
--- /dev/null
+/* Remove a directory. 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>
+
+/* Remove the directory PATH. */
+int
+__rmdir (const char *path)
+{
+ return NACL_CALL (__nacl_irt_dev_filename.rmdir (path), 0);
+}
+weak_alias (__rmdir, rmdir)
--- /dev/null
+/* Make a symbolic link. 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 a symbolic link to FROM called TO. */
+int
+__symlink (const char *from, const char *to)
+{
+ return NACL_CALL (__nacl_irt_dev_filename.symlink (from, to), 0);
+}
+weak_alias (__symlink, symlink)
--- /dev/null
+/* Truncate a file (by name). 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 PATH to LENGTH bytes. */
+int
+__truncate (const char *path, off_t length)
+{
+ return NACL_CALL (__nacl_irt_dev_filename.truncate (path, length), 0);
+}
+weak_alias (__truncate, truncate)
+
+/* truncate64 is the same as truncate. */
+strong_alias (__truncate, __truncate64)
+weak_alias (__truncate64, truncate64)
--- /dev/null
+/* truncate64 is the same as truncate. */
--- /dev/null
+/* Change the access and modification times of 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 <sys/time.h>
+#include <nacl-interfaces.h>
+
+/* Change the access time of FILE to TVP[0] and
+ the modification time of FILE to TVP[1]. */
+int
+__utimes (const char *file, const struct timeval tvp[2])
+{
+ return NACL_CALL (__nacl_irt_dev_filename.utimes (file, tvp), 0);
+}
+weak_alias (__utimes, utimes)