Re: LARGEFILE configure issue

2005-02-02 Thread John E. Malmberg
Craig A. Berry wrote:
At 12:36 PM -0600 2/1/05, John E. Malmberg wrote:
On Mon, 31 Jan 2005, Craig Berry wrote:
I believe 64-bit integers and large file support now work correctly
(and independently) in bleadperl and those changes should make it
into 5.8.7.
I do not have bleadperl, but they are not in a snapshot of 5.9.1 I 
downloaded a few days ago.  I just put them in my local copy of 5.8.6, 
but have not had time to test them.

Unfortunately you did not implement the not very well documented but
present lstat() routine which is about to start returning something
different than stat().
It looks like I need to copy how stat() was done for lstat().
 
I'm quite sure that we don't check for all routines that are now
supported and documented in the CRTL, so it doesn't surprise me that
something unknown outside of OVMS Engineering would not be tested for
in configure.com.  It should be a simple addition, though, to test
for lstat() in configure.com.  Is it available on all 8.2 systems, or
will it only appear later?  It is not in the version dependency
tables or anywhere else in the brand new CRTL manual dated January
2005.
I will have to check to find out why lstat() is missing from the 
documentation where it should be.  It is referenced in the documentation 
 as a cross reference to a related feature.

I am not sure how long lstat() has been present in the CRTL, until 
symbolic links start working, it should return the same as stat().

Also affecting this is now with 64 bit OpenVMS 8.2, there is a new
struct stat that is incompatible with either struct mystat flavor in perl.
It also removes most of the hacks that perl was doing to fill out the
mystat structure.
 
I believe the original hack was because existing code would compare
st_ino members of the stat structure to see if two files are the
same.  Since the old VMS stat structure made st_ino an array of
words, only the first word would be compared, which was insufficient
for determining equality.  So if we can do away with that in 8.2 and
later and simply make mystat an alias for stat, I'm all for it.
As it is unlikely that this will be backported, the old method will need 
to be conditionally compiled.

A number of code porting projects suffered from the problems that you 
described.  I have a TPU macro that does a search and replace on the 
inode assigns and compares, which changes them to memcpy and memcmp.

With 8.2, the ino_t is a 64 bit integral value, so number assigns and 
compares will work.

With 8.2, the dev_t value will also be valid when you use the standard 
stat variant, so that hack disappears.

But I notice that perl allows the script to choose local time or UTC for 
what stat() outputs, so some of the wrapper will still be needed.

If largefile support is to be present, then the resulting config.h needs
to have a #define _LARGEFILE 1 in it.
I think I tried that, but that's too late.  The CRTL headers that need to
see _LARGEFILE get included before config.h, so it had to be added on the
command line via /DEFINE=_LARGEFILE.
Why not just #include config.h before including the other headers?
It does not appear to do any harm to including it twice at a quick glance.
Because config.h is included from perl.h, and perl.h must be included
after either EXTERN.h for modules that reference globals, or
INTERN.h, for modules that define globals.  Even if changing the
order appears to work now, there is no telling what dependencies
might show up based on current documented order of inclusion.
I noticed that this seems to be done on other platform variants.
-John
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Personal Opinion Only


stat() and the NLA0: device.

2005-02-02 Thread John E. Malmberg
I notice that Perl is checking if the stat is being done on the NULL
device, and generating a fake stat structure.

Is there a specific version of stat() on OpenVMS that does not return
the correct data for stat?

stat() should return the correct information from either a filespec of
NLA0: or NL: or even /dev/null

-John
[EMAIL PROTECTED]
Personal Opinion Only




How do I emulate unix exit status from Perl on VMS

2005-02-02 Thread Sampath Ravindhran
I have a Java application that uses the Runtime.exec() method to run a 
bunch of Perl scripts. When the perl program exits, the java application 
retrieves the exit status of the perl process, and expects it to be 0. 
Anything other than  0 is treated as an error and the application does 
not proceed further.

On VMS, I observe that no matter what I do, I am never able to get it to 
return a value of 0. I tried the use of  'vmsish 'exit', but to no 
avail. If I create a simple script with just exit 0; in it, the value 
of $status on exit from the Perl program is always 1.

How do I get it to return a value of '0'. I am loathe to change the java 
code just for this.

Here's what I found searching through the VMS Perl archives:
-
-=item Cvmsish exit
-
-This makes Cexit 1 produce a successful exit (with status SS$_NORMAL),
-instead of emulating UNIX exit(), which considers Cexit 1 to indicate
-an error.  As with the CRTL's exit() function, Cexit 0 is also mapped
-to an exit status of SS$_NORMAL, and any other argument to exit() is
-used directly as Perl's exit status.

Note above it says the value '0' is always mapped to '1' !  I am hoping this 
can be bypassed somehow.
I am on Alpha OpenVMS Version 7.3-2, Perl version is 5.6.1.
Appreciate your inputs.
Thanks,
Sam


Re: stat() and the NLA0: device.

2005-02-02 Thread Craig A. Berry
At 2:41 PM -0600 2/2/05, John E. Malmberg wrote:
I notice that Perl is checking if the stat is being done on the NULL
device, and generating a fake stat structure.

Is there a specific version of stat() on OpenVMS that does not return
the correct data for stat?

Almost certainly yes, though I don't know what version. 

stat() should return the correct information from either a filespec of
NLA0: or NL: or even /dev/null

Sure, on recent versions of VMS.  I'd be reluctant to break older
versions, at least without knowing exactly which ones I was breaking
so I could document it.

If you go to the Perl repository browser here:

http://public.activestate.com/cgi-bin/perlbrowse

and enter vms/vms.c in the box next to Display blamelog for a
file and then click the Submit button, you'll see a listing of the
code with links to the patches that introduced each line.  The lines
containing the code in question have a 1 next to them, indicating
they were already there when the repository was created in 1997.
-- 

Craig A. Berry
mailto:[EMAIL PROTECTED]

... getting out of a sonnet is much more
 difficult than getting in.
 Brad Leithauser