From 3543669fd3f89f980180d914ead7e01397f8a502 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 17 Mar 2003 19:08:11 +0000 Subject: * cygwin.din: Export btowc, trunc. * include/cygwin/version.h: Reflect new exports. * syscalls.cc (_stat): Rename to stat to avoid newlib wrapper. * syscalls.cc (_fstat): Ditto. * fhandler_console.cc (fhandler_console::close): Correct check for current tty. Add debugging output when console is freed. (set_console_state_for_spawn): Add debugging output. * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console open flag when vforking. * sigproc.cc (sigproc_terminate): Fix debugging output. * spawn.cc (handle): Eliminate second argument. (spawn_guts): Reflect elimination of argument change to handle. * syscalls.cc (setsid): Add debugging output when console is freed. * syscalls.cc (rename): Revert assumption that DELETE_ON_CLOSE works on Win9x. --- winsup/cygwin/syscalls.cc | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/syscalls.cc') diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 097dacbdb..c59a5fcf3 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -8,6 +8,8 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#define fstat __FOOfstat__ +#define stat __FOOstat__ #define _close __FOO_close__ #define _lseek __FOO_lseek__ #define _open __FOO_open__ @@ -29,9 +31,15 @@ details. */ #include #include #include +#include +#include #include #include #include /* for UNLEN */ + +#undef fstat +#undef stat + #include #include #include "cygerrno.h" @@ -42,11 +50,9 @@ details. */ #include "dtable.h" #include "sigproc.h" #include "pinfo.h" -#include #include "shared_info.h" #include "cygheap.h" #define NEED_VFORK -#include #include "perthread.h" #include "pwdgrp.h" @@ -153,7 +159,8 @@ unlink (const char *ourname) BOOL res = CloseHandle (h); syscall_printf ("%d = CloseHandle (%p)", res, h); if (!win32_name.isremote () - || GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES) + || (GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES + || wincap.has_delete_on_close ())) { syscall_printf ("CreateFile (FILE_FLAG_DELETE_ON_CLOSE) succeeded"); goto ok; @@ -1017,7 +1024,7 @@ extern "C" int _fstat64 (int fd, __off64_t pos, int dir) __attribute__ ((alias ("fstat64"))); extern "C" int -_fstat (int fd, struct __stat32 *buf) +fstat (int fd, struct __stat32 *buf) { struct __stat64 buf64; int ret = fstat64 (fd, &buf64); @@ -1026,6 +1033,9 @@ _fstat (int fd, struct __stat32 *buf) return ret; } +extern "C" int _fstat (int fd, __off64_t pos, int dir) + __attribute__ ((alias ("fstat"))); + /* fsync: P96 6.6.1.1 */ extern "C" int fsync (int fd) @@ -1110,6 +1120,9 @@ 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) { @@ -1119,7 +1132,7 @@ stat64 (const char *name, struct __stat64 *buf) } extern "C" int -_stat (const char *name, struct __stat32 *buf) +stat (const char *name, struct __stat32 *buf) { struct __stat64 buf64; int ret = stat64 (name, &buf64); -- cgit v1.2.3