Converting Linux source code to Windows containing signal()

R

responsible

Hi,
I am trying to convert a small piece of source code that was
initially written for Linux to build under Windows.
My main problem though is in two lines...

1. signal(SIGALRM, timeoutHandler); // set alarm signal handler
2. alarm (timeout);

I am not sure what the best method is to handle those? Are there any
constructs in Windows that will make the translation as painless as
possible?

Thanks a lot in advance
 
C

Clever Monkey

responsible said:
I am trying to convert a small piece of source code that was
initially written for Linux to build under Windows.
My main problem though is in two lines...

1. signal(SIGALRM, timeoutHandler); // set alarm signal handler
2. alarm (timeout);

I am not sure what the best method is to handle those? Are there any
constructs in Windows that will make the translation as painless as
possible?
This is pretty much off-topic for comp.lang.c, so I suggest you try
another more appropriate newsgroup.

<div class="offtopic>
You have (at least) two main choices:

1. Rewrite the code so it uses Win32 API equivalents to the Linux/POSIX
calls you are having trouble with.

2. Use a third-party bridge API that allows you to compile Unix/POSIX
code on Win32 with minimal changes.
</div>
 
L

llothar

1. signal(SIGALRM, timeoutHandler); // set alarm signal handler
2. alarm (timeout);

I am not sure what the best method is to handle those? Are there any
constructs in Windows that will make the translation as painless as
possible?

No. It is a huge rewrite unless you use an emulated unix environment
like Cygnus
(which has terrible run time performance overhead on some constructs
like signal handling).

If you are able to find a good newsgroup about win32 programming with
competent persons
on it please tell me the URL via PM. But it is offtopic here
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top