Skip Menu |
Report information
Id: 126847
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: oshogbo [at] FreeBSD.org
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



To: perlbug [...] perl.org
From: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
Subject: fdclose(3) patch
Date: Tue, 8 Dec 2015 21:05:06 +0100
Download (untitled) / with headers
text/plain 770b
Hello, Some time ago we add to FreeBSD a function called fdclose(3). Idea of this function is to free FILE structure but leave/return underlining descriptor. This is *cleaner* way instead messing in FILE structure. fdclose(3) is available in FreeBSD 11 [2] and FreeBSD 10/stable [3]. Patch is available at [1]. [1] https://people.freebsd.org/~oshogbo/perl-fdclose.patch [2] https://svnweb.freebsd.org/base/head/lib/libc/stdio/fclose.c?revision=285140&view=markup [3] https://svnweb.freebsd.org/base/stable/10/lib/libc/stdio/fclose.c?revision=291602&view=markup Thanks, -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1
RT-Send-CC: perl5-porters [...] perl.org
On Tue Dec 08 12:05:27 2015, oshogbo@FreeBSD.org wrote: Show quoted text
> Hello, > > Some time ago we add to FreeBSD a function called fdclose(3). > Idea of this function is to free FILE structure but leave/return > underlining descriptor. This is *cleaner* way instead messing in FILE > structure. > > fdclose(3) is available in FreeBSD 11 [2] and FreeBSD 10/stable [3]. > Patch is available at [1]. > > [1] https://people.freebsd.org/~oshogbo/perl-fdclose.patch > [2] > https://svnweb.freebsd.org/base/head/lib/libc/stdio/fclose.c?revision=285140&view=markup > [3] > https://svnweb.freebsd.org/base/stable/10/lib/libc/stdio/fclose.c?revision=291602&view=markup > > Thanks,
I have forked a branch from blead and applied your patch to it. It is smoke-testing in branch smoke-me/jkeenan/126847-freebsd-fdclose. However, it occurs to me that Perl 5 probably has to prepare its source code to run on versions of FreeBSD older than 10/stable (even though FreeBSD itself does not). We'll need guidance from P5P about this. Thank you very much. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 646b
On Tue Dec 08 16:10:44 2015, jkeenan wrote: Show quoted text
> However, it occurs to me that Perl 5 probably has to prepare its > source code to run on versions of FreeBSD older than 10/stable (even > though FreeBSD itself does not). We'll need guidance from P5P about > this.
Yes, we support older revisions of FreeBSD, so the patch as it stands is unsuitable. If it's at all likely this will make it into other BSDs (or other unrelated libcs), we'd probably want to detect it in Configure, but I don't see any pertinent google matches for fdclose with the other BSDs. I think for now we'd need to detect it based on the OS release in hints/freebsd.sh. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 909b
On Tue Dec 08 16:40:29 2015, tonyc wrote: Show quoted text
> On Tue Dec 08 16:10:44 2015, jkeenan wrote:
> > However, it occurs to me that Perl 5 probably has to prepare its > > source code to run on versions of FreeBSD older than 10/stable (even > > though FreeBSD itself does not). We'll need guidance from P5P about > > this.
> > Yes, we support older revisions of FreeBSD, so the patch as it stands > is unsuitable. > > If it's at all likely this will make it into other BSDs (or other > unrelated libcs), we'd probably want to detect it in Configure, but I > don't see any pertinent google matches for fdclose with the other > BSDs. > > I think for now we'd need to detect it based on the OS release in > hints/freebsd.sh. > > Tony
One other concern: At the present time, we have no one filing smoke-test reports of Perl blead on FreeBSD. See: http://perl.develop-help.com/ -- James E Keenan (jkeenan@cpan.org)
To: Tony Cook via RT <perlbug-followup [...] perl.org>
From: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
Subject: Re: [perl #126847] fdclose(3) patch
Date: Wed, 9 Dec 2015 02:39:57 +0100
Download (untitled) / with headers
text/plain 1.2k
On Tue, Dec 08, 2015 at 04:40:30PM -0800, Tony Cook via RT wrote: Show quoted text
> On Tue Dec 08 16:10:44 2015, jkeenan wrote:
> > However, it occurs to me that Perl 5 probably has to prepare its > > source code to run on versions of FreeBSD older than 10/stable (even > > though FreeBSD itself does not). We'll need guidance from P5P about > > this.
> > Yes, we support older revisions of FreeBSD, so the patch as it stands is unsuitable. > > If it's at all likely this will make it into other BSDs (or other unrelated libcs), we'd probably want to detect it in Configure, but I don't see any pertinent google matches for fdclose with the other BSDs. > > I think for now we'd need to detect it based on the OS release in hints/freebsd.sh. > > Tony
Thanks for quick response and thank you for good points. I was thinking about bumping a FreeBSD_version in stable and we could detected it in code something like: #if (__FreeBSD_verion > 1002503) fdclose... #else ... #endif I'm not sure how other BSDs will or will not want to implement this function. If you prefer detecting it in the configure its sound good for me. -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1
Subject: [perl #126847] fdclose(3) patch
Date: Wed, 9 Dec 2015 08:40:38 +0100
From: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
To: James E Keenan via RT <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.5k
On Tue, Dec 08, 2015 at 05:34:49PM -0800, James E Keenan via RT wrote: Show quoted text
> On Tue Dec 08 16:40:29 2015, tonyc wrote:
> > On Tue Dec 08 16:10:44 2015, jkeenan wrote:
> > > However, it occurs to me that Perl 5 probably has to prepare its > > > source code to run on versions of FreeBSD older than 10/stable (even > > > though FreeBSD itself does not). We'll need guidance from P5P about > > > this.
> > > > Yes, we support older revisions of FreeBSD, so the patch as it stands > > is unsuitable. > > > > If it's at all likely this will make it into other BSDs (or other > > unrelated libcs), we'd probably want to detect it in Configure, but I > > don't see any pertinent google matches for fdclose with the other > > BSDs. > > > > I think for now we'd need to detect it based on the OS release in > > hints/freebsd.sh. > > > > Tony
> > One other concern: At the present time, we have no one filing smoke-test reports of Perl blead on FreeBSD. See: http://perl.develop-help.com/
Thanks for quick response and thank you for good points. I was thinking about bumping a FreeBSD_version in stable and we could detected it in code something like: #if (__FreeBSD_verion > 1002503) fdclose... #else ... #endif I'm not sure how other BSDs will or will not want to implement this function. If you prefer detecting it in the configure its sound good for me. -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1
To: perlbug-followup [...] perl.org
From: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
Subject: Re: [perl #126847] fdclose(3) patch
Date: Wed, 9 Dec 2015 02:08:46 +0100
Download (untitled) / with headers
text/plain 1.2k
Thanks for quick response and thank you for good points. On Tue, Dec 08, 2015 at 04:40:30PM -0800, Tony Cook via RT wrote: Show quoted text
> On Tue Dec 08 16:10:44 2015, jkeenan wrote:
> > However, it occurs to me that Perl 5 probably has to prepare its > > source code to run on versions of FreeBSD older than 10/stable (even > > though FreeBSD itself does not). We'll need guidance from P5P about > > this.
> > Yes, we support older revisions of FreeBSD, so the patch as it stands is unsuitable. > > If it's at all likely this will make it into other BSDs (or other unrelated libcs), we'd probably want to detect it in Configure, but I don't see any pertinent google matches for fdclose with the other BSDs. > > I think for now we'd need to detect it based on the OS release in hints/freebsd.sh.
I was thinking about bumping a FreeBSD_version in stable and we could detected it in code something like: #if (__FreeBSD_verion > 1002503) fdclose... #else ... #endif I'm not sure how other BSDs will or will not want to implement this function. If you prefer detecting it in the configure its sound good for me. Thanks, -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1
From: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
To: James E Keenan via RT <perlbug-followup [...] perl.org>
Date: Tue, 15 Dec 2015 18:01:15 +0100
Subject: Re: [perl #126847] fdclose(3) patch
Download (untitled) / with headers
text/plain 1.2k
Patch in attachment. What do you thinks? On Tue, Dec 08, 2015 at 05:34:49PM -0800, James E Keenan via RT wrote: Show quoted text
> On Tue Dec 08 16:40:29 2015, tonyc wrote:
> > On Tue Dec 08 16:10:44 2015, jkeenan wrote:
> > > However, it occurs to me that Perl 5 probably has to prepare its > > > source code to run on versions of FreeBSD older than 10/stable (even > > > though FreeBSD itself does not). We'll need guidance from P5P about > > > this.
> > > > Yes, we support older revisions of FreeBSD, so the patch as it stands > > is unsuitable. > > > > If it's at all likely this will make it into other BSDs (or other > > unrelated libcs), we'd probably want to detect it in Configure, but I > > don't see any pertinent google matches for fdclose with the other > > BSDs. > > > > I think for now we'd need to detect it based on the OS release in > > hints/freebsd.sh. > > > > Tony
> > One other concern: At the present time, we have no one filing smoke-test reports of Perl blead on FreeBSD. See: http://perl.develop-help.com/ > > > -- > James E Keenan (jkeenan@cpan.org)
-- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1
Download fdclose.patch
text/plain 984b

Message body is not shown because sender requested not to inline it.

To: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
CC: James E Keenan via RT <perlbug-followup [...] perl.org>
Subject: Re: [perl #126847] fdclose(3) patch
From: Andy Dougherty <doughera [...] lafayette.edu>
Date: Thu, 31 Dec 2015 11:44:10 -0500
Download (untitled) / with headers
text/plain 836b
On Tue, Dec 15, 2015 at 06:01:15PM +0100, Mariusz Zaborski wrote: Show quoted text
> Patch in attachment. > What do you thinks?
Thank you for the patch. I have attached two suggested patches which ought to have the equivalent functionality, but might be a bit more general. The first simply uses fdclose() if it's available as the first line of attack in PerlIOStdio_invalidate_fileno. I did not make it specific to FreeBSD in case other OSes also adopt this function. The second (much longer) adds Configure support for the HAS_FDCLOSE symbol. This is currently smoking in the smoke-me/andyd/fdclose branch. I did note that a standard run of 'make test' never seems to call this function, so I don't know how much it is actually used. -- Andy Dougherty doughera@lafayette.edu Dept. of Physics Lafayette College, Easton PA 18042

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Date: Sat, 2 Jan 2016 15:52:48 +0100
From: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
Subject: Re: [perl #126847] fdclose(3) patch
To: Andy Dougherty <doughera [...] lafayette.edu>
CC: James E Keenan via RT <perlbug-followup [...] perl.org>
On Thu, Dec 31, 2015 at 11:44:10AM -0500, Andy Dougherty wrote: Show quoted text
> On Tue, Dec 15, 2015 at 06:01:15PM +0100, Mariusz Zaborski wrote:
> > Patch in attachment. > > What do you thinks?
> > Thank you for the patch. I have attached two suggested patches which > ought to have the equivalent functionality, but might be a bit > more general. > > The first simply uses fdclose() if it's available as the first line of > attack in PerlIOStdio_invalidate_fileno. I did not make it specific to > FreeBSD in case other OSes also adopt this function. The second (much > longer) adds Configure support for the HAS_FDCLOSE symbol. This is > currently smoking in the smoke-me/andyd/fdclose branch. > > I did note that a standard run of 'make test' never seems to call this > function, so I don't know how much it is actually used.
It's looking great for me!!! Thanks! Cheers, -- Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1
From: Andy Dougherty <doughera [...] lafayette.edu>
Date: Mon, 4 Jan 2016 17:26:11 -0500
To: Mariusz Zaborski <oshogbo [...] FreeBSD.org>
CC: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>, James E Keenan via RT <perlbug-followup [...] perl.org>
Subject: Re: [perl #126847] fdclose(3) patch
Download (untitled) / with headers
text/plain 1.2k
On Sat, Jan 02, 2016 at 03:52:48PM +0100, Mariusz Zaborski wrote: Show quoted text
> On Thu, Dec 31, 2015 at 11:44:10AM -0500, Andy Dougherty wrote:
> > On Tue, Dec 15, 2015 at 06:01:15PM +0100, Mariusz Zaborski wrote:
> > > Patch in attachment. > > > What do you thinks?
> > > > Thank you for the patch. I have attached two suggested patches which > > ought to have the equivalent functionality, but might be a bit > > more general. > > > > The first simply uses fdclose() if it's available as the first line of > > attack in PerlIOStdio_invalidate_fileno. I did not make it specific to > > FreeBSD in case other OSes also adopt this function. The second (much > > longer) adds Configure support for the HAS_FDCLOSE symbol. This is > > currently smoking in the smoke-me/andyd/fdclose branch. > > > > I did note that a standard run of 'make test' never seems to call this > > function, so I don't know how much it is actually used.
> It's looking great for me!!!
Now pushed as 8b8c6ab7a0f348f87b1d3cb71ad386b19d348719 and 36b1c8929241ab83b3003de806e94e66990e4c6d I have separately pushed the d_fdclose.U metaconfig unit to perl's metaconfig repository. Let me know of any problems, -- Andy Dougherty doughera@lafayette.edu
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.3k
On Mon Jan 04 14:27:06 2016, doughera wrote: Show quoted text
> On Sat, Jan 02, 2016 at 03:52:48PM +0100, Mariusz Zaborski wrote:
> > On Thu, Dec 31, 2015 at 11:44:10AM -0500, Andy Dougherty wrote:
> > > On Tue, Dec 15, 2015 at 06:01:15PM +0100, Mariusz Zaborski wrote:
> > > > Patch in attachment. > > > > What do you thinks?
> > > > > > Thank you for the patch. I have attached two suggested patches which > > > ought to have the equivalent functionality, but might be a bit > > > more general. > > > > > > The first simply uses fdclose() if it's available as the first line of > > > attack in PerlIOStdio_invalidate_fileno. I did not make it specific to > > > FreeBSD in case other OSes also adopt this function. The second (much > > > longer) adds Configure support for the HAS_FDCLOSE symbol. This is > > > currently smoking in the smoke-me/andyd/fdclose branch. > > > > > > I did note that a standard run of 'make test' never seems to call this > > > function, so I don't know how much it is actually used.
> > It's looking great for me!!!
> > Now pushed as > 8b8c6ab7a0f348f87b1d3cb71ad386b19d348719 > and > 36b1c8929241ab83b3003de806e94e66990e4c6d > > I have separately pushed the d_fdclose.U metaconfig unit to perl's > metaconfig repository. > > Let me know of any problems, >
No complaints in 18 days since patches were applied; marking ticket Resolved. Thank you very much. -- James E Keenan (jkeenan@cpan.org)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org