Subject: Re: Porting to Solaris

From: [email-masked] (Richard Elling)
Date: Thu, 23 Sep 1993 15:08:49 GMT

In article [email-masked], [email-masked] (Gary Horton) writes:
>Firstly, I'm following instructions in the document titled "Transition Planning
>Guide for Application Developers". I'm building with SysV libraries and have
>performed the linting process as suggested (svidii lint library). Next, I
>started using the Pipeline tool to scan source code and flag problems, and 
>here is where I get bogged down. It seems in many cases the tool tells me
>a given interface is not supported in SunOS 5.0, but doesn't tell me what
>to do about it. Here is an example flag from Pipeline:

Please note that the pipeline tool, while very useful, is dated.  In 
particular, the UNIX OS API spec currently being drafted includes several
of the functions that Sun moved out of the way in order to be more SVID, XPG,
AS (Alphabet Soup :-) compliant.  So several of the routines that pipeline 1.0
will flag as removed or obsolete, will reappear when Solaris 2 becomes
UNIX OS API compliant.

>***********************************************************
>PROBLEM SYMBOL: gethostbyname(3N)
>
>MESSAGE:
>    In SunOS 4.x.y/sysV:
>        This interface is not available in SystemV Release 3/svidII,
>        however it may be functional under 4.x.y/sysV.
>
>    In SunOS 5.0:
>        This interface has same functionality under both SunOS 4.x.y
>        and SunOS 5.0.
>
>    In SPARC ABI:
>        This interface is not available in SPARC ABI.

Here is a prime example.  One of the efforts behind SVR4 development was
the concept of transport independent networking.  Back when OSI was 
"imminent" :-) it made more sense to work hard to support it transparently.
IMHO this is still a valid design goal even though OSI has faded: Novell
Netware or Appletalk support may be handy for many developers.  As a result,
the Solaris 2.2 man pages recommend using netdir_getbyname() which is part
of a generic transport name-to-address lookup.  However, from what I can
tell, netdir_getbyname() is not part of the UNIX OS API.  What to do?

>(2) Are the BSD socket calls (i.e., socket(), sendto(), bind(), etc.) still
>supported under Solaris 2.x? If not, what is the wisest replacement - RPC?
>TLI? something else?

BSD sockets will be supported forever.  The BSD-Reno versions appear in the
UNIX OS API.  With the growing popularity of Winsock, BSD socket style 
programming is cast in stone.

>(3) There are many pipeline message where something is listed as unsupported and no
>further guidance is given. For example (well, one possible example is the above
>output, but it seems ambiguous so I'm uncertain...), here's more output from Pipeline:
>***************************************************
>
>PROBLEM SYMBOL: SIGUSR1, SIGUSR2 (signal.h)
>
>MESSAGE:
>        This symbol is not defined in System V.3.
>
>***************************************************
>
>What is the replacement? Where do I look in general for ambiguities or deadends
>like this? Is there some document somewhere that lists all library calls and
>their Solaris counterparts? Would answerbook on Solaris be of some help here?

Check the man pages.  Also check the Solaris porting guides and FAQ.
Signal is effectively replaced by sigaction() somewhere in POSIX or another AS.

>(4) If I port an application directly to Solaris 2.x, i.e. compile on that
>OS using whatever is needed to complete the port, will my app still be source-code
>compatible with SunOS 4.1.x?

It depends on how you write it :-).

---
 Richard Elling, Manager of Network Support, Engineering Administration
 Auburn University     [email-masked]     kb4hb.ampr.org
 "The world is my lavatory." -- Albert Alligator