Hi,

Am 25.09.2011 um 01:37 schrieb Michael Pyne:

 [...]
With that said I don't think the code uses as many POSIX options as the rest of KSharedDataCache (e.g. process-shared mutexes as unimplemented on Mac OS X)
but I wanted to give a chance for you guys to test the prototype code
beforehand and let me know if there's problems.

You'll want to compile with something like this:
$CXX -O2 -o sigcatcher -lrt -pthread sigcatcher.cpp

Here is the first issue: librt doesn't exist here (Mac OS X 10.5 "Leopard").
However, the code compiles without the "-lrt".
$ g++ -O2 -o sigcatcher -pthread sigcatcher.cpp
$ g++ --version
i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)

Make sure optimization is enabled to ensure volatile is used where it's
needed. Assuming everything works right you should get output like:

$ ./sigcatcher
Hello, World!
Got a result of 1
Exited thread
$

The next problem is, that sem_init(..) isn't implemented here.
$ ./sigcatcher
Error: sem_init: Function not implemented
$

It seems that only named semaphores are implemented.
I've changed this part of your code to use sem_open(..) instead [see attachment] and then I get the expected result:

Attachment: sigcatcher-sem_open.cpp
Description: Binary data




$ g++ -O2 -o sigcatcher-sem_open -pthread sigcatcher-sem_open.cpp
$ ./sigcatcher-sem_open
Hello, World!
Got a result of 1
Exited thread
$

bye,
Jonas


If you want to see the signal handler in action there's a couple of lines you
can uncomment (just grep for uncomment to find where).

Obviously any other feedback on possible issues is appreciated as well, but basically I'd like to catch any portability issues early this time instead of
after-the-fact.

Please CC me on any replies as I'm not subscribed.

Regards,
- Michael Pyne<sigcatcher.cpp>_______________________________________________
[email protected]
List Information: https://mail.kde.org/mailman/listinfo/kde-mac
KDE/Mac Information: 
http://techbase.kde.org/index.php?title=Projects/KDE_on_Mac_OS_X

_______________________________________________
kde-freebsd mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-freebsd
See also http://freebsd.kde.org/ for latest information

Reply via email to