Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddsignalproc.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddsignalproc.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddsignalproc.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddsignalproc.html on line 8

PtAppAddSignalProc()

Add Photon signalling to a context

Synopsis:

int PtAppAddSignalProc( PtAppContext_t app, 
                        sigset_t const *set,
                        PtSignalProc_t func, 
                        void *data);

Library:

ph

Description:

This function adds Photon signal handling to the context app.

The app argument is the address of the application context, a structure that manages all the data associated with this application. This must be specified as NULL, so that the default context is used.

All signals in the set set are trapped and directed to a function that synchronizes with the Photon widget library and, at the next safe point, invokes the user-supplied function func().

The user callback function is declared as follows:

int func(int signal, void *data)

You can declare the function to be of type PtSignalProcF_t to take advantage of the compiler's type-checking.

It's invoked with the signal number and user data as parameters. It should return Pt_CONTINUE to remain installed, or Pt_END to have the callback removed for this signal.

You can add more than one function for a set of signals or set of intersecting signals. All handlers for a signal are called, but the order they're called in is unspecified.

The Photon widget library isn't signal-safe—normal signal handling functions must not call Photon library functions or alter Photon globals. Because this mechanism synchronizes with the widget library before calling the user function, no such limitations are placed on processing within handler functions installed via this routine.

Returns:

0
Success.
-1
An error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtAppRemoveSignal()

Interprocess Communication in the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddsignalproc.html on line 147

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddsignalproc.html on line 147