1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Thanks to Nicolas Simonds (nic@bridge.com) for this information.
Solaris:
* First, you'll need to include the TTY defs for Solaris in
powstatd.c:
#ifdef SPARC
#include <sys/termios.h> /* TTY defs for Solaris */
#endif
# Second, you'll need to define the type for the length arguments in
socket calls (also in powstatd.c):
#ifdef SPARC
typdef int socklen_t;
#endif
* Finally, you'll need to add -lxnet to the compile in the Makefile
along with the -DSPARC flag; assuming you are adding a new target
"sparc" it would look something like this:
sparc: $(SRC) $(INC) $(CRYPT) Makefile
$(CC) $(CFLGS) -DSPARC -DSTATFILE=$(STATUS) -DCONFIG="\"$(CFGDIR)/$(CFG)\"" $(SRC) $(ACRYPT) -lxnet -o $(BIN) $(LIB)
* Both Sun make and GNU make work fine.
* SunWPro CC and GCC both issue warnings, but the code builds/runs
fine.
* Sun init issues only powerfail or powerwait on receipt of
SIGPWR. Since you can only associate a single script to this signal,
you'll need a "smarter" script that blends elements of powstatd.fail,
powstatd.ok and powstatd.low into a single script. Check powstatd.dumb
(its the init process that's dumb, not the script) for an example.
|