summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-03-17 19:08:11 +0000
committerChristopher Faylor <me@cgf.cx>2003-03-17 19:08:11 +0000
commit3543669fd3f89f980180d914ead7e01397f8a502 (patch)
treebae0cab9587d1928f810183f31f7ade7f8eff2b5 /winsup/cygwin/syscalls.cc
parentdb14b4abb74c2b3be138f117636c7e2d7844f633 (diff)
downloadcygnal-3543669fd3f89f980180d914ead7e01397f8a502.tar.gz
cygnal-3543669fd3f89f980180d914ead7e01397f8a502.tar.bz2
cygnal-3543669fd3f89f980180d914ead7e01397f8a502.zip
* 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.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc23
1 files changed, 18 insertions, 5 deletions
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 <sys/uio.h>
#include <errno.h>
#include <limits.h>
+#include <unistd.h>
+#include <setjmp.h>
#include <winnls.h>
#include <wininet.h>
#include <lmcons.h> /* for UNLEN */
+
+#undef fstat
+#undef stat
+
#include <cygwin/version.h>
#include <sys/cygwin.h>
#include "cygerrno.h"
@@ -42,11 +50,9 @@ details. */
#include "dtable.h"
#include "sigproc.h"
#include "pinfo.h"
-#include <unistd.h>
#include "shared_info.h"
#include "cygheap.h"
#define NEED_VFORK
-#include <setjmp.h>
#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);