* 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.
This commit is contained in:
Corinna Vinschen
2003-05-12 11:06:27 +00:00
parent 01859fc441
commit 194d9eb318
11 changed files with 368 additions and 12 deletions

View File

@@ -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)