473,320 Members | 2,180 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,320 software developers and data experts.

searching for method signatures

I'm working on some legacy code, and I ran across this function that
is giving the compiler issues:

void socket_skip(int i,int code,struct sigcontext * scp) {
fprintf(stderr,"User requested an interupt\n");
signal(SIGINT,exit);
sleep(1);
signal(SIGINT,socket_skip);
return;
}

Not surprisingly, signal doesn't like socket_skip.

I have searched for any sort of #define that could have specified a
unique signal, I have read through most of the possibly relevant lines
(by running 'grep sig `locate signal.h` | less').

Does anyone know of a good way to search for (possibly obfuscated)
method signatures?

How about any other way of finding what I'm looking for?

Short of that, does anyone know what library might have a signal that
accepts that signature?

Thanks,
David
Sep 2 '08 #1
1 1195
David Hilton <qu**************@gmail.comwrites:
I'm working on some legacy code, and I ran across this function that
is giving the compiler issues:

void socket_skip(int i,int code,struct sigcontext * scp) {
fprintf(stderr,"User requested an interupt\n");
signal(SIGINT,exit);
sleep(1);
signal(SIGINT,socket_skip);
return;
}

Not surprisingly, signal doesn't like socket_skip.

I have searched for any sort of #define that could have specified a
unique signal, I have read through most of the possibly relevant lines
(by running 'grep sig `locate signal.h` | less').

Does anyone know of a good way to search for (possibly obfuscated)
method signatures?

How about any other way of finding what I'm looking for?

Short of that, does anyone know what library might have a signal that
accepts that signature?
signal is standard C. I suspect your code simply dates from a time
when it was common for signal to vary quite a lot between systems. I
don't think you will gain anything from trying to find something
similar -- it is likely that is nothing you have available is an exact
match.

If this the only use of signal? If so, I think your simplest solution
is just to change the definition of socket_skip to match the type expected
by the standard signal function (void (*)(int)). The extra parameters
are not used but either handler (exit and socket_skip).

If there are other uses -- in particular some that set the handler to
a function that does use the other parameters then you will have to
find out what these parameters do/did. That may require digging
through the documentation for the "other" system.

--
Ben.
Sep 2 '08 #2

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

Similar topics

0
by: David S. | last post by:
Is there a generally accepted way to denote method signatures---that is, expected type or required interface for each argument.
6
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
10
by: Rico Rivera | last post by:
I want to call a method dynamically based on a string For example When s = "A" Then method A would get called. I don't wan't to use a bunch of "If" statements. Something like: ...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
1
by: karflips33 | last post by:
Is it possible to automate the signing of Word 2003 docs with Digital Signatures? My problem with the code approach using ActiveDocument.Signatures.Add
4
by: jianyi | last post by:
Hi, I am working on an xml project, and I am trying to understand something. if the author needs to sign one xml file, then his manager will counter-sign, and a third witness will sign, can...
10
by: Mihai Osian | last post by:
Hi everyone, Given the code below, can anyone tell me: a) Is this normal behaviour ? b) If it is, what is the reason behind it ? I would expect the A::method(int) to be inherited by B. ...
8
by: David Veeneman | last post by:
Should a member variable be passed to a private method in the same class as a method argument, or should the method simply call the member variable? For years, I have passed member variables to...
8
by: zfareed | last post by:
I have this function that searches a link list before main performs the insert function to insert an item. My problem is the pointer stuff and the program keeps crashing. <code> List::List() {...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.