From owner-freebsd-hackers@freebsd.org Mon Jan 18 15:50:23 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5312BA87ED5 for ; Mon, 18 Jan 2016 15:50:23 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 40AF71E1D for ; Mon, 18 Jan 2016 15:50:22 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-50-184-63-128.hsd1.ca.comcast.net [50.184.63.128]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id u0IFoFoq044161 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 18 Jan 2016 07:50:16 -0800 (PST) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-50-184-63-128.hsd1.ca.comcast.net [50.184.63.128] claimed to be yuri.doctorlan.com Subject: Re: How to send EOF to the popen(3) pipe? To: Malcolm Matalka References: <5699BAC9.3060407@rawbw.com> <5699C8AB.7070006@missouri.edu> <569A8508.80908@rawbw.com> <86bn8jme18.fsf@gmail.com> Cc: "freebsd-hackers@freebsd.org" From: Yuri Message-ID: <569D09B8.6030307@rawbw.com> Date: Mon, 18 Jan 2016 07:50:16 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <86bn8jme18.fsf@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:50:23 -0000 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