Unix Programming - Program to generate SIGPIPE signal in FIFO

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > April 2007 > Program to generate SIGPIPE signal in FIFO





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Program to generate SIGPIPE signal in FIFO
David

2007-04-25, 1:24 pm

Hi,

How to write a program in C that generates a SIGPIPE signal in FIFO.
Can someone please provide the solution.

David

Jens Thoms Toerring

2007-04-25, 7:23 pm

David <Vishal.Patil29@gmail.com> wrote:
> How to write a program in C that generates a SIGPIPE signal in FIFO.
> Can someone please provide the solution.


Not the program generates the signal, a process may receive one.
And one why to get one is to create a FIFO in write mode and
then to try to write to it while no other process has it open
for reading.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Rainer Weikusat

2007-04-26, 7:18 am

David <Vishal.Patil29@gmail.com> writes:
> How to write a program in C that generates a SIGPIPE signal in FIFO.
> Can someone please provide the solution.


#include <unistd.h>

int main(void)
{
int fds[2];

pipe(fds);
close(fds[0]);
write(fds[1], fds, sizeof(*fds));
return 0;
}
David

2007-04-27, 7:17 am

Hi Rainer,

You made my day!!! I had one more query. i wanted a small c program
that gives application of FIFOs.

David







On Apr 26, 12:25 pm, Rainer Weikusat <rweiku...@mssgmbh.com> wrote:
> David <Vishal.Pati...@gmail.com> writes:
>
> #include <unistd.h>
>
> int main(void)
> {
> int fds[2];
>
> pipe(fds);
> close(fds[0]);
> write(fds[1], fds, sizeof(*fds));
> return 0;
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com