summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r--unix/tclUnixFile.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 1ab5d14..998614d 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -41,10 +41,10 @@ TclpFindExecutable(
{
Tcl_Encoding encoding;
int length;
- wchar_t buf[PATH_MAX];
+ wchar_t buf[PATH_MAX] = L"";
char name[PATH_MAX * 3 + 1];
- GetModuleFileNameW(NULL, buf, sizeof(buf)/sizeof(wchar_t));
+ GetModuleFileNameW(NULL, buf, PATH_MAX);
cygwin_conv_path(3, buf, name, sizeof(name));
length = strlen(name);
if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
@@ -1198,6 +1198,29 @@ TclpUtime(
#ifdef __CYGWIN__
int
+TclOSfstat(
+ int fd,
+ void *cygstat)
+{
+ struct stat buf;
+ Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
+ int result = fstat(fd, &buf);
+
+ statBuf->st_mode = buf.st_mode;
+ statBuf->st_ino = buf.st_ino;
+ statBuf->st_dev = buf.st_dev;
+ statBuf->st_rdev = buf.st_rdev;
+ statBuf->st_nlink = buf.st_nlink;
+ statBuf->st_uid = buf.st_uid;
+ statBuf->st_gid = buf.st_gid;
+ statBuf->st_size = buf.st_size;
+ statBuf->st_atime = buf.st_atime;
+ statBuf->st_mtime = buf.st_mtime;
+ statBuf->st_ctime = buf.st_ctime;
+ return result;
+}
+
+int
TclOSstat(
const char *name,
void *cygstat)