[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
I have just started to learn network programming.
I tried to run a c program from Stevens book on network
The program is
int pipefd, n ;
char buff ;
if( pipe(pipefd) < 0)
printf("read fd = %d, write fd = %d\n", pipefd, pipefd);
if(write(pipefd, "hello world",12) != 12)
if( (n = read(pipefd, buff ,sizeof(buff))) <= 0 )
write(1, buff, n);
Its giving error as follows:
/tmp/cc6q5fia.o: In function `main':
/tmp/cc6q5fia.o(.text+0x1e): undefined reference to `err_sys'
/tmp/cc6q5fia.o(.text+0x5a): undefined reference to `err_sys'
/tmp/cc6q5fia.o(.text+0x84): undefined reference to `err_sys'
collect2: ld returned 1 exit status
I am compiling on linux. Is there any header file I am not including?
Please let me know what's the problem
- Next by Subject:
- Next by thread: