summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclInt.decls4
-rw-r--r--generic/tclIntPlatDecls.h8
-rw-r--r--generic/tclStubInit.c10
3 files changed, 18 insertions, 4 deletions
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 9eb8320..97517ea 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -1084,6 +1084,10 @@ declare 15 win {
const char **argv, TclFile inputFile, TclFile outputFile,
TclFile errorFile, Tcl_Pid *pidPtr)
}
+# new for 8.4.20+/8.5.12+ Cygwin only
+declare 16 win {
+ int TclpIsAtty(int fd)
+}
# Signature changed in 8.1:
# declare 16 win {
# TclFile TclpCreateTempFile(char *contents, Tcl_DString *namePtr)
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index 77cf197..960a4f2 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -138,7 +138,8 @@ EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
const char **argv, TclFile inputFile,
TclFile outputFile, TclFile errorFile,
Tcl_Pid *pidPtr);
-/* Slot 16 is reserved */
+/* 16 */
+EXTERN int TclpIsAtty(int fd);
/* Slot 17 is reserved */
/* 18 */
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
@@ -287,7 +288,7 @@ typedef struct TclIntPlatStubs {
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
- void (*reserved16)(void);
+ int (*tclpIsAtty) (int fd); /* 16 */
void (*reserved17)(void);
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
@@ -430,7 +431,8 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
(tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
#define TclpCreateProcess \
(tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
-/* Slot 16 is reserved */
+#define TclpIsAtty \
+ (tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
/* Slot 17 is reserved */
#define TclpMakeFile \
(tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 0f0665b..1cbcf84 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -56,7 +56,9 @@ static int TclSockMinimumBuffersOld(int sock, int size)
#ifdef __WIN32__
# define TclUnixWaitForFile 0
# define TclpReaddir 0
+# define TclpIsAtty 0
#elif defined(__CYGWIN__)
+# define TclpIsAtty TclPlatIsAtty
# define TclWinSetInterfaces (void (*) (int)) doNothing
# define TclWinAddProcess (void (*) (void *, unsigned int)) doNothing
# define TclWinFlushDirtyChannels doNothing
@@ -64,6 +66,12 @@ static int TclSockMinimumBuffersOld(int sock, int size)
static Tcl_Encoding winTCharEncoding;
+static int
+TclpIsAtty(int fd)
+{
+ return isatty(fd);
+}
+
int
TclWinGetPlatformId()
{
@@ -489,7 +497,7 @@ static const TclIntPlatStubs tclIntPlatStubs = {
TclpCreateCommandChannel, /* 13 */
TclpCreatePipe, /* 14 */
TclpCreateProcess, /* 15 */
- 0, /* 16 */
+ TclpIsAtty, /* 16 */
0, /* 17 */
TclpMakeFile, /* 18 */
TclpOpenFile, /* 19 */