Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55251 invoked by uid 1010); 27 Mar 2006 12:38:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55236 invoked from network); 27 Mar 2006 12:38:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2006 12:38:17 -0000 X-Host-Fingerprint: 64.233.166.180 pproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.166.180:59336] helo=pproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B8/B0-37235-8BCD7244 for ; Mon, 27 Mar 2006 07:38:16 -0500 Received: by pproxy.gmail.com with SMTP id b36so1337015pyb for ; Mon, 27 Mar 2006 04:38:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZxheSs8Q4RoPfKSUjzxG+eG8PI9+PvE7MEDkneQpp3IB8iofFf06JPc6w+3quN+df0qpIwS54rVjl9v6IV72x8e2oqxeqsFN2G8cTl7/Gqxc4fk7+kKICc7N1g+6cvAGHDcQYaX36SZVPkWLGg5zOETiTt/w/Alr4bv9be0g1ZU= Received: by 10.35.107.20 with SMTP id j20mr1847814pym; Mon, 27 Mar 2006 04:38:11 -0800 (PST) Received: by 10.35.41.17 with HTTP; Mon, 27 Mar 2006 04:38:11 -0800 (PST) Message-ID: <4e89b4260603270438j2d8474eaqe468891d7f08627c@mail.gmail.com> Date: Mon, 27 Mar 2006 07:38:11 -0500 To: "Hannes Magnusson" Cc: internals@lists.php.net In-Reply-To: <7f3ed2c30603270323v720385e9va5bb9e03102abbcb@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7f3ed2c30603270323v720385e9va5bb9e03102abbcb@mail.gmail.com> Subject: Re: [PHP-DEV] [PATCH] Make streams respect POSIX error retrieval functions (bug #36868) From: kingwez@gmail.com ("Wez Furlong") That patch won't work if you build the posix extension shared and don't loa= d it. In addition, it's most likely too late to capture the real errno value that you're looking for; PHP does a decent amount of stuff between the time that the low level syscall fails and the point that you sample it. On top of that, the failure code may not even be representable as an errno--for example, when getaddrinfo() fails the reason is returned in a different "number space" outside of the usual errno "protocol".=20 Webdav streams may fail to open due to 404 errors at a level that doesn't even cause errno to be set, similarly for user-space or other extension streams. --Wez. On 3/27/06, Hannes Magnusson wrote: > Hi all > > Attached is a patch (against HEAD) to allow codes like: > $fp =3D @fopen("/unwritabledirectory/filename", "w"); > if (!$fp) { > printf("The errornr was: %d", posix_get_last_error()); > } > > Fixes bug #36868 > > (If, for what ever reason, the patch doesn't come through: > http://php.is/bugs/36868/posix.patch.txt ) > - Hannes > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > >