Posix SDK

From STRIDE Wiki
Revision as of 23:58, 2 December 2008 by Mikee (talk | contribs)
Jump to navigation Jump to search

Host Utilities

TBD

Target Implementation

Makefile

stride.h (API)

srBOOL strideInit(const strideIO_t * io)

This function initializes the STRIDE subsystem. The IO configuration is passed in as an argument. If this argument is NULL, then the process will attempt to attach to an already running runtime application (daemon) using shared memory for IPC. THis function should only be called once per application.

srBOOL strideUninit(void)

Terminates any threads that have been started with this API and uninitializes the STRIDE subsystem.

srBOOL strideCreateThread(strideThreadFunc_t entry, const srCHAR * name)

Creates a thread to be managed by the STRIDE subsystem. Threads created using this routine will be sent a palSTOP_EVENT notification (available from palWait) and should respond promptly to this event. The name parameter is used primarily for logging purposes.

strideCreateIMThread(name)

This is a macro that wraps the invocation of strideCreateThread for intercept module entry point functions. Only the IM name must be provided.

void strideWaitForExit(void)

This function can be called by the main application thread to block until a termination signal is received. Internally it uses the pause function to wait for signals to be delivered and then checks if termination has occurred.

void strideExDaemonize(const srCHAR* lockFile, const srCHAR* runAs)

This function is called by applications to deamonize the process. Both arguments are optional. The first argument specifies a lockfile path/name to use to insure that only one instance of the process is running. The second argument specifies a username to run as (setuid)

This is functional is optional - if you prefer to run your application as an interactive console application, do not call this function. If you are running as a daemon, we strongly recommend that you have the PAL_LOG_TO_SYSLOG macro defined (in palcfg.h) so that PAL log messages will be sent to the syslog (this is default setting currently).