Porting C under UNIX to OS/2
Kai-Uwe Rommel
rommel at Informatik.TU-Muenchen.DE
Fri Mar 22 18:20:57 AEST 1991
In article <583 at genco.bungi.com> rad at genco.bungi.com (Bob Daniel) writes:
>In article <907 at npdiss1.StPaul.NCR.COM> remde at npdiss1.StPaul.NCR.COM (Kevin Remde) writes:
>>I've recently been given the task of researching the ins and outs of
>>porting C code from UNIX to OS/2 platforms. I was wondering where I
>>might find books or other resources that might help me in this task.
>
>I have not ported a UNIX app to OS/2 but have done it to Macintosh. The key
>issue is the compiler you use. I was using a compiler that contained all the
>UNIX libraries (and ANSI C). It was Think C. This biggest issue that came
>up was forking processes. It was however relatively easy to deal with. Just
>modify it to run under the same process.
During porting several programs to OS/2 I found two main problems.
1. Many Unix programs rely on Unix-specific library routines that are
not supported even by the very Unix-compatible Microsoft C compiler,
most notably the POSIX directory access routines (opendir/readir/
closedir) and regular expression routines and getopt. I had to
collect or write/modify such routines. Once I had them, porting was
much easier.
2. Many today's Unix programs assume a 32bit machine with
sizeof(int) = sizeof(long) = sizeof(any pointer) = 32bits.
This is not easy to solve.
(Anyone still asking why GNU emacs is not yet available for OS/2 :-)
Kai Uwe Rommel
More information about the Comp.unix.misc
mailing list