C calls FORTRAN subroutine

leiby at masscomp.UUCP leiby at masscomp.UUCP
Tue Oct 23 06:04:37 AEST 1984


Regarding the fellow who calls a FORTRAN subroutine from his C
program and is then unable to do I/O from within the FORTRAN
subroutine:

The problem here is that the FORTRAN start-up code maps logical
unit numbers to Unix(tm) file descriptors in an implementation
dependent way.  Since the main program is in C, none of this
setup gets done.  Thus when the FORTRAN I/O library call is
executed, it can't find a valid logical unit number table,
and the output (if any) is trashed.  I'd be amazed if the fellow
gets any output at all.

A solution?  Unless you have the compiler code to look at, I'm
afraid it's like the old joke:

	Patient:  Dr., it hurts when I do this.
	Doctor:	  Well, don't do that!!!

		Mike Leibensperger
		{decvax,ihnp4,harpo,tektronix}!masscomp!leiby
-- 
Mike Leibensperger
{decvax,tektronix,harpo}!masscomp!leiby
Masscomp; One Technology Park; Westford MA 01886



More information about the Comp.unix mailing list