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/syscalls.cc
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/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc49
1 files changed, 42 insertions, 7 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 961bc3f12..f66363f7d 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1033,8 +1033,16 @@ fstat64 (int fd, struct __stat64 *buf)
return res;
}
-extern "C" int _fstat64 (int fd, _off64_t pos, int dir)
- __attribute__ ((alias ("fstat64")));
+extern "C" int
+_fstat64_r (struct _reent *ptr, int fd, struct __stat64 *buf)
+{
+ int ret;
+
+ set_errno (0);
+ if ((ret = fstat64 (fd, buf)) == -1 && get_errno () != 0)
+ ptr->_errno = get_errno ();
+ return ret;
+}
extern "C" int
fstat (int fd, struct __stat32 *buf)
@@ -1046,8 +1054,16 @@ fstat (int fd, struct __stat32 *buf)
return ret;
}
-extern "C" int _fstat (int fd, _off64_t pos, int dir)
- __attribute__ ((alias ("fstat")));
+extern "C" int
+_fstat_r (struct _reent *ptr, int fd, struct __stat32 *buf)
+{
+ int ret;
+
+ set_errno (0);
+ if ((ret = fstat (fd, buf)) == -1 && get_errno () != 0)
+ ptr->_errno = get_errno ();
+ return ret;
+}
/* fsync: P96 6.6.1.1 */
extern "C" int
@@ -1133,9 +1149,6 @@ stat_worker (const char *name, struct __stat64 *buf, int nofollow,
return res;
}
-extern "C" int _stat (int fd, _off64_t pos, int dir)
- __attribute__ ((alias ("stat")));
-
extern "C" int
stat64 (const char *name, struct __stat64 *buf)
{
@@ -1145,6 +1158,17 @@ stat64 (const char *name, struct __stat64 *buf)
}
extern "C" int
+_stat64_r (struct _reent *ptr, const char *name, struct __stat64 *buf)
+{
+ int ret;
+
+ set_errno (0);
+ if ((ret = stat64 (name, buf)) == -1 && get_errno () != 0)
+ ptr->_errno = get_errno ();
+ return ret;
+}
+
+extern "C" int
stat (const char *name, struct __stat32 *buf)
{
struct __stat64 buf64;
@@ -1154,6 +1178,17 @@ stat (const char *name, struct __stat32 *buf)
return ret;
}
+extern "C" int
+_stat_r (struct _reent *ptr, const char *name, struct __stat32 *buf)
+{
+ int ret;
+
+ set_errno (0);
+ if ((ret = stat (name, buf)) == -1 && get_errno () != 0)
+ ptr->_errno = get_errno ();
+ return ret;
+}
+
/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
extern "C" int
lstat64 (const char *name, struct __stat64 *buf)