Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!spool.mu.edu!uunet!math.fu-berlin.de!opal!fauern!NewsServ!rommel From: rommel@Informatik.TU-Muenchen.DE (Kai-Uwe Rommel) Newsgroups: comp.unix.misc Subject: Re: Porting C under UNIX to OS/2 Keywords: UNIX, OS/2, Porting Message-ID: <1991Mar22.082057.6644@Informatik.TU-Muenchen.DE> Date: 22 Mar 91 08:20:57 GMT References: <907@npdiss1.StPaul.NCR.COM> <583@genco.bungi.com> Sender: news@Informatik.TU-Muenchen.DE Organization: Technische Universitaet Muenchen, Germany Lines: 27 In article <583@genco.bungi.com> rad@genco.bungi.com (Bob Daniel) writes: >In article <907@npdiss1.StPaul.NCR.COM> remde@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