summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-09-01 13:07:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-09-01 13:07:18 (GMT)
commite882b751f3aff6fdae518359623b7db59d4843d6 (patch)
tree90692d532fc3c6701f9ab7b0f5b5a0696ac43e50 /unix/tclUnixFile.c
parent179a97b763c7f1ea393680661106815915cef816 (diff)
parentfdf0eab42848aced45b470262cc3507d2f9a8c5f (diff)
downloadtcl-e882b751f3aff6fdae518359623b7db59d4843d6.zip
tcl-e882b751f3aff6fdae518359623b7db59d4843d6.tar.gz
tcl-e882b751f3aff6fdae518359623b7db59d4843d6.tar.bz2
Merge 8.7
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)