Re: How to let the process exit if the signal its waiting for doesn't arrive



In article <1159459691.860092.237710@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
norm4h8@xxxxxxxxx <norm4h8@xxxxxxxxx> wrote:

I have a question about how to create a process in such a way that it
would terminate itself if its wated for input for too long.

You can't do that using only standard C. Standard C has no library
calls with timeouts, and no library calls that implement alarms.
(Standard C doesn't even require that there be a useful clock
on the system!)

You will need to use an implementation-dependant extension.

Here is the story. I have 2 different files, say R.c and S.c, which
have a named pipe between them and send each other signals.

"named pipes" are beyond the knowledge of C; they are implementation
extensions. The fact that your system has named pipes suggests
strongly that you are using a Unix-like system; in that case,
comp.unix.programmer can probably lead you to an appropriate solution,
if you tell them which platform + OS version you are using.

[off topic]
Many systems implement an OS extension named alarm() .
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
.



Relevant Pages

  • RfD - Object Extensions
    ... While there is general agreement that Object-Oriented Programming (OOP) ... Forth currently has no standard extension for this. ...
    (comp.lang.forth)
  • Re: RfD - Object Extensions
    ... While there is general agreement that Object-Oriented Programming (OOP) ... Forth currently has no standard extension for this. ...
    (comp.lang.forth)
  • Re: Multi precision floating point
    ... language extension. ... the offsetof() macro was provided by the quote that I have included ... The standard library macro defined in, ... compiler accepts a program with a syntax error or a constraint violation, ...
    (comp.lang.c)
  • Re: scanf doubt
    ... for input is a Windows extension which doesn't work on ... But when the C standard says that something ... It's not an extension, it's undefined behavior. ...
    (comp.lang.c)
  • Re: RfD - Object Extensions
    ... Forth currently has no standard extension for this. ... xcounter heap-new constant x1 ... Performance test of OBJECTS.FS ...
    (comp.lang.forth)