ulf> >-rw-r--r-- levitte/usr  116191 1999-05-07 14:48 OpenSSL.diffs_to_orig
ulf> 
ulf> In s_time.c and a number of other files, you add
ulf> 
ulf> > #    include <io.h>
ulf> >      extern void exit();
ulf> 
ulf> for the ifdef MSDOS case. What good is that? exit() is declared in
ulf> stdlib.h (according to the standard, which Microsoft happens to
ulf> follow in this case), and io.h is already included indirectly via
ulf> e_os.h.

Honestly, those are part of patches that I foudn long ago, applied to
SSLeay 0.6.6 and SSLeay 0.8.1a.  I didn't want to disturb those,
trusting the people who'd made them in the first place.  I should
clean that whole section up, but felt that getting the VMS-specific
parts into OpenSSL had higher importance, and the freeze date was
approaching at a fast rate.

ulf> For the VMS case, you first define TIMES, then include a header
ulf> file if TIMES is defined and undefine TIMES again if on VMS.

Not quite.  Under VMS, the header files are coupled with the compiler,
and there's a choice between 3 of them: VAX C (I actually just dropped
support for it, since it's non-ANSI), DEC C and GNU C.  GNU C uses
some of the header files that came with VAX C, and with DEC C, some
things (like support for the tms structure) varies between VMS
versions.  This leaves a slightly peculiar state tree to keep track
of.

So, basically, sys/times.h only seems to exist with DEC C, and the tms
structure seems to be only well defined with more recent VMS versions,
as indicated by the presence of the __TMS macro.

ulf> untangle that thing, I get

Not quite right, sorry.  __TMS gets defined by sys/times.h, not
unistd.h, and TIMES still needs to be defined if __TMS wasn't
(i.e. the tms structure doesn't exist).

ulf> #ifdef VMS
ulf> #  ifdef __DECC
ulf> #    include <unistd.h>
ulf> #    ifndef __TMS
ulf> #      include <sys/times.h>
ulf> #    endif
ulf> #  endif
ulf> #else
ulf> #  ifndef MSDOS
ulf> #    define TIMES
ulf> #  endif
ulf> #endif
ulf> [...]
ulf> #ifdef TIMES
ulf> #include <sys/times.h>
ulf> #else
ulf> #include <sys/timeb.h>
ulf> #endif
ulf> 
ulf> Is that what you mean? (You left rc4speed.c unchanged, btw.)

Ah, OK, I'll hack it.

ulf> > #if !(defined(VMS) || defined(__VMS))
ulf> > #define HZ      100.0
ulf> > #else /* VMS */
ulf> > #define HZ      100.0
ulf> > #endif
ulf> 
ulf> Huh?

Hey, don't look at me, that's how it was written.  I didn't dare do
too many changes, in case there would be a reason for that kind of
coding (like someday, the HZ may need to be changed for others but not
for VMS).

ulf> You frequently have constructs like
ulf> 
ulf> > #if (defined(VMS) || defined(__VMS)) && !defined(__DECC)
ulf> 
ulf> Instead, e_os.h should contain
ulf> 
ulf> #if defined(__VMS) && !defined(VMS)
ulf> #define VMS
ulf> #endif

That's easily done.

ulf> Is "globalref" VMSspeak for "extern"? Then that should also be
ulf> defined in e_os.h, and not in the files where it is used.

globalref and globaldef is a technicality that will decide if the
corresponding global symbol is visible when the module is part of a
routine library (this is putting it simply).  It's actually something
that *to my knowledge* only applies to VAX C, but I actually do not
know how GNU C works if those are not present, or I would have dropped
that entirely.

The problem with just defining "extern" to "globalref" is that it
doesn't have any meaning for some other things, like function
declarations.  One way would be to define the macro "globalref" for
all but VMS, and have them use it.  Or a macro "EXTERN", but in that
case, I'd say that we need smoe kind of similarly visible macro for
globaldef, say "GLOBAL" (which in the non-VMS case would always be
defined to nothing).

ulf> Why did you change the fopen mode in RAND_write_file?

Because it is a binary file.  Contrary to Unix, all files aren't
streams of bytes under VMS.  By default, fopen(foo,"w") will create a
file in stream format (Unix-compatible) under VMS, while
fopen(foo,"wb") will create a file in what is called 512 Byet Block
Format.  The difference, when you have binary data in files, is the
reading.  You see, VMS is record oriented, and most often reads files
a record at the time.  In a stream file that is written from a C
program, the records are assumed to be anything until the next \n.
Now, what do you think will happen if the random number that was
written to the file contains a byte with the value 10?  Right, so
therefore, it is better to make a binary file.

If it's the '+' that you're thinking of, consider that VMS creates a
new version of the file for each fopen(foo,"w"), while with "r+", a
currently existing file is updated instead.  Keeps the amount of
random files to a minimum, which is well seen in the VMS community :-).

ulf> What does DRM stand for?

Dick R. Munroe, IIRC...

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-161 43  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis             -- [EMAIL PROTECTED]

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to