12.07.2015 Views

LF95 Linux User's Guide - Lahey Computer Systems

LF95 Linux User's Guide - Lahey Computer Systems

LF95 Linux User's Guide - Lahey Computer Systems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Calling Standard C LibrariesExample: Blank CommonPassing data via blank common is accomplished in the same manner as in the above example,except in the C code, the name ext_ is replaced by _BLNK_.Calling Standard C LibrariesWhen calling functions in the <strong>Linux</strong> kernel and standard C libraries, it is necessary to applythe ML_EXTERNAL statement to the function name, and compile with the --ml compileroption.Example: Calling a <strong>Linux</strong> Kernel FunctionThe following Fortran program illustrates a call to the standard function usleep().program callsysml_external usleepwrite(*,*) 'Going to sleep...'! sleep for 10 secondscall usleep(10000000)write (*,*) ' Wake up!'end programThe above program must be compiled using the command line,lfc callsys.f90 --ml cdecl<strong>Lahey</strong>/Fujitsu <strong>Linux</strong>64 Fortran User’s <strong>Guide</strong> 63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!