FAQ
VMS stat fixes:

1. Allow null thread context.

2. First use VMS syntax for files and directories then fall back to Unix
syntax with EFS enabled.

3. When Unix syntax with EFS is used, EFS must also be used to store the
resultant filename.

4. fid_to_name() needs to use the same algorithm as stat() for consistency.

5. fid_to_name() followed by a flex_stat/flex_lstat call to see if this
is a directory is a waste of cycles.

Still more to come.

-John
wb8tyw@gmail.com
Personal Opinion Only

Search Discussions

  • Craig A. Berry at Jan 29, 2009 at 4:11 am

    On Jan 27, 2009, at 8:43 AM, John Malmberg wrote:

    VMS stat fixes:

    1. Allow null thread context.

    2. First use VMS syntax for files and directories then fall back to
    Unix syntax with EFS enabled.

    3. When Unix syntax with EFS is used, EFS must also be used to store
    the resultant filename.

    4. fid_to_name() needs to use the same algorithm as stat() for
    consistency.

    5. fid_to_name() followed by a flex_stat/flex_lstat call to see if
    this is a directory is a waste of cycles.
    This applied with a number of offsets and produced the following
    compiler warnings. There must be something missing in the patch as
    submitted.


    ret_spec = int_tovmspath(fspec, temp_fspec, NULL);
    ...............^
    %CC-I-IMPLICITFUNC, In this statement, the identifier "int_tovmspath"
    is implicitly declared as a function.
    at line number 12751 in file D0:[craig.perl]vms.c;2

    ret_spec = int_tovmspath(fspec, temp_fspec, NULL);
    ....^
    %CC-W-CVTDIFTYPES, In this statement, "int_tovmspath(...)" of type
    "int", is being converted to "pointer to char".
    at line number 12751 in file D0:[craig.perl]vms.c;2

    ret_spec = int_tovmspath(name, temp_fspec, NULL);
    ....^
    %CC-W-CVTDIFTYPES, In this statement, "int_tovmspath(...)" of type
    "int", is being converted to "pointer to char".
    at line number 14120 in file D0:[craig.perl]vms.c;2

    ret_spec = int_tovmspath(name, temp_fspec, NULL);
    ........^
    %CC-W-CVTDIFTYPES, In this statement, "int_tovmspath(...)" of type
    "int", is being converted to "pointer to char".
    at line number 14158 in file D0:[craig.perl]vms.c;2


    I'm also concerned about the proliferation of similar but different
    function names. We already have a flex_stat_int, where presumably the
    "int" is short for "internal." So do we really want an int_flex_stat
    as well? Which one is more internal?

    +#if defined(PERL_IMPLICIT_CONTEXT)
    + /* If the context is null, this will access violate */
    + /* and stat() has so many issues we will may need to use
    this */
    + /* routine in places where we do not have a thread context */
    + /* In those cases we usually do not care about the time
    stamps */
    + if (aTHX != NULL) {
    +#endif
    + time((time_t *)&statbufp->st_mtime);
    +#if defined(PERL_IMPLICIT_CONTEXT)
    + } else {
    + statbufp->st_mtime = 0;
    + }
    +#endif
    A better way to fix this is in Perl_my_time with something like:

    --- vms/vms.c;-0 2009-01-28 18:32:55 -0600
    +++ vms/vms.c 2009-01-28 18:58:30 -0600
    @@ -11995,9 +11995,17 @@ time_t Perl_my_time(pTHX_ time_t *timep)
    when = time(NULL);
    # ifdef VMSISH_TIME
    # ifdef RTL_USES_UTC
    - if (VMSISH_TIME) when = _toloc(when);
    + if (
    +# if defined(PERL_IMPLICIT_CONTEXT)
    + my_perl &&
    +# endif
    + VMSISH_TIME) when = _toloc(when);
    # else
    - if (!VMSISH_TIME) when = _toutc(when);
    + if (
    +# if defined(PERL_IMPLICIT_CONTEXT)
    + my_perl &&
    +# endif
    + !VMSISH_TIME) when = _toutc(when);
    # endif
    # endif
    if (timep != NULL) *timep = when;

    The place where it's checking Perl context is when it's looking at the
    vmsish bits of $^H.

    ________________________________________
    Craig A. Berry
    mailto:craigberry@mac.com

    "... getting out of a sonnet is much more
    difficult than getting in."
    Brad Leithauser
  • John Malmberg at Jan 29, 2009 at 4:44 am

    Craig A. Berry wrote:
    On Jan 27, 2009, at 8:43 AM, John Malmberg wrote:

    VMS stat fixes:

    1. Allow null thread context.

    2. First use VMS syntax for files and directories then fall back to
    Unix syntax with EFS enabled.

    3. When Unix syntax with EFS is used, EFS must also be used to store
    the resultant filename.

    4. fid_to_name() needs to use the same algorithm as stat() for
    consistency.

    5. fid_to_name() followed by a flex_stat/flex_lstat call to see if
    this is a directory is a waste of cycles.
    This applied with a number of offsets and produced the following
    compiler warnings. There must be something missing in the patch as
    submitted.
    There was a previous patch sent out that covered the int_tovmspath()
    that this needed to follow. I had thought I had sent it out a day
    before this patch.

    It looks like I messed up the addresses on sending it, and the resource
    leak bug in Mozilla caused Mozilla on VMS to lock up sending the second
    patch instead of telling me that the first patch was not sent.

    I agree that the function naming is confusing, but I would like to get
    the rest of the fixes put in place before changing them. I have about a
    half dozen more fixes in the queue, and I will now need to merge your
    changes into what I have to prepare the next patch.

    It is not just these names that are confusing, we have
    xxx_my_function(), xxx_do_function(), and xxx_function() type names for
    the routines that wrap the CRTL functions of the same names.

    -John
    wb8tyw@gmai.com
    Personal Opinion Only
  • John Malmberg at Jan 29, 2009 at 5:08 am

    Craig A. Berry wrote:

    On Jan 27, 2009, at 8:43 AM, John Malmberg wrote:
    It turns out that with a simple optimization, the int_flex_stat() and
    int_flex_lstat() will not be used.

    This is also a side effect of dealing with that the CRTL sees "foo bar"
    and "foobar" as the same file in the default mode, and Perl sees them as
    different files.
    +#if defined(PERL_IMPLICIT_CONTEXT)
    + /* If the context is null, this will access violate */
    + /* and stat() has so many issues we will may need to use this */
    + /* routine in places where we do not have a thread context */
    + /* In those cases we usually do not care about the time
    stamps */
    + if (aTHX != NULL) {
    +#endif
    + time((time_t *)&statbufp->st_mtime);
    +#if defined(PERL_IMPLICIT_CONTEXT)
    + } else {
    + statbufp->st_mtime = 0;
    + }
    +#endif
    A better way to fix this is in Perl_my_time with something like:

    --- vms/vms.c;-0 2009-01-28 18:32:55 -0600
    +++ vms/vms.c 2009-01-28 18:58:30 -0600
    @@ -11995,9 +11995,17 @@ time_t Perl_my_time(pTHX_ time_t *timep)
    when = time(NULL);
    # ifdef VMSISH_TIME
    # ifdef RTL_USES_UTC
    - if (VMSISH_TIME) when = _toloc(when);
    + if (
    +# if defined(PERL_IMPLICIT_CONTEXT)
    + my_perl &&
    +# endif
    + VMSISH_TIME) when = _toloc(when);
    # else
    - if (!VMSISH_TIME) when = _toutc(when);
    + if (
    +# if defined(PERL_IMPLICIT_CONTEXT)
    + my_perl &&
    +# endif
    + !VMSISH_TIME) when = _toutc(when);
    # endif
    # endif
    if (timep != NULL) *timep = when;

    The place where it's checking Perl context is when it's looking at the
    vmsish bits of $^H.
    I can do that. I did not see any other places where the time wrapper is
    called with a null thread context, so it seems simpler to just avoid
    calling it when simulating stat() for NLAO:

    -John
    wb8tyw@gmail.com
    Personal Opinion Only

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedJan 27, '09 at 2:44p
activeJan 29, '09 at 5:08a
posts4
users2
websiteperl.org

2 users in discussion

John Malmberg: 3 posts Craig A. Berry: 1 post

People

Translate

site design / logo © 2022 Grokbase