nbfd->iostream = (char *)fopen(filename, FOPEN_RB);
nbfd->iostream = (PTR)fopen(filename, FOPEN_RB);
bfd_fdopenr (filename, target, fd)     CONST char *filename;     CONST char *target;     int fd;{  bfd *nbfd;  const bfd_target *target_vec;  int fdflags;  bfd_set_error (bfd_error_system_call);#if ! defined(HAVE_FCNTL) || ! defined(F_GETFL)  fdflags = O_RDWR;			/* Assume full access */#else  fdflags = fcntl (fd, F_GETFL, NULL);#endif  if (fdflags == -1) return NULL;  nbfd = _bfd_new_bfd();  if (nbfd == NULL) {    bfd_set_error (bfd_error_no_memory);    return NULL;  }  target_vec = bfd_find_target (target, nbfd);  if (target_vec == NULL) {    bfd_set_error (bfd_error_invalid_target);    return NULL;  }#if defined(VMS) || defined(__GO32__) || defined (WINGDB)  nbfd->iostream = (char *)fopen(filename, FOPEN_RB);#else  /* (O_ACCMODE) parens are to avoid Ultrix header file bug */  switch (fdflags & (O_ACCMODE)) {  case O_RDONLY: nbfd->iostream = (char *) fdopen (fd, FOPEN_RB);   break;  case O_WRONLY: nbfd->iostream = (char *) fdopen (fd, FOPEN_RUB);  break;  case O_RDWR:   nbfd->iostream = (char *) fdopen (fd, FOPEN_RUB);  break;  default: abort ();  }#endif  if (nbfd->iostream == NULL) {    (void) obstack_free (&nbfd->memory, (PTR)0);    return NULL;  }  /* OK, put everything where it belongs */  nbfd->filename = filename;  /* As a special case we allow a FD open for read/write to     be written through, although doing so requires that we end     the previous clause with a preposition.  */  /* (O_ACCMODE) parens are to avoid Ultrix header file bug */  switch (fdflags & (O_ACCMODE)) {  case O_RDONLY: nbfd->direction = read_direction; break;  case O_WRONLY: nbfd->direction = write_direction; break;  case O_RDWR: nbfd->direction = both_direction; break;  default: abort ();  }				  if (! bfd_cache_init (nbfd))    return NULL;  return nbfd;}