about summary refs log tree commit diff
path: root/dirent
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-12-14 15:06:39 +0000
committerUlrich Drepper <drepper@redhat.com>2005-12-14 15:06:39 +0000
commit9d13fb2413921c713f83efe331e8e4d219c62c6b (patch)
tree2d44d7ac45ab2d147eb8361bbff880c365aa8ad5 /dirent
parentb6ab06cef4670e02756bcdd4d2c33a49369a4346 (diff)
downloadglibc-9d13fb2413921c713f83efe331e8e4d219c62c6b.tar.gz
glibc-9d13fb2413921c713f83efe331e8e4d219c62c6b.tar.xz
glibc-9d13fb2413921c713f83efe331e8e4d219c62c6b.zip
Moved to csu/errno-loc.c.
Diffstat (limited to 'dirent')
-rw-r--r--dirent/fdopendir.c34
-rw-r--r--dirent/getdents.c37
-rw-r--r--dirent/getdents64.c36
-rw-r--r--dirent/opendir.c34
-rw-r--r--dirent/readdir.c33
-rw-r--r--dirent/readdir64.c32
-rw-r--r--dirent/readdir64_r.c33
-rw-r--r--dirent/readdir_r.c35
-rw-r--r--dirent/rewinddir.c35
-rw-r--r--dirent/scandir64.c30
-rw-r--r--dirent/seekdir.c41
-rw-r--r--dirent/telldir.c41
-rw-r--r--dirent/versionsort64.c27
13 files changed, 448 insertions, 0 deletions
diff --git a/dirent/fdopendir.c b/dirent/fdopendir.c
new file mode 100644
index 0000000000..ed30e89e7e
--- /dev/null
+++ b/dirent/fdopendir.c
@@ -0,0 +1,34 @@
+/* Open a directory stream from a file descriptor.  Stub version.
+   Copyright (C) 2005 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 <dirent.h>
+
+
+/* Open a directory stream on FD.  */
+DIR *
+fdopendir (int fd)
+{
+  __set_errno (ENOSYS);
+  return NULL;
+}
+
+stub_warning (fdopendir)
+#include <stub-tag.h>
diff --git a/dirent/getdents.c b/dirent/getdents.c
new file mode 100644
index 0000000000..1b1b7c7e8f
--- /dev/null
+++ b/dirent/getdents.c
@@ -0,0 +1,37 @@
+/* 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 <stddef.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <dirent.h>
+
+ssize_t
+__getdirentries (fd, buf, nbytes, basep)
+     int fd;
+     char *buf;
+     size_t nbytes;
+     off_t *basep;
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+weak_alias (__getdirentries, getdirentries)
+
+stub_warning (getdirentries)
+#include <stub-tag.h>
diff --git a/dirent/getdents64.c b/dirent/getdents64.c
new file mode 100644
index 0000000000..cb30e76545
--- /dev/null
+++ b/dirent/getdents64.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991,95,96,97,99,2000 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 <stddef.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <dirent.h>
+
+ssize_t
+getdirentries64 (fd, buf, nbytes, basep)
+     int fd;
+     char *buf;
+     size_t nbytes;
+     off64_t *basep;
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+
+stub_warning (getdirentries64)
+#include <stub-tag.h>
diff --git a/dirent/opendir.c b/dirent/opendir.c
new file mode 100644
index 0000000000..771013f6eb
--- /dev/null
+++ b/dirent/opendir.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 <stddef.h>
+#include <dirent.h>
+
+
+/* Open a directory stream on NAME.  */
+DIR *
+__opendir (const char *name)
+{
+  __set_errno (ENOSYS);
+  return NULL;
+}
+weak_alias (__opendir, opendir)
+
+stub_warning (opendir)
+#include <stub-tag.h>
diff --git a/dirent/readdir.c b/dirent/readdir.c
new file mode 100644
index 0000000000..893b246d41
--- /dev/null
+++ b/dirent/readdir.c
@@ -0,0 +1,33 @@
+/* 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 <dirent.h>
+
+/* Read a directory entry from DIRP.  */
+struct dirent *
+__readdir (DIR *dirp)
+{
+  __set_errno (ENOSYS);
+  return NULL;
+}
+weak_alias (__readdir, readdir)
+
+stub_warning (readdir)
+#include <stub-tag.h>
diff --git a/dirent/readdir64.c b/dirent/readdir64.c
new file mode 100644
index 0000000000..0c18bd9440
--- /dev/null
+++ b/dirent/readdir64.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 1998 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 <dirent.h>
+
+/* Read a directory entry from DIRP.  */
+struct dirent64 *
+__readdir64 (DIR *dirp)
+{
+  __set_errno (ENOSYS);
+  return NULL;
+}
+weak_alias (__readdir64, readdir64)
+stub_warning (readdir64)
+#include <stub-tag.h>
diff --git a/dirent/readdir64_r.c b/dirent/readdir64_r.c
new file mode 100644
index 0000000000..cf9e952e1a
--- /dev/null
+++ b/dirent/readdir64_r.c
@@ -0,0 +1,33 @@
+/* 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 <dirent.h>
+
+/* Read a directory entry from DIRP, store result in ENTRY and return
+   pointer to result in *RESULT.  */
+int
+readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
+{
+  __set_errno (ENOSYS);
+  *result = NULL;
+  return -1;
+}
+stub_warning (readdir64_r)
+#include <stub-tag.h>
diff --git a/dirent/readdir_r.c b/dirent/readdir_r.c
new file mode 100644
index 0000000000..ad45dfa504
--- /dev/null
+++ b/dirent/readdir_r.c
@@ -0,0 +1,35 @@
+/* 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 <dirent.h>
+
+/* Read a directory entry from DIRP, store result in ENTRY and return
+   pointer to result in *RESULT.  */
+int
+__readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
+{
+  __set_errno (ENOSYS);
+  *result = NULL;
+  return ENOSYS;
+}
+weak_alias (__readdir_r, readdir_r)
+
+stub_warning (readdir_r)
+#include <stub-tag.h>
diff --git a/dirent/rewinddir.c b/dirent/rewinddir.c
new file mode 100644
index 0000000000..e78d316880
--- /dev/null
+++ b/dirent/rewinddir.c
@@ -0,0 +1,35 @@
+/* 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 <dirent.h>
+
+
+/* Rewind DIRP to the beginning of the directory.  */
+void
+rewinddir (dirp)
+     DIR *dirp;
+{
+  __set_errno (ENOSYS);
+  /* No way to indicate failure.	*/
+}
+
+
+stub_warning (rewinddir)
+#include <stub-tag.h>
diff --git a/dirent/scandir64.c b/dirent/scandir64.c
new file mode 100644
index 0000000000..68608de9a0
--- /dev/null
+++ b/dirent/scandir64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2000 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 <dirent.h>
+
+#define SCANDIR scandir64
+#define READDIR __readdir64
+#define DIRENT_TYPE struct dirent64
+
+int scandir64 (__const char *__restrict __dir,
+	       struct dirent64 ***__restrict __namelist,
+	       int (*__selector) (__const struct dirent64 *),
+	       int (*__cmp) (__const void *, __const void *));
+
+#include <dirent/scandir.c>
diff --git a/dirent/seekdir.c b/dirent/seekdir.c
new file mode 100644
index 0000000000..c3828cde0f
--- /dev/null
+++ b/dirent/seekdir.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 1999 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 <sys/types.h>
+#include <errno.h>
+#include <stddef.h>
+#include <dirent.h>
+
+/* Seek to position POS in DIRP.  */
+void
+seekdir (dirp, pos)
+     DIR *dirp;
+     long int pos;
+{
+  if (dirp == NULL)
+    {
+      __set_errno (EINVAL);
+      return;
+    }
+
+  __set_errno (ENOSYS);
+}
+
+
+stub_warning (seekdir)
+#include <stub-tag.h>
diff --git a/dirent/telldir.c b/dirent/telldir.c
new file mode 100644
index 0000000000..7b14452327
--- /dev/null
+++ b/dirent/telldir.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 1999 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 <sys/types.h>
+#include <stddef.h>
+#include <dirent.h>
+
+/* Return the current position of DIRP.  */
+long int
+telldir (dirp)
+     DIR *dirp;
+{
+  if (dirp == NULL)
+    {
+      __set_errno (EINVAL);
+      return -1l;
+    }
+
+  __set_errno (ENOSYS);
+  return -1l;
+}
+
+
+stub_warning (telldir)
+#include <stub-tag.h>
diff --git a/dirent/versionsort64.c b/dirent/versionsort64.c
new file mode 100644
index 0000000000..e471827023
--- /dev/null
+++ b/dirent/versionsort64.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1992, 1997, 1998, 2000 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 <dirent.h>
+#include <string.h>
+
+int
+versionsort64 (const void *a, const void *b)
+{
+  return __strverscmp ((*(const struct dirent64 **) a)->d_name,
+		       (*(const struct dirent64 **) b)->d_name);
+}