Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99814 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9093 invoked from network); 7 Jul 2017 20:14:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jul 2017 20:14:11 -0000 Authentication-Results: pb1.pair.com header.from=php@list.imperialat.at; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@list.imperialat.at; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain list.imperialat.at designates 80.101.55.235 as permitted sender) X-PHP-List-Original-Sender: php@list.imperialat.at X-Host-Fingerprint: 80.101.55.235 mail.imperialat.at Received: from [80.101.55.235] ([80.101.55.235:61242] helo=mail.imperialat.at) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/04-47109-29BEF595 for ; Fri, 07 Jul 2017 16:14:11 -0400 Received: from mail.imperialat.at (localhost [127.0.0.1]) by mail.imperialat.at (OpenSMTPD) with ESMTP id 81918672; Fri, 7 Jul 2017 22:14:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= list.imperialat.at; h=subject:to:cc:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=deathstar; bh=VDWnfQjkmeB5k1SHBKFh F31tqyl4F5ccN7/y9hx3bOw=; b=2e87Aqp0+44yoo7rkWBL8srhCIBpHjfqaMed XwY/Rfmh+goGI+g8vj0GLCz04fZ1U8L53yRCGtW8rELEXSXuMpiRf62IISBVBS6w rbfPDcciKQUkMTwV0ybF8CmL9zzCDIbBeTJq75Sanz3HPwkQ07vvz7Fxqz/OCU65 4T1W/ro7lmqAOzeeWPl+UIvrWNzuJ2GMF3Jj6NRe5G3/fRCLqnSNwU1flcrJO3fL 8AwhqsvAolIu9smb+itnx2kmIUljlkd+jQunFT7V816Jn9P1uspWFUN0cUs1hJgU UvNoWYdjkJTzaERCFAx0rYUcdUyfFLLlO+9/SqK43CpWjHHAig== Received: from harrypotter.imperialat.at (192.168.153.157 [192.168.153.157]) by mail.imperialat.at (OpenSMTPD) with ESMTPSA id 80332c1f (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Fri, 7 Jul 2017 22:14:06 +0200 (CEST) To: Ferenc Kovacs Cc: PHP Internals References: Message-ID: <2eb9e379-ffcd-75d9-b0c6-8f0505164a85@list.imperialat.at> Date: Fri, 7 Jul 2017 22:14:05 +0200 User-Agent: Mozilla/5.0 (X11; OpenBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Getting fd from stream From: php@list.imperialat.at (Martijn van Duren) Hello Ferenc, On 07/07/17 19:49, Ferenc Kovacs wrote: > > > On Thu, Jul 6, 2017 at 11:12 AM, Martijn van Duren > wrote: > > Hello internals@, > > I have an (exotic) case where I need to be able to get the > filedescriptor from a previously opened stream (via stream_socket_pair) > to hand over to the child process, which needs to reexecute. > > I saw that the php:// wrapper supports php://fd/X syntax, so I reckon > there should be a way to extract the information as well from a stream > as well. Unfortunately I don't seem to be able to find it. > > Can someone point me in the right direction? > > Sincerely, > > Martijn van Duren > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > hi, > > would you need something like fildes_fileno() from https://github.com/Tyrael/php-fildes ? > I never managed to put that up for pecl, not sure if it even compiles anymore with recent php versions > Thanks for the hint, but I'd like to refrain from external libraries as much as I can, especially for something simple as a simple number inside a data structure. I might also achieve something like this by eio from pecl, through e.g. eio_dup2, but it's just unrealistic overkill to ask for a full extension installation for just 1 one trivial piece of functionality. > > -- > Ferenc Kovács > @Tyr43l - http://tyrael.hu