From owner-freebsd-hackers@freebsd.org Mon Jan 18 09:29:29 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 62376A87CAE for ; Mon, 18 Jan 2016 09:29:29 +0000 (UTC) (envelope-from mmatalka@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EED271C31 for ; Mon, 18 Jan 2016 09:29:28 +0000 (UTC) (envelope-from mmatalka@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id b14so112700066wmb.1 for ; Mon, 18 Jan 2016 01:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ep2P3l+GoiJKQXvHZwV1ynH+PFnKGWCyHk9VC6Eybpo=; b=F7GOj9eEJXCQs2hnSFxkKYOzyWYxC87YgkA68+gDeRflxOe9JR3bQefRN3GnKylzNu Y4IALFQ6jZ+/Xz1IPZSVfMW5e6cR6E2Vl3VR073fSvuH51/RbGR6D8DErOPmTYqX3/7q s3H4OFWeSrh+211IE7Aw/BARlsOW+zwjkcDNiE04/rnPHahhH+W4/n/y748QgOV5gx+l rrvJolLYK1MKMimCSjjdmd50Ub8PYMH0JxD8caSSX8gKwra8c7sEiKvX5LEYASnnKUl/ +QwI0FOf9dPjicaCWYaA8fDVrpMfMRa2Jwreqkx9li5rp5j9mqY5k4SCbrd8RkTK9baZ 1CjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=ep2P3l+GoiJKQXvHZwV1ynH+PFnKGWCyHk9VC6Eybpo=; b=UG5IDDUS46sYAiunV126GZj6WR4aflYUSsteAf8N+bNbOqL3A6fo7P+ajgtY7u98Fz XzVrBSqPyRlDOawQNPMO1dpX69QMvL2N42bZvbAjr96uspg9aWPyOH4SwHhNdzsInQUe cABotaTC8vJ6tREShC3qEmYQ4+nNm28o95aotvxy6g89/CXJxhYGS/f8pebYed0CUt5h rbtkAMEXCCcGEWmPGELSlH7dhIxNlghDWFBX99tcFsnnZmOMjVUmlPOSsIC+QjhV71qf s3utypSizFWzkV2ErHP79sYNQcyNhrdX+1KDLQ2kWNQRXRKaToowP3cMkOh/hNUUEpE9 sGfA== X-Gm-Message-State: AG10YORk1W88YO6XYaTMk/J2RAClbO2dN6OxJQCKWUV+gffzCLQWsgNG16X7ISyGhHNLWg== X-Received: by 10.28.3.134 with SMTP id 128mr11312346wmd.92.1453109367457; Mon, 18 Jan 2016 01:29:27 -0800 (PST) Received: from localhost (li195-236.members.linode.com. [178.79.139.236]) by smtp.gmail.com with ESMTPSA id gl10sm22916490wjb.30.2016.01.18.01.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jan 2016 01:29:26 -0800 (PST) From: Malcolm Matalka To: Yuri Cc: "Montgomery-Smith\, Stephen" , "freebsd-hackers\@freebsd.org" Subject: Re: How to send EOF to the popen(3) pipe? References: <5699BAC9.3060407@rawbw.com> <5699C8AB.7070006@missouri.edu> <569A8508.80908@rawbw.com> Date: Mon, 18 Jan 2016 09:29:23 +0000 In-Reply-To: <569A8508.80908@rawbw.com> (yuri@rawbw.com's message of "Sat, 16 Jan 2016 09:59:36 -0800") Message-ID: <86bn8jme18.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain 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 09:29:29 -0000 Yuri writes: > On 01/15/2016 20:35, Montgomery-Smith, Stephen wrote: >> Maybe I am displaying my ignorance. But wouldn't you do this by >> invoking the function pclose? > > No, pclose kills the process and returns the exit code. Half-closed connection though can be alive for a while, until the other side > finishes and closes the pipe. The manpage claims that pclose waits for the process to finish and returns its exit code, is this not true? """ The pclose() function waits for the associated process to terminate and returns the exit status of the command as returned by wait4(2). """ > >> My memory of using this was that this could gridlock because of >> buffering. Suppose process A popens a process B. A sends a message to > > Gridlocks are possible if reads/writes are performed in the wrong order. But this is besides the point of the original question. > > I think the answer to my question is "no". popen(3) can't send EOF. Protocol needs to support EOF signal on the application-level. > > Yuri > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"