File:  [Apple XNU] / GNUtools / libg++ / libio / stdio / setfileno.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:45:53 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, GNUtools33
GNU tools for NeXTSTEP 3.3

/* Some known programs (xterm, pdksh?) non-portably change the _file
   field of s struct _iobuf.  This kludge allows the same "functionality".
   This code is an undocumented feature for iostream/stdio. Use it at
   your own risk. */

#include "libioP.h"
#include "stdio.h"

void
setfileno(fp, fd)
     _IO_FILE* fp;
     int fd;
{
  COERCE_FILE(fp);
  if ((fp->_flags & _IO_IS_FILEBUF) != 0)
    fp->_fileno = fd;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.