Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-05-12 15:06:27 +0400
committerCorinna Vinschen <corinna@vinschen.de>2003-05-12 15:06:27 +0400
commit194d9eb318403b1618c3f77eba6de4e17b7c900d (patch)
tree2c7028f9a5a1f8c1c60e37a6556aa9d8e1556cf7 /winsup/cygwin/include/sys/dirent.h
parent01859fc441c2f253f258bbe13de1e77ba2ffe8bd (diff)
* Makefile.in (CYGWIN_START): Define as crt0.o. Add to TARGET_LIBS.
* fhandler.h (fhandler_virtual::fstat): Remove useless declaration. * fhandler_virtual.cc: Remove _COMPILING_NEWLIB define. * ipc.cc (ftok): Use stat64. * syscalls.cc (_fstat64): Remove alias. (_fstat): Ditto. (_stat): Ditto. (_fstat64_r): New function. (_fstat_r): Ditto. (_stat64_r): Ditto. (stat_r): Ditto. * crt0.o: New file, moved from newlib. * include/sys/param.h: Ditto. * include/sys/utime.h: Ditto. * include/sys/utmp.h: Ditto. * include/sys/dirent.h: Ditto. Expose different struct dirent, dependening of the environment.
Diffstat (limited to 'winsup/cygwin/include/sys/dirent.h')
-rw-r--r--winsup/cygwin/include/sys/dirent.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/winsup/cygwin/include/sys/dirent.h b/winsup/cygwin/include/sys/dirent.h
new file mode 100644
index 000000000..a077169b9
--- /dev/null
+++ b/winsup/cygwin/include/sys/dirent.h
@@ -0,0 +1,97 @@
+/* Posix dirent.h for WIN32.
+
+ Copyright 2001 Red Hat, Inc.
+
+ This software is a copyrighted work licensed under the terms of the
+ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+ details. */
+
+/* Including this file should not require any Windows headers. */
+
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+
+#include <sys/types.h>
+
+#define __DIRENT_VERSION 2
+
+#pragma pack(push,4)
+#ifdef __INSIDE_CYGWIN__
+struct dirent
+{
+ long d_version; /* Used since Cygwin 1.3.3. */
+ __ino64_t d_ino; /* still junk but with more bits */
+ long d_fd; /* File descriptor of open directory.
+ Used since Cygwin 1.3.3. */
+ __ino32_t old_d_ino; /* Just for compatibility, it's junk */
+ char d_name[256]; /* FIXME: use NAME_MAX? */
+};
+#else
+#ifdef __CYGWIN_USE_BIG_TYPES__
+struct dirent
+{
+ long d_version;
+ ino_t d_ino;
+ long d_fd;
+ unsigned long old_d_ino;
+ char d_name[256];
+};
+#else
+struct dirent
+{
+ long d_version;
+ long d_reserved[2];
+ long d_fd;
+ ino_t d_ino;
+ char d_name[256];
+};
+#endif
+#endif
+#pragma pack(pop)
+
+#define __DIRENT_COOKIE 0xdede4242
+
+typedef struct __DIR
+{
+ /* This is first to set alignment in non _COMPILING_NEWLIB case. */
+ unsigned long __d_cookie;
+ struct dirent *__d_dirent;
+ char *__d_dirname; /* directory name with trailing '*' */
+ _off_t __d_position; /* used by telldir/seekdir */
+ unsigned long __d_dirhash; /* hash of directory name for use by
+ readdir */
+ union
+ {
+#ifdef __INSIDE_CYGWIN__
+ struct
+ {
+ void *__handle;
+ void *__fh;
+ } __d_data;
+#endif
+ char __d_filler[16];
+ } __d_u;
+} DIR;
+
+DIR *opendir (const char *);
+struct dirent *readdir (DIR *);
+void rewinddir (DIR *);
+int closedir (DIR *);
+
+int dirfd (DIR *);
+
+#ifndef _POSIX_SOURCE
+#ifndef __INSIDE_CYGWIN__
+off_t telldir (DIR *);
+void seekdir (DIR *, off_t loc);
+#endif
+
+int scandir (const char *__dir,
+ struct dirent ***__namelist,
+ int (*select) (const struct dirent *),
+ int (*compar) (const struct dirent **, const struct dirent **));
+
+int alphasort (const struct dirent **__a, const struct dirent **__b);
+#endif /* _POSIX_SOURCE */
+
+#endif