[comp.unix.wizards] Convert between versions of UNIX

brinkema@fjcnet.GOV (John R. Brinkema) (09/22/89)

I am writing a paper about the problems of converting (porting) software
between various versions of UNIX, in particular *standard UNIX* System V,
BSD 4.x, and Xenix.  I have done many ports in many 'directions' but am
very interested in others' experience.

In particular, do you have a standard procedure; a set of feature-areas that
you always check; tricks that make the porting easier?  Also what are the
hardest feature to port; what features are so subtle that bugs from them
hide?

I will sumarize.  tia.  jb.

reggie@dinsdale.nm.paradyne.com (George W. Leach) (09/23/89)

    I tried to reply via e-mail, but uunet bounced it back to me.

From pdn.paradyne.com!uunet!MAILER-DAEMON Fri Sep 22 13:07:09 1989
Date: Fri, 22 Sep 89 13:05:28 -0400
From: pdn!uunet!MAILER-DAEMON (Mail Delivery Subsystem)
Subject: Returned mail: Host unknown
Message-Id: <8909221705.AA04717@uunet.uu.net>
To: pdn!dinsdale.paradyne.com!reggie

   ----- Transcript of session follows -----
550 fjcnet.GOV!brinkema... Host unknown

Date: Fri, 22 Sep 89 09:59 EDT
From: reggie@pdn.paradyne.com (George Leach)
To: brinkema@fjcnet.GOV
Subject: Re: Convert between versions of UNIX
Newsgroups: comp.unix.wizards,comp.unix.xenix,comp.unix.ultrix
In-Reply-To: <201@fjcp60.GOV>
Organization: AT&T Suncoast Division, Largo FL
Cc: 

In article <201@fjcp60.GOV> you write:

>I am writing a paper about the problems of converting (porting) software
>between various versions of UNIX, in particular *standard UNIX* System V,
>BSD 4.x, and Xenix.  I have done many ports in many 'directions' but am
>very interested in others' experience.

    Mark Horton (mark@cbosgd.att.com) of AT&T Bell Laboratories, Columbus OH
has been working on a book on the topic of portable C programming, which is
related.  You may want to talk to him.

>In particular, do you have a standard procedure; a set of feature-areas that
>you always check; tricks that make the porting easier?  Also what are the
>hardest feature to port; what features are so subtle that bugs from them
>hide?

    Have you seen the book:

		J.E. Lapin,
		Portable C and UNIX System Programming,
		Prentice-Hall, 1987
		ISBN 0-13-686494-5

    Although I don't totally agree with their standards, they are an example
of one.

>I will sumarize.  tia.  jb.

George

George W. Leach					AT&T Paradyne 
(uunet|att)!pdn!reggie				Mail stop LG-133
Phone: 1-813-530-2376				P.O. Box 2826
FAX: 1-813-530-8224				Largo, FL  USA  34649-2826

klee@gilroy.pa.dec.com (Ken Lee) (09/23/89)

> I am writing a paper about the problems of converting (porting) software
> between various versions of UNIX, in particular *standard UNIX* System V,
> BSD 4.x, and Xenix.  I have done many ports in many 'directions' but am
> very interested in others' experience.

Rochkind's excellent book *Advanced UNIX Programming* (Prentice-Hall)
discusses porting between various breeds of UNIX.  I assume that other
good UNIX programming books do the same.  The biggest problems are
usually inter-process communication and device drivers, which are 90%
incompatible among most UNIXs.  Signals also bite many people.  Other
differences, like directory searching, file descriptor management, and
utility library differences (e.g., string library) are relatively easy 
to port.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@decwrl.dec.com
uucp: uunet!decwrl!klee

garyo@Think.COM (Gary Oberbrunner) (09/23/89)

> I am writing a paper about the problems of converting (porting) software
> between various versions of UNIX... what are the hardest feature to port;
> what features are so subtle that bugs from them hide?

Hard things to port:
select - Berkeley vs. ATT are completely different, but not so hard to
   convert.  Easier to go SysV->4.2 than the other way.
signals - sigset, sigvec, signal, etc. etc. etc.  I ported Berkeley tcsh to
   a SysV-derived system and I never quite got all the signal stuff right.
   It still does weird things every once in a while.  The feature sets just
   don't map onto one another.
tty drivers - a true nightmare.  TCSETA vs. TIOCSETA, etc.  Look at Gnu
   Emacs to see how hairy this gets.  The feature sets are too different.
32-bit ints->16 - malloc, read, etc. all fail for large arguments.
time stuff - all different.  Just have to keep beating on it 'til it works.

Subtle things:
printf return value (yes, some code actually depends on it.)
see above for more examples - signal hackery is always very subtle
   and context-dependent.
--
					As always,

					Gary O

-----------------------------------------------------------------------------
Remember,		      Truth is not beauty;	    Gary  Oberbrunner
Information is not knowledge; Beauty is not love;  {ames,harvard}!think!garyo
Knowledge is not wisdom;      Love is not music;	      garyo@think.com
Wisdom is not truth;	      Music is the best. - FZ	  (617) 876-1111 x265