1
0
Files
irix-657m-src/eoe/cmd/sccs/lib/mpwlib/fdfopen.c
2022-09-29 17:59:04 +03:00

34 lines
833 B
C

/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
/* UNIX System Laboratories, Inc. */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ident "@(#)sccs:lib/mpwlib/fdfopen.c 6.5"
/*
Interfaces with /lib/libS.a
First arg is file descriptor, second is read/write mode (0/1).
Returns file pointer on success,
NULL on failure (no file structures available).
*/
# include "stdio.h"
# include "sys/types.h"
# include "macros.h"
FILE *
fdfopen(fd, mode)
register int fd, mode;
{
int fstat64();
if (fstat64(fd, &Statbuf) < 0)
return(NULL);
if (mode)
return(fdopen(fd,"w"));
else
return(fdopen(fd,"r"));
}