Help: looking for equivalent syscall to shutdown() but for unix pipes

Alexandre Bique bique.alexandre@gmail.com
Thu Jan 17 08:20:00 GMT 2019


Hi,

I'm having an issue with pipes in a multi-threaded application.

I have one thread (T1) reading a pipe in a loop, and I'd like to close
that pipe from an other thread (T2) and join T1.

With sockets I'd use shutdown(fd, SHUT_RD).

As shutdown is not available for pipes, I tried opening /dev/null and
using dup2() to close my fd and replace with the one opened at
/dev/null but it did not interrupt the read() syscall.

What do you recommend?

Many thanks,
-- 
Alexandre Bique



More information about the Libc-help mailing list