Next: , Previous: Partition Attribute Host, Up: The Configuration Language


8.5.4.17 Pragma Import

Two kinds of subprograms are allowed in the configuration language. A main procedure is used as a partition Main attribute and a function is used as a partition Host attribute.

     
     SUBPROGRAM_DECLARATION ::=
          procedure MAIN_PROCEDURE_IDENTIFIER is in PARTITION_NAME;
        | procedure PROCEDURE_IDENTIFIER;
        | function FUNCTION_IDENTIFIER
             (PARAMETER_IDENTIFIER : [in] String)
              return String;
     

The function can be an Ada function (default) or a shell script. To import a shell script, the pragma Import must be used:

     
     PRAGMA ::=
        pragma Import
           ([Entity        =>] FUNCTION_IDENTIFIER,
            [Convention    =>] CONVENTION_LITERAL,
            [External_Name =>] STRING_LITERAL);
     
     pragma Import (Best_Node, Shell, "best-node");

In this case, the PCS invokes the shell script with the partition name as a command line argument. The shell script is supposed to return the partition host-name (see Partition Attribute Host).