From owner-oi-users Fri Mar 10 09:23:28 1995 Return-Path: oi-users-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA18665 for oi-users-outgoing; Fri, 10 Mar 1995 09:23:28 -0800 Received: from marvin.boulder.openware.com (marvin.boulder.openware.com [192.245.99.138]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id JAA18658 for ; Fri, 10 Mar 1995 09:23:09 -0800 Received: from boulder.openware.com (localhost.boulder.parcplace.com [127.0.0.1]) by marvin.boulder.openware.com (8.6.9/8.6.9) with ESMTP id KAA25313; Fri, 10 Mar 1995 10:19:02 -0700 Message-Id: <199503101719.KAA25313@marvin.boulder.openware.com> To: patriot3!cchou@phi.com (Carol Chou) Subject: Re: OI on solaris Cc: oi-users@freefall.cdrom.com In-reply-to: Your message of Fri, 10 Mar 1995 08:32:43 CST Date: Fri, 10 Mar 1995 10:18:59 MST From: Warner Losh Sender: oi-users-owner@FreeBSD.org Precedence: bulk : Have anyone ported OI applications from SunOS4.1 to Solaris 2.4 (or Solaris 2.3)? I have :-). I've also ported OI to a bunch of different platforms, in addition to all of its demos and the like. : We also use NIH library as our class library. Is it a lot of efforts involved in : porting it? If you have any ideas about it, could you give me an estimate : on how big the effort would be, such as time, code change,..etc? Sun has a tool : call STT which should automatically convert the code to solaris 2. How helpful : it is? STT is marginally useful. When we used it (back in the Solaris pre alpha days), it was C++ stupid. So, if you had a class that had a member function open or ioctl or some other system name, it would whine at you, so you had to take its complaints with a big grain of salt. Your best bet: get a source tree on the Solaris machine, type make and look at the amount of output that it gives you. This will likely give you some idea the scope of the build process. Don't worry, for now, if you don't have an OI library, as the headers will do just fine to find out how big the task is. If this project has never been ported to another system, I'd allow for at least 1 month / 20,000 lines of code, if not more. You might get lucky and not need this large amount of time, but on the other hand, you may have your code riddled with SunOSisms that need to be converted to Solarisisms. If you've ported this to a lot of systems, then it will likely take about 1 wk/200,000 lines (that's about what OI/OB takes for most ports that are basically POSIX.1 systems, give or take for Xisms). NIH, can't tell you on that, since I've not used it. Things OI uses to get its portibility (in a nutshell): 1) Code to the POSIX.1 and ANSI C APIs. Provide them when they aren't in the target environment. (Well, we also use strdup(3) which isn't in either, but most systems have it). 2) Don't use sysent.h, osfcn.h to get your prototypes. Instead use unistd.h. Alas, this isn't a hard and fast rule, as sometimes on Sparc you'll need sysent.h for some things. 3) Use memmove and memcopy as opposed to bcopy. Ditto memset and memcpm. 4) Use strchr and strrchr rather than index and rindex 5) include string.h, not strings.h 6) Try not to use the exotic parts of C++ (templates, exceptions, etc) as many compilers have conflicting implementations for some of these and some don't implement them at all. 7) Don't write code that depends on byte ordering. Warner