473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Converting Linux source code to Windows containing signal()

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

Apr 16 '07 #1
2 5462
responsible wrote:
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>
Apr 16 '07 #2
On 16 Apr., 07:17, "responsible" <msd...@gmail.comwrote:
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

Apr 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alex Hunsley | last post by:
I'm running a monitoring script under linux written in python. It's nohup'ed so that I can log out and it will continue running happily and so on, but sometimes I need to kill the script before...
1
by: Josef Meile | last post by:
Hi, I'm trying to do a simple link checking for python 2.1.3 (compiled from source on linux), but it fails when I use an invalid ssl url. For example: I have zope without ssl running on port...
2
by: shyamal | last post by:
I want to display memory content using C++ on LINUX. For example, the user may ask to display 256 bytes from 0x1000ff00. The problem is , if any location is invalid, the program will coredump...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
2
by: Shantanu Bhattacharya | last post by:
Hi, I have a 2-tier application that allows the end user to create a form containing controls of the user's choice. The same user can then populate the database by entering data created using...
28
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of...
0
by: clinnebur | last post by:
We have an ASP.NET web application (C#) that copies videos from a CCTV truck to a Linux server. What I am trying to do is convert the .AVI videos(which is how they are created on the truck) to .WMV...
5
by: John Ladasky | last post by:
Hi folks, Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux 7.04 desktop. I've gotten tired of maintaining multiple copies of my personal modules that I use over and over. ...
11
by: Keith Hughitt | last post by:
Hi, I am having a little trouble figuring out how to convert a python datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a UTC date so that when I send it to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.