From greg Thu May 23 09:41:51 1985 remote from osiris
To: piers!basser
Subject: ACSnet for GENIX


Here is the information on what had to be done to set up ACSnet for our GENIX
system.  This isn't really complete as I'm still fiddling trying to find the
right BSD version for the system.  If I anything changes from this item I'll
mail you what I've done.


+-----------------+
Makefile
+-----------------+

	If you're interested I'll mail you our Makefile, however the only major
	things were

	1.	set UNREASONABLE and turn off the optimiser.  The GENIX
		C-compiler is incredibly dumb and prone to failure.

	2.	Set the BSD version to 4.1a.  Still not exactly sure what
		version comes closest but this seems to be the closer without
		over-shooting.  Initially we ran it as BSD4.0 because the O_XXXX
		flags weren't defined, this has been fixed using the GENIX
		Make variable (see below).

	3.	Add a new Make variable - GENIX.  There are a number of
		differences between GENIX and any known version of BSD.
		All the places where this flag was used are documented below.

	4.	Does provide the System III setpgrp(2) system call.

	5.	Have add specific references to the job control and
		directory libraries.  Placed into SYSLIBS

+-----------------+
Dirlib/closedir.c Dirlib/opendir.c
Dirlib/readdir.c Dirlib/seekdir.c
Dirlib/telldir.c
+-----------------+

	GENIX has the dirlib routines so test for them when excluding the
	local versions.  See Include/ndir.h for more info.

  #include	"global.h"
! #if	BSD4 < 2 && ( BSD4 != 1 || BSD4V != 'c' ) && !GENIX
  #include "ndir.h"

+-----------------+
Include/global.h
+-----------------+

	GENIX doesn't define the O_XXXX flags so test for it.

  #else	FCNTL == 1
! #if	BSD4 > 0 && !GENIX
  #ifndef	O_RDWR
  #ifndef	major
  #include	<sys/types.h>

.
.
.

! #else	BSD4 <= 0 || GENIX
  #define	O_READ		0
  #define	O_WRITE		1
  #define	O_RDWR		2
  #define	O_APPEND	0
  #endif	BSD4 > 0
  
+-----------------+
Include/ndir.h
+-----------------+

	GENIX has the dirlib stuff but it keeps the #define in <dir.h>
	rather than <ndir>.h or <sys/dir.h>

- #if	GENIX
- #include	<dir.h>
- #else	!GENIX
  #if	BSD4 == 1 && BSD4V == 'a'
  #include	"/usr/include/ndir.h"
  #else	BSD4 == 1
  #if	BSD4 >= 2 || (BSD4 == 1 && BSD4V > 'a')
  #include	<sys/dir.h>
  #else	BSD4 >= 2 || ...

.
.
.

  #endif	BSD4 == 2 || ...
  #endif	BSD4 == 1
- #endif	GENIX

+-----------------+
Lib/SetRaw.c
+-----------------+

	This routine sets the stty flags to RAW without checking for
	any other bits.  This showed up a bug in our tty driver which
	caused it to go into odd parity mode if the parity bits were both
	cleared.  Quick and dirty fix masked in ANYP.

- #	ifdef	GENIX
- 		/* Quick and dirty fix for bug in driver */
- 
- 		params.sg_flags = RAW | ANYP;
- #	else	!GENIX
  		params.sg_flags = RAW;
  #	endif	GENIX
  
  	(void)stty(fd, &params);
  
+-----------------+
Lib/NodeName.c
+-----------------+

	The GENIX gethostname call expects to be passed a pointer to the
	size of the node name receiver.

  char *
  NodeName()
  {
- #if	GENIX
- 	int	n;
- #else	!GENIX
  	register int	n;
- #endif	GENIX
  	static char	nodename[NODE_NAME_SIZE+2];

  	strclr(nodename, sizeof nodename);
- #if	GENIX
- 	n = sizeof(nodename);
- 	if ( gethostname(nodename, &n) == SYSERROR )
- 		Syserror("gethostname");
- 	if ( n > NODE_NAME_SIZE || n == 0 )
- 		Fatal2("nodename too %s", n?"long":"short");
- #else	!GENIX
  	if ( gethostname(nodename, sizeof(nodename)) == SYSERROR )
  		Syserror("gethostname");
	if ( (n = strlen(nodename)) > NODE_NAME_SIZE || n == 0 )
		Fatal2("nodename too %s", n?"long":"short");
- #endif	GENIX
	return nodename;
}

+-----------------+
Makefiles/Install
+-----------------+

	Install failed on $(CP)'s after ACSnet had been used.  This was due
	to various files having text pages locked in memory.  Added

		-$(RM) $@ \

	to all targets which did not remove the target file before attempting
	to copy or move to it.

+-----------------+
Makefiles/Site
+-----------------+

	Add the new GENIX flag to the site.h file.

  cat >>${INC}/site.h.new <<EOF
- #define	GENIX		${GENIX}
  #define	GETHOST		${GETHOST}
  #define	IGNMAILERSTATUS	${IGNMAILERSTATUS}
  #define	INSBIN		"${INSBIN}"
