Guardian C Library Calls Reference Manual

fdtogfn (supplementary)
3-38 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
fdtogfn (supplementary)
The fdtogfn function retrieves the file number of a file opened for alternate I/O.
file_des
is the descriptor denoting a file opened for alternate I/O.
Return Value
is the Guardian file number of the file or -1 if file_des does not represent an open
file.
Example
This example returns the file number of the file $a.b.c:
#include <fcntlh>
short filedes;
short filenum;
filedes = open("$a.b.c", O_RDWR);
/* ... */
filenum = fdtogfn(filedes);
#include <fcntlh>
short fdtogfn(short file_des);