The dpinit man page







NAME
     dpinit - make DP initializations

SYNOPSIS
     #include 

     int dpinit(prog, semantic, semsize, hostid)
     char *prog, *semantic;
     int  *semsize, *hostid;

DESCRIPTION
     When a process is ready to enroll as a DP process, it  calls
     dpinit()  to  set  up  the  appropriate DP environment.  The
     parameter is the name (absolute or relative  path  name)  of
     the  program (usually called with av[0]).  The other parame-
     ters are explained below.

     The kind of preparation carried out by dpinit()  depends  on
     the status of the current process in the DP hierarchy.

     If the current process is the starting process  (called  the
     primary  process,  or  primary for short), dpinit() arranges
     for the process to run in the background (and niced) and, if
     a  file  named  "hosts" exists in the current working direc-
     tory, it is read and a host table  is  built  (more  on  the
     hosts file below).  Upon returning, semantic is set to (char
     *) NULL and semsize to -1; by checking  these  two  returned
     values a process can tell whether it is the primary.

     If the current process has been spawned  by  some  other  DP
     process  (and  is thus termed a secondary process, or secon-
     dary for short), dpinit() receives a  semantic  packet  from
     the  parent (this semantic packet is sent over by the parent
     via the dpspawn() call) and  sets *semantic to point  to the
     the  packet  and sets *semsize to its size.  Note:  semantic
     must be initialized by its caller to point to a  pointer and
     semsize must be initialized to point to an int variable.

     Regardless of the status of the DP process, a log file named
     "log.."  is created.  It is used by DP to
     record valuable information that may aid  in  tracking  down
     any  potential bugs in the implementation; it's of only mar-
     ginal use to the DP application (e.g., since it has all  the
     output  messages  from the DP internals, it could be used to
     "trace" the execution of a DP application).

     dpinit() also stores in  hostid  the  entry  number  of  the
     current host in the host table.

     The "hosts" file mentioned above contains a number of lines,
     each  of which provides information about a host machine.  A
     line can be commented out by placing a sharp sign  ("#")  in
     the  front.   Each  line  has  the  following  five  fields,






     separated by white space:

          hostname: name of the host

          domain name: name of the host's Internet domain

          account group: a positive integer that groups  together
          accounts that share the same password

          working path: full path name  of  the  default  working
          directory on the host

          username: name of the user account on the host

     The primary process's host must be  included  in  the  hosts
     file, or DP will not abort and return to system.

RETURN VALUES
     Upon success, dpinit() returns the number of  hosts  in  the
     host  table.   If  any error occurs, the process will simply
     exit.

REMARK
     This is a DP function call.

AUTHOR
     David Arnow

FILES
     /usr/include/dp/dp.h - DP header file
     /usr/lib/libdp.a     - DP library file

SEE ALSO
     dpspawn(3DP), dpaddhost(3DP), dpgetpid(3DP)





Essential DP MAN Pages:

General/Essential:


Non-Interrupting Messages:


Interrupting Messages:
  • dpblock
  • dpcatchmsg
  • dpgetmsg
  • dppause
  • dpunblock

    Other:
    Return to DP For Students Return to The DP Project Return to David Arnow's Home Page