From 194d9eb318403b1618c3f77eba6de4e17b7c900d Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 12 May 2003 11:06:27 +0000 Subject: * 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. --- winsup/cygwin/syscalls.cc | 49 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/syscalls.cc') 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) { @@ -1144,6 +1157,17 @@ stat64 (const char *name, struct __stat64 *buf) return stat_worker (name, buf, 0); } +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) { @@ -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) -- cgit v1.2.3