summary refs log tree commit diff
path: root/io
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-12-14 08:43:25 +0000
committerUlrich Drepper <drepper@redhat.com>2005-12-14 08:43:25 +0000
commitb6ab06cef4670e02756bcdd4d2c33a49369a4346 (patch)
treeb30743eb9728d890d1519f62b2d1f2b96f62547a /io
parentd1dc39a44e339f9c48baa3854fffb3d68c73c8fa (diff)
downloadglibc-b6ab06cef4670e02756bcdd4d2c33a49369a4346.tar.gz
glibc-b6ab06cef4670e02756bcdd4d2c33a49369a4346.tar.xz
glibc-b6ab06cef4670e02756bcdd4d2c33a49369a4346.zip
2005-12-13 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'io')
-rw-r--r--io/access.c41
-rw-r--r--io/chdir.c40
-rw-r--r--io/chmod.c42
-rw-r--r--io/chown.c45
-rw-r--r--io/close.c40
-rw-r--r--io/creat.c36
-rw-r--r--io/creat64.c31
-rw-r--r--io/dup.c34
-rw-r--r--io/dup2.c48
9 files changed, 357 insertions, 0 deletions
diff --git a/io/access.c b/io/access.c
new file mode 100644
index 0000000000..c266e945a9
--- /dev/null
+++ b/io/access.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+
+/* Test for access to FILE.  */
+int
+__access (file, type)
+     const char *file;
+     int type;
+{
+  if (file == NULL || (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (access)
+
+weak_alias (__access, access)
+#include <stub-tag.h>
diff --git a/io/chdir.c b/io/chdir.c
new file mode 100644
index 0000000000..afaeef8787
--- /dev/null
+++ b/io/chdir.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+
+/* Change the current directory to PATH.  */
+int
+__chdir (path)
+     const char *path;
+{
+  if (path == NULL)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (chdir)
+
+weak_alias (__chdir, chdir)
+#include <stub-tag.h>
diff --git a/io/chmod.c b/io/chmod.c
new file mode 100644
index 0000000000..38b05127c9
--- /dev/null
+++ b/io/chmod.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+/* Change the protections of FILE to MODE.  */
+int
+__chmod (file, mode)
+     const char *file;
+     mode_t mode;
+{
+  if (file == NULL)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (chmod)
+
+weak_alias (__chmod, chmod)
+#include <stub-tag.h>
diff --git a/io/chown.c b/io/chown.c
new file mode 100644
index 0000000000..0e368f2ac4
--- /dev/null
+++ b/io/chown.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 2002
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+/* Change the owner and group of FILE.  */
+int
+__chown (file, owner, group)
+     const char *file;
+     uid_t owner;
+     gid_t group;
+{
+  if (file == NULL)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return -1;
+}
+libc_hidden_def (__chown)
+stub_warning (chown)
+
+weak_alias (__chown, chown)
+#include <stub-tag.h>
diff --git a/io/close.c b/io/close.c
new file mode 100644
index 0000000000..0856ba851b
--- /dev/null
+++ b/io/close.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+/* Close the file descriptor FD.  */
+int
+__close (fd)
+     int fd;
+{
+  if (fd < 0)
+    {
+      __set_errno (EBADF);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return -1;
+}
+libc_hidden_def (__close)
+stub_warning (close)
+
+weak_alias (__close, close)
+#include <stub-tag.h>
diff --git a/io/creat.c b/io/creat.c
new file mode 100644
index 0000000000..462882415c
--- /dev/null
+++ b/io/creat.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991, 1996, 1997, 2003 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sysdep-cancel.h>
+
+#undef	creat
+
+/* Create FILE with protections MODE.  */
+int
+__libc_creat (file, mode)
+     const char *file;
+     mode_t mode;
+{
+  return __open (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+}
+weak_alias (__libc_creat, creat)
+
+/* __open handles cancellation.  */
+LIBC_CANCEL_HANDLED ();
diff --git a/io/creat64.c b/io/creat64.c
new file mode 100644
index 0000000000..39f4580571
--- /dev/null
+++ b/io/creat64.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991, 1996, 1997 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sys/types.h>
+
+#undef	creat
+
+/* Create FILE with protections MODE.  */
+int
+creat64 (file, mode)
+     const char *file;
+     mode_t mode;
+{
+  return __open64 (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+}
diff --git a/io/dup.c b/io/dup.c
new file mode 100644
index 0000000000..5d5e1b4cd5
--- /dev/null
+++ b/io/dup.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Duplicate FD, returning a new file descriptor open on the same file.  */
+int
+__dup (fd)
+     int fd;
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (dup)
+
+weak_alias (__dup, dup)
+#include <stub-tag.h>
diff --git a/io/dup2.c b/io/dup2.c
new file mode 100644
index 0000000000..2b897896f6
--- /dev/null
+++ b/io/dup2.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+
+/* Duplicate FD to FD2, closing the old FD2 and making FD2 be
+   open the same file as FD is.  Return FD2 or -1.  */
+int
+__dup2 (fd, fd2)
+     int fd;
+     int fd2;
+{
+  if (fd < 0 || fd2 < 0)
+    {
+      __set_errno (EBADF);
+      return -1;
+    }
+
+  if (fd == fd2)
+    /* No way to check that they are valid.  */
+    return fd2;
+
+  __set_errno (ENOSYS);
+  return -1;
+}
+libc_hidden_def (__dup2)
+stub_warning (dup2)
+
+weak_alias (__dup2, dup2)
+#include <stub-tag.h>