• Antelope Release 5.9 Mac OS X 10.13.2 2019-05-01

 

NAME

pidrtsys - Find real-time systems running on the current machine

SYNOPSIS

#include "sysdata.h"

typedef struct Rtsys {
        char    host[MAXHOSTNAMELEN];
        char    username[STRSZ];
        char    rtpath[FILENAME_MAX];
        char    version[STRSZ];
        int     running;
        int     pid;
};

int pidrtsys( Rtsys** systems );

DESCRIPTION

The pidrtsys function detects real-time systems deployed on the local machine, returning details about the systems and whether or not they are running.

RETURN VALUES

pidrtsys returns an integer with the number of detected real-time systems. The systems array is freshly allocated upon each call and must be freed by the calling routine if non-null.

EXAMPLE


#include "stock.h"
#include "sysdata.h"

int
main( int argc, char** argv )
{
        Pidrtsys*         systems = NULL;
        int               nsystems = 0;
        int               isystem;

        nsystems = pidrtsys( &systems );

        fprintf( stderr, "\nnsystems is %d\n\n", nsystems );

        fprintf( stderr, "Systems:\n\n" );

        for( isystem = 0; isystem < nsystems; isystem++ ) {

                fprintf( stderr, "host\t\t%s\n", systems[isystem].host );
                fprintf( stderr, "username\t%s\n", systems[isystem].username );
                fprintf( stderr, "rtpath\t\t%s\n", systems[isystem].rtpath );
                fprintf( stderr, "version\t\t%s\n", systems[isystem].antelope_version );
                fprintf( stderr, "running\t\t%s\n", systems[isystem].running ? "yes" : "no" );
                fprintf( stderr, "pid\t\t%d\n", systems[isystem].pid );
                fprintf( stderr, "\n" );
        }

        fprintf( stderr, "\n" );

        return( 0 );
}


[nyas:active/tests/find_rtsystems][dev] kent% ./find_rtsystems

nsystems is 1

Systems:

host            localhost
username        kent
rtpath          /Users/rt/rtsystems/rtdemo_gsn
version         5.9
running         yes
pid             39233

SEE ALSO

rtexec(1)

BUGS AND CAVEATS

pidrtsys assumes that Antelope is installed in standard location under /opt/antelope.

AUTHOR

Kent Lindquist
Printer icon