Programming an alarm in RPG with AS/400

54,755 pts.
Tags:
Alarm Settings
AS/400
RPG
I need a little help building an alarm for unlocking blocked cells when a particular action takes place.  Here is the code I've written, but it doesn't work right.  I'm using RPG with AS/400.
volatile bool interrupted;
main() {
  sigaction(SIG_ALARM, myhandler) // register handler
  alarm(3) // set the alarm
  sleep(5) // blocking call, sleep just as an example.
  alarm(0) // disable the alarm
}
myHandler() {
  interrupted=true
}
ASKED: January 2, 2014  2:40 PM
UPDATED: January 3, 2014  1:06 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    When you say it is not working right, exactly what is happening?
    39,790 pointsBadges:
    report
  • TomLiotta
    It's not quite clear what you're asking. You say you're "using RPG with AS/400" but then you show code in C. (That could definitely explain why it's not working correctly!) What actual RPG code do you have and what about it isn't working? -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following