Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7861547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:46:41+00:00 2026-06-02T22:46:41+00:00

I a have third party function which I use in my program. I can’t

  • 0

I a have third party function which I use in my program. I can’t replace it; it’s in a dynamic library, so I also can’t edit it. The problem is that it sometimes runs for too long.

So, can I do anything to stop this function from running if it runs more than 10 seconds for example? (It’s OK to close program in this scenario.)

PS. I have Linux, and this program won’t have to be ported anywhere else.

What I want is something like this:

#include <stdio.h>
#include <stdlib.h>

void func1 (void) // I can not change contents of this.
{
  int i; // random
  while (i % 2 == 0);
}

int main ()
{
  setTryTime(10000);
  timeTry{
     func1();
  } catchTime {
     puts("function executed too long, aborting..");
  }

  return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:46:43+00:00Added an answer on June 2, 2026 at 10:46 pm

    Sure. And you’d do it just the way you suggested in your title: “signals”.

    Specifically, an “alarm” signal:

    • http://linux.die.net/man/2/alarm

    • http://beej.us/guide/bgipc/output/html/multipage/signals.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a third-party library (the interface to Xerox's Finite State tools) which come
I need to use a third party DLL which I don't have header ,
I have a third party java program called kgsgtp.jar which need to communicate with
I currently have implemented a third party library into my XCode project. The problem
I have some third-party Javascript that has statements like this: FOO = function() {
I have a third-party library that is sometimes throwing an exception. So I decided
I have a third party SDK in C# which has class names like this:
I have a load of XSLT from a third party which i need to
I have a C# windowed application that needs to make use of a third-party
I have third-party C code that writes data to a file. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.