SURVIVOR Technical Document: Porting
About This Document

This document contains details of the SURVIVOR implementation. It contains no information necessary for the operation of the systems monitor that is not available in the general sections of this manual.

Porting

Only the scheduler and related core portions of the package should need to be ported, as most of the check modules that can run remotely are written in perl or another scripting language, and so should run without modification on the desired target platforms.

In order to port the scheduler, the target platform must support POSIX threading. The following steps should be followed:

  1. Modify the top level Configure script to recognize the new platform and generate the appropriate top level defines.
  2. Add a stanza to include/os.H.in for the new platform.
  3. If the platform does not define time_t as a long, redefine it, fix the code, or switch platforms.
  4. Try building the package. Any changes that need to be made should be tagged with descriptive labels, eg
         #if defined(_HAVE_GETHOST_WITH_POINTER)
         
    and not
         #if defined(LINUX)
         
    Add the appropriate defines to include/os.H.in and then rerun Configure to generate a new os.H.

MT-Level

(The following note on MT-Level would be more appropriate in a general "developer's notes" sort of page, if one existed.)

Regardless of an object's MT-Level, Constructors are always Safe (although it may not make sense to call them more than once) and Destructors are always Unsafe.

  • Safe indicates that all other methods in an object are Safe.
  • Unsafe indicates that the object must be protected in a multithreaded environment.
  • Exceptions within an object are noted.

gethostbyname_r

gethostbyname_r is not implemented in a standard fashion. It should be replaced with getaddrinfo(). Until then, note the following for AIX:
 According to an IBM engineer in the Usenet posting below,
 gethostbyname_r() is a wrapper around gethostbyname().

 http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3B7BCE0B.DF8D5E4E%40us.noibm.com

 It seems that gethostbyname() writes results to a per-thread
 allocated area which makes it thread safe. The gethostbyname_r()
 wrapper is supposed to copy this data into the malloc'ed buffer
 provided by curl. It seems that it performs a shallow copy, rather
 than the deep copy performed by curl's own pack_hostent() function.

 This means that pointers in the returned hostent structure point to
 the shared gethostbyname() buffer, and is therefore overwritten by
 calls to this function.

 http://curl.haxx.se/mail/archive-2003-03/0002.html
 

$Date: 2006/11/20 02:52:15 $
$Revision: 0.7 $
keywords