/*
 *			f i l e n o . c
 */

/*)LIBRARY
*/

#ifdef	DOCUMENTATION

title	fileno	Return file number
index		Return file number

synopsis
	s.nf
	fileno(iop)
	FILE		*iop;
	.s.f
Description

	Return file number (small integer)

Bugs

#endif

#include	<stdio.h>
#ifdef	fileno
#undef	fileno
#endif

#ifdef	rsx
extern	char	*F_LUN;
#endif

int
fileno(fd)
FILE	*fd;
/*
 * Return file number
 */
{
#ifdef	rt11
	return (fd->io_lun);
#else
#ifdef	rsx
	return (fd->io_fdb[(int) &F_LUN]);
#else
	return (fd - _iob);
#endif
#endif
}
