From owner-freebsd-questions Wed Dec 13 12:43:17 1995 Return-Path: owner-questions 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 ; 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 Message-Id: <199512132045.NAA11774@rocky.sri.MT.net> To: Nate Williams Cc: Wolfram Schneider , 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 ), 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