Hi,
Tony Wyatt wrote:
At runtime, there's no problem since it's actually using the C library of SAS/C...
Maybe when I try to compile it with gcc, I'll understand what you are saying. Right now, compiling with SAS/C is not a problem.
It's actually very simple: You know that some functions like open return an integer as the file descriptor ? Normally, the C library keeps an array of structures that describe open files, and the int returned by open is used as an index into that array. The array keeps the "real" file handles, for example, it could be an array of BPTRs for DOS with the DOS file handles.
The csh code uses this array, copying stdin and stdout (which are normally index 0 and 1). Of course, this is nor portable, since every C library names this array differently, and uses a different layout of the array and structures. So basically, it's accessing internal data structures of the C library, which can't be easily ported over...
Regards,