On Mon, 16 Mar 2015, Xiangrong Fang wrote:

Hi All,

I have some questions regarding event and signals:

1) RTLEventWaitFor

can a program waiting for an RTLEvent be notified by an RTLEventSet from 
ANOTHER process?

2) Unix Signals

I see HookSignal() in the sysutils documentation, but there is nothing said on 
how to use it. Is it used to write my own signal handler on Linux?  Could 
anyone give a sample
program? 

You should not use this in fact, it is meant for internal use.

To write a signal handler on unix, see

http://www.freepascal.org/docs-html/rtl/baseunix/fpsigaction.html

there is an example.


Also, is there a list of defined RtlSigNums?

No. The list of unix signals is well-known.


3) Unix-style Signals on Windows

If possible, I would like to have cross platform signal handling in my app. I 
found this: 

https://github.com/graemeg/freepascal/blob/master/rtl/win32/signals.pp

Does it mean that if I "uses signals", I will have same capability on both 
linux and windows?

No. Signals work very different on window and Linux. They are similar concepts, but the implementation differs wildly.

To my knowledge, there is no cross-platform implementation of signals in FPC.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to