Received: from PACIFIC-CARRIER-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA19828; Wed, 13 Dec 95 17:04:20 EST
Received: from halloran-eldar.lcs.mit.edu by MIT.EDU with SMTP
	id AA10349; Wed, 13 Dec 95 17:04:19 EST
Received: from freefall.FreeBSD.ORG by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM)
	id AA10713; Wed, 13 Dec 1995 17:03:04 -0500
Received: from localhost (daemon@localhost)
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA23404
          Wed, 13 Dec 1995 12:44:07 -0800 (PST)
Received: (from root@localhost)
          by freefall.freebsd.org (8.7.3/8.7.3) id MAA23248
          for questions-outgoing; Wed, 13 Dec 1995 12:43:17 -0800 (PST)
Received: from rocky.sri.MT.net (rocky.sri.MT.net [204.182.243.10])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA23237
          for <questions@freebsd.org>; Wed, 13 Dec 1995 12:43:12 -0800 (PST)
Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id NAA11774; Wed, 13 Dec 1995 13:45:43 -0700
Date: Wed, 13 Dec 1995 13:45:43 -0700
From: Nate Williams <nate@rocky.sri.MT.net>
Message-Id: <199512132045.NAA11774@rocky.sri.MT.net>
To: Nate Williams <nate@rocky.sri.MT.net>
Cc: Wolfram Schneider <wosch@cs.tu-berlin.de>, questions@freebsd.org
Subject: Re: sup/ctm with Solaris 2.4? 
In-Reply-To: <199512131935.MAA11626@rocky.sri.MT.net>
References: <199512131540.QAA09159@caramba.cs.tu-berlin.de>
	<199512131627.IAA28759@freefall.freebsd.org>
	<199512131709.SAA14468@caramba.cs.tu-berlin.de>
	<199512131935.MAA11626@rocky.sri.MT.net>
Sender: owner-questions@freebsd.org
Precedence: bulk

>Does sup or ctm work with Solaris 2.4?

Yep, I can say that based on my (fairly minimal) testing it seems to
work.  I just downloaded some stuff from sup2.FreeBSD.org from a Solaris
2.4 box.

The main problems were:

1) Lack of vsnprintf().

Quick and dirty fix was to add these lines to any files which contained
calls to vsnprintf.  It's not a very good solution, but it works. :)

#ifdef SOLARIS
#define vsnprintf(a, b, c, d) \
        vsprintf(a, c, d)
#endif

2) Differentions in what the different wait macros expected.  The older
code expects a union wait structure, while the Solaris stuff wants an
int.  I defined the macro below (stolen from FreeBSD's <sys/wait.h>),
and then bracked all calls to the wait macros with this code.

#ifdef SOLARIS
#define UNION_2_INT(w)  (*(int *)&(w))  /* convert union wait to int */
#else
#define UNION_2_INT(w)  (w)
#endif

was:
    if (WIFEXITED(w) && w.w_retcode != 0) {
        notify ("SUP: Execute command returned failure status %#o\n",
                 w.w_retcode);
now:
    if (WIFEXITED(UNION_2_INT(w)) && w.w_retcode != 0) {
        notify ("SUP: Execute command returned failure status %#o\n",
                 w.w_retcode);

3) Getting a usable makefile.

Here is the resulting compile line spit out after munging the Makefile.

/usr/ucb/cc -UCMUCS -UCMU  -UMACH -DSOLARIS \
        -DRENAMELOG=\"/usr/local/etc/sup.moved\" -O -I.  -c  supcmeat.c

If you have any questions, let me know.  I'm not sure how demand there
is for a Solaris port of sup, but you should be able to build one after
this.

All of the above patches should be done *after* all of the FreeBSD
patches have been applied in the port.


Nate
