Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jan 2016 07:50:16 -0800
From:      Yuri <yuri@rawbw.com>
To:        Malcolm Matalka <mmatalka@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: How to send EOF to the popen(3) pipe?
Message-ID:  <569D09B8.6030307@rawbw.com>
In-Reply-To: <86bn8jme18.fsf@gmail.com>
References:  <5699BAC9.3060407@rawbw.com> <5699C8AB.7070006@missouri.edu> <569A8508.80908@rawbw.com> <86bn8jme18.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/18/2016 01:29, Malcolm Matalka wrote:
> The manpage claims that pclose waits for the process to finish and
> returns its exit code, is this not true?

This is true, but EOF is different. In the case of the network 
connection, one can send EOF (call shutdown(2)), and then keep reading 
from the socket. With popen(3) this isn't possible. pclose(3) just 
closes and finishes the pipe.

Yuri



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?569D09B8.6030307>