language: C (gcc-4.7.2)
date: 639 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <unistd.h>
#include <stdio.h>
int main()
{
  char buff[100];
  int pfd[2];
  buff[0] = '\0';
  pipe(pfd);
  if (fork())
    write(pfd[1],"hello world", 12);
  fork();
  read(pfd[0], buff, 100);
  printf("%s\n", buff);
  printf("goodbye\n");
}
prog.c: In function ‘main’:
prog.c:8: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result
prog.c:10: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
prog.c:12: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result
prog.c:15: warning: control reaches end of non-void function