2000-10-10 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
[official-gcc.git] / libio / stdio / setfileno.c
blobf7ccc6fdd666860005f6f0152448ae357092158a
1 /* Some known programs (xterm, pdksh?) non-portably change the _file
2 field of s struct _iobuf. This kludge allows the same "functionality".
3 This code is an undocumented feature for iostream/stdio. Use it at
4 your own risk. */
6 #include "libioP.h"
7 #include "stdio.h"
9 void
10 setfileno(fp, fd)
11 _IO_FILE* fp;
12 int fd;
14 CHECK_FILE(fp, );
15 if ((fp->_flags & _IO_IS_FILEBUF) != 0)
16 fp->_fileno = fd;