Accessing external functions (was: Newbie question)

Fri, 6 Sep 1996 18:46:06 +0200 (MET DST)


Hello Patricio,

> I currently teaching Operative System to students who only know Pascal, 
> so I'd like to know if we can use
> Unix System calls in pascal programs wirh GPC ? I mean stuff like
> 'fork()', 'exec()', etc...

You can access any function using the "external", "C", and "asmname"
directives:

    Procedure fork; external;

means: there is an external Procedure "Fork" (first letter uppercase),


    Procedure fork; C;

means: there is an external Procedure "fork" (everything lowercase), and


    Procedure fork; asmname 'foO';

means: there is an external Procedure with the funny name "foO"
(last letter is uppercase in this example) which can be accessed
from Pascal via the name "fork".

Good luck,

    Peter


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es