﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
246	Outdated Information about file handles	dmik	bird	"If the process connects its stdin/out/err handles to pipes using DosDupHandle() and then starts a child with spawn*() (perhaps, fork too?), isatty() called in the child one will return 1 for stdin/out/err while they are actually pipes, not character devices any longer.

In fact, calling isatty() in the parent process after DosDupHandle() will continue to return 1 too.

My guess is that once LIBC has cached imported file handle information, it is never refreshed. I see these options:

 1. Don't cache information for imported file handles but instead always fetch it from the system. The question is the performance impact.

 2. Provide a custom __libc extension (available to end user programs) that resets the cache of imported file handles. This extension is to be called by the end user program when it manipulates file handles bypassing LIBC (as in case of DosDupHandle()) as well as by spawn*() and fork().

 3. A combination of 1 and 2. I.e. reset the cache for the particular handle in public calls like isatty() but still use the cached information internally (i.e. through __libc_FH, etc.). This should not have a big performance impact and still free the programmer from caring about this cache at all (which is a good thing).
"	defect	closed	normal		baselayout		major	wontfix		
