[RFD]: fcntl call substituting `setmode'

Chris Faylor cgf@cygnus.com
Tue May 16 13:32:00 GMT 2000

On Tue, May 16, 2000 at 10:15:32PM +0200, Corinna Vinschen wrote:
>Hi all,
>I'm just using the `setmode' function and I wonder
>if it wouldn't be a nice thing to have some sort of
>fcntl call for that, eg.
>	fcntl(fd, F_SETMODE, O_TEXT);
>and a corresponding:
>	int mode;
>	fcntl(fd, F_GETMODE, &mode);
>and -- because it's that nice -- a substitute for
>	HANDLE hdl;
>	fcntl(fd, F_GETOSFHDL, &hdl);
>I would like that more than the Windowish calls
>and we could get rid of the io.h file for cygwin.
>Not instantly of course.

Except that get_osfhandle and setmode are both standard methods
for doing things in Windows.  They weren't invented for cygwin.

setmode, in particular, is actually implemented on some other systems, I
believe.  It's probably a no-op but...

It's possible that your fcntl method actually is implemented that way
in Microsoft-land.  Have you checked msdn?  If so, we should definitely
implement it.

Actually, I have no problems with implementing this in general but I
just want to make sure that we use an existing interface if one exists.


More information about the Cygwin-developers mailing list