This file contains remarks on porting NXLib to other Platforms.

If you are porting NXLib to a new platform, i.e. one that is not
officilly supported let us know (nxlib@informatik.tu-muenchen.de).
We will give you support and we will try to distribute your port with
the next official release. This way other NXLib users can benifit form
your work. 

I System and Library Calls

1.) Calls which are neither standard C nor Posix calls.


Theese calls might cause problems if you port NXLib to other
platforms.

The calls which caused problems during other ports are specially
marked with *.

a) Socket Related Calls and Macros
 
Calls which caused or may cause problems:

*	The calls which are used to configure the sockets are different on
*	different machines. Some operation systems use ioctl() other use
*	fnctl().
*
*	ioctl()		in file tcp/tcp_init.c
*	fcntl()		in file tcp/tcp_init.c


*	setsockopt() may cause problems. This call is not necessary but NXLib
*	shows better performanvce results if this call is done.
*
*	setsockopt()	in file tcp/tcp_init.c

The following socket related calls didn't cause any problems until
now.

accept()	in file tcp/tcp_init.c
bind() 		in file tcp/tcp_init.c
connect()	in file tcp/tcp_init.c
listen()	in file tcp/tcp_init.c
select()	in file remote/remote_signal.c
socket()	in file tcp/tcp_init.c

Macros.

FD_CLR()	in file addresses/addr_db.c
FD_SET()	in file addresses/addr_db.c
FD_ZERO()	in file addresses/addr_db.c


b) Call accessing the host database of the system

Theese calls are non-standard but they are available on most systems.


gethostbyname()	in file reliable/rel_a_setup.c
			reliable/rel_d_setup.c
			remote/remote_signal.c

gethostname()	in file reliable/rel_a_setup.c
			reliable/rel_c_setup.c
			reliable/rel_d_setup.c
			remote/remote_signal.c


c) Calls obtaining system limits

*	It might be neccessary to replace the getrlimit() call by
*	getdtablesize(), which does the same job.

getrlimit()	in file addresses/addr_db.c

d) Calls getting the system time.

This call should have at least a granularity of milliseconds.

gettimeofday()	in file nxcalls/dclock.c

c) Other calls

ltoa() is no standard call and is not supported on some systems. It
might lead to problems in linking an application. 

ltoa():		defined in file additions/ltoa.c



2.) Calls used by NXLib, which are either standard C or Posix.


a) Standard C and Posix Calls:
fclose()	fopen()		getenv()	perror()

b) Standard C Calls:
atoi()		atol()		exit()		fprintf()
free()		malloc()	memcpy()	memset()
realloc()	sprintf()	strcat()	strcmp()
strcpy()	strlen()	strncpy()	strrchr()
strtol()

c) Posix Calls:
chdir()		close()		execl()		execlp()
execvp()	fork()		getlogin()	getpid()
getppid()	kill()		read()		setpgid()
sigaction()	sigaddset()	sigemptyset()	sigfillset()
sigprocmask()	sigsuspend()	waitpid()	write()



II Other Problems

*
*	The path and/or name of the remote shell command is different
*	on different systems. Add a #define for the machine you are
*	porting NXLib to. Otherwise NXLib won't be able to start
*	daemons on remote machins.
*

*
*	Make sure the NXLib and Paragon error number are not in
*	conflict with error numbers on the system. This can be done by
*	setting the F_PNERR macro in include/sys/nxerrno.h to a value
*	which is higher than any error number in the system. Check
*	that in the standard errno.h file and all files which are
*	included by it on the system
*

*
*	Make sure the path of the standard errno.h file which is
*	included in include/errno.h is correct.
*

*	
*	The Posix signal handling calls didn't work under SunOs 4.1.x
*	and Alpha AXP OSF/1.
*	Some SIGIOs were lost so that messages were not received
*	sometimes. It was neccessary to use the BSD calls instead of
*	the Posix calls. This might happen on other platforms as well.
*	Compile with the -DBSD_SIG option to use BSD signal calls.
*


III Fortran

The Fortran compliler frontend uses sed to replace 
PROGRAM statements by SUBROUTIONE statements. The Fortran files will
be compiled using the Fortran compiler (what else :-). The program
will be linked with the C compiler. On all systems it was necessary to
add -l linker optinons in order to produce a running program. The
easiest way to determin theese options is to compile a simple Frotran
and a simple C program with the compiler's verbose option (usually -v).
Compare the command line of the linker (ld). This will show which
libraries are needed for Fortran.
Add theese options to the makefile macro NXFLDLIBS.

