This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change PerlIO_(get|set)pos to take SV *
[perl5.git] / README.os2
index a0b3d97..19af8c5 100644 (file)
@@ -112,9 +112,10 @@ Contents
          -  Threading 
          -  Calls to external programs 
          -  Memory allocation 
+         -  Threads
       AUTHOR 
       SEE ALSO 
-  
+
 =head1 DESCRIPTION
 
 =head2 Target
@@ -177,13 +178,14 @@ has much more functions working (like C<fork>, C<popen> and so on). In
 fact RSX is required if there is no VCPI present. Note the
 RSX requires DPMI.
 
-Only the latest runtime is supported, currently C<0.9c>. Perl may run
+Only the latest runtime is supported, currently C<0.9d fix 03>. Perl may run
 under earlier versions of EMX, but this is not tested.
 
 One can get different parts of EMX from, say
 
-  ftp://ftp.cdrom.com/pub/os2/emx09c/
-  ftp://hobbes.nmsu.edu/os2/unix/emx09c/
+  http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/
+  http://powerusersbbs.com/pub/os2/dev/   [EMX+GCC Development]
+  http://hobbes.nmsu.edu/pub/os2/dev/emx/v0.9d/
 
 The runtime component should have the name F<emxrt.zip>.
 
@@ -392,12 +394,12 @@ is considered a bug and should be fixed soon.
 
 =over 4
 
-=item
+=item *
 
 Did you run your programs with C<-w> switch? See 
 L<Starting OS/2 (and DOS) programs under Perl>.
 
-=item
+=item *
 
 Do you try to run I<internal> shell commands, like C<`copy a b`>
 (internal for F<cmd.exe>), or C<`glob a*b`> (internal for ksh)? You
@@ -722,7 +724,7 @@ can be constructed using C<pod2latex>.
 =head1 BUILD
 
 Here we discuss how to build Perl under OS/2. There is an alternative
-(but maybe older) view on L<http://www.shadow.net/~troc/os2perl.html>.
+(but maybe older) view on http://www.shadow.net/~troc/os2perl.html
 
 =head2 Prerequisites
 
@@ -808,10 +810,8 @@ Change to the directory of extraction.
 
 =head2 Application of the patches
 
-You need to apply the patches in F<./os2/diff.*> and
-F<./os2/POSIX.mkfifo> like this:
+You need to apply the patches in F<./os2/diff.*> like this:
 
-  gnupatch -p0 < os2\POSIX.mkfifo
   gnupatch -p0 < os2\diff.configure
 
 You may also need to apply the patches supplied with the binary
@@ -831,7 +831,7 @@ to EMX headers:
   +++ /emx/include/sys/stat.h  Sun Jul 12 14:11:32 1998
   @@ -53,7 +53,7 @@ struct stat
    #endif
+
    #if !defined (S_IFMT)
   -#define S_IFMT   0160000  /* Mask for file type */
   +#define S_IFMT   0170000  /* Mask for file type */
@@ -883,50 +883,67 @@ Now run
 
   make test
 
-Some tests (4..6) should fail. Some perl invocations should end in a
-segfault (system error C<SYS3175>). To get finer error reports, call
+All tests should succeed (with some of them skipped).  Note that on one
+of the systems I see intermittent failures of F<io/pipe.t> subtest 9.
+Any help to track what happens with this test is appreciated.
 
-  perl t/harness
+Some tests may generate extra messages similar to
 
-The report you get may look like
+=over 4
 
-  Failed Test  Status Wstat Total Fail  Failed  List of failed
-  ---------------------------------------------------------------
-  io/fs.t                      26   11  42.31%  2-5, 7-11, 18, 25
-  lib/io_pipe.t     3   768     6   ??       %  ??
-  lib/io_sock.t     3   768     5   ??       %  ??
-  op/stat.t                    56    5   8.93%  3-4, 20, 35, 39
-  Failed 4/140 test scripts, 97.14% okay. 27/2937 subtests failed, 99.08% okay.
+=item A lot of C<bad free>
+
+in database tests related to Berkeley DB. This is a confirmed bug of
+DB. You may disable this warnings, see L<"PERL_BADFREE">.
+
+There is not much we can do with it (but apparently it does not cause 
+any real error with data).
 
-Note that using C<make test> target two more tests may fail: C<op/exec:1>
-because of (mis)feature of pdksh, and C<lib/posix:15>, which checks
-that the buffers are not flushed on C<_exit> (this is a bug in the test
-which assumes that tty output is buffered).
+=item Process terminated by SIGTERM/SIGINT
+
+This is a standard message issued by OS/2 applications. *nix
+applications die in silence. It is considered a feature. One can
+easily disable this by appropriate sighandlers. 
+
+However the test engine bleeds these message to screen in unexpected
+moments. Two messages of this kind I<should> be present during
+testing.
+
+=back
+
+Two F<lib/io_*> tests may generate popups (system error C<SYS3175>), 
+but should succeed anyway.  This is due to a bug of EMX related to 
+fork()ing with dynamically loaded libraries.
 
 I submitted a patch to EMX which makes it possible to fork() with EMX 
-dynamic libraries loaded, which makes F<lib/io*> tests pass. This means
-that soon the number of failing tests may decrease yet more.
+dynamic libraries loaded, which makes F<lib/io*> tests pass without
+skipping offended tests. This means that soon the number of skipped tests
+may decrease yet more.
 
-However, the test F<lib/io_udp.t> is disabled, since it never terminates, I
-do not know why. Comments/fixes welcome.
+To get finer test reports, call
 
-The reasons for failed tests are:
+  perl t/harness
 
-=over 8
+The report with F<io/pipe.t> failing may look like this:
 
-=item F<io/fs.t>
+  Failed Test  Status Wstat Total Fail  Failed  List of failed
+  ------------------------------------------------------------
+  io/pipe.t                    12    1   8.33%  9
+  7 tests skipped, plus 56 subtests skipped.
+  Failed 1/195 test scripts, 99.49% okay. 1/6542 subtests failed, 99.98% okay.
 
-Checks I<file system> operations. Tests:
+The reasons for most important skipped tests are:
 
-=over 10
+=over 8
 
-=item 2-5, 7-11
+=item F<op/fs.t>
 
-Check C<link()> and C<inode count> - nonesuch under OS/2.
+=over 4
 
 =item 18
 
-Checks C<atime> and C<mtime> of C<stat()> - I could not understand this test.
+Checks C<atime> and C<mtime> of C<stat()> - unfortunately, HPFS
+provides only 2sec time granularity (for compatibility with FAT?).
 
 =item 25
 
@@ -951,62 +968,20 @@ Checks C<stat()>. Tests:
 
 =over 4
 
-=item 3
-
-Checks C<inode count> - nonesuch under OS/2.
-
 =item 4
 
-Checks C<mtime> and C<ctime> of C<stat()> - I could not understand this test.
-
-=item 20
-
-Checks C<-x> - determined by the file extension only under OS/2.
-
-=item 35
-
-Needs F</usr/bin>.
-
-=item 39
-
-Checks C<-t> of F</dev/null>. Should not fail!
-
-=back
+Checks C<atime> and C<mtime> of C<stat()> - unfortunately, HPFS
+provides only 2sec time granularity (for compatibility with FAT?).
 
 =back
 
-In addition to errors, you should get a lot of warnings. 
-
-=over 4
-
-=item A lot of C<bad free>
-
-in databases related to Berkeley DB. This is a confirmed bug of
-DB. You may disable this warnings, see L<"PERL_BADFREE">.
-
-=item Process terminated by SIGTERM/SIGINT
-
-This is a standard message issued by OS/2 applications. *nix
-applications die in silence. It is considered a feature. One can
-easily disable this by appropriate sighandlers. 
-
-However the test engine bleeds these message to screen in unexpected
-moments. Two messages of this kind I<should> be present during
-testing.
+=item F<lib/io_udp.t>
 
-=item F<*/sh.exe>: ln: not found
-
-=item C<ls>: /dev: No such file or directory
-
-The last two should be self-explanatory. The test suite discovers that
-the system it runs on is not I<that much> *nixish.
+It never terminates, apparently some bug in storing the last socket from
+which we obtained a message.
 
 =back
 
-A lot of C<bad free>... in databases, bug in DB confirmed on other
-platforms. You may disable it by setting PERL_BADFREE environment variable
-to 1.
-
 =head2 Installing the built perl
 
 If you haven't yet moved perl.dll onto LIBPATH, do it now.
@@ -1086,6 +1061,10 @@ You did not run C<omflibs>. See L<Prerequisites>.
 
 You use an old version of GNU make. See L<Prerequisites>.
 
+=head2 op/sprintf test failure
+
+This can result from a bug in emx sprintf which was fixed in 0.9d fix 03.
+
 =head1 Specific (mis)features of OS/2 port
 
 =head2 C<setpriority>, C<getpriority>
@@ -1162,7 +1141,7 @@ Really really odious function to implement. Returns absolute name of
 file which would have C<name> if CWD were C<dir>.  C<Dir> defaults to the
 current dir.
 
-=item  C<Cwd::extLibpath([type])
+=item  C<Cwd::extLibpath([type])>
 
 Get current value of extended library search path. If C<type> is
 present and I<true>, works with END_LIBPATH, otherwise with
@@ -1184,18 +1163,18 @@ eventually).
 
 =over 4
 
-=item
+=item *
 
 Since L<flock(3)> is present in EMX, but is not functional, it is 
 emulated by perl.  To disable the emulations, set environment variable
 C<USE_PERL_FLOCK=0>.
 
-=item
+=item *
 
 Here is the list of things which may be "broken" on
 EMX (from EMX docs):
 
-=over
+=over 4
 
 =item *
 
@@ -1226,7 +1205,7 @@ L<waitpid(3)>:
 
 Note that C<kill -9> does not work with the current version of EMX.
 
-=item
+=item *
 
 Since F<sh.exe> is used for globing (see L<perlfunc/glob>), the bugs
 of F<sh.exe> plague perl as well. 
@@ -1507,7 +1486,7 @@ this works as well under DOS if you use DOS-enabled port of pdksh
 
 B<Disadvantages:> currently F<sh.exe> of pdksh calls external programs
 via fork()/exec(), and there is I<no> functioning exec() on
-OS/2. exec() is emulated by EMX by asyncroneous call while the caller
+OS/2. exec() is emulated by EMX by asynchronous call while the caller
 waits for child completion (to pretend that the C<pid> did not change). This
 means that 1 I<extra> copy of F<sh.exe> is made active via fork()/exec(),
 which may lead to some resources taken from the system (even if we do
@@ -1538,9 +1517,9 @@ cannot test it.
 For the details of the current situation with calling external programs,
 see L<Starting OS/2 (and DOS) programs under Perl>.
 
-=over
+=over 4
 
-=item
+=item *
 
 External scripts may be called by name.  Perl will try the same extensions
 as when processing B<-S> command-line switch.
@@ -1550,14 +1529,10 @@ as when processing B<-S> command-line switch.
 =head2 Memory allocation
 
 Perl uses its own malloc() under OS/2 - interpreters are usually malloc-bound
-for speed, but perl is not, since its malloc is lightning-fast. 
-Unfortunately, it is also quite frivolous with memory usage as well.
-
-Since kitchen-top machines are usually low on memory, perl is compiled with
-all the possible memory-saving options. This probably makes perl's 
-malloc() as greedy with memory as the neighbor's malloc(), but still
-much quickier. Note that this is true only for a "typical" usage,
-it is possible that the perl malloc will be worse for some very special usage.
+for speed, but perl is not, since its malloc is lightning-fast.
+Perl-memory-usage-tuned benchmarks show that Perl's malloc is 5 times quicker
+than EMX one.  I do not have convincing data about memory footprint, but
+a (pretty random) benchmark showed that Perl one is 5% better.
 
 Combination of perl's malloc() and rigid DLL name resolution creates
 a special problem with library functions which expect their return value to
@@ -1566,6 +1541,31 @@ such functions, system memory-allocation functions are still available with
 the prefix C<emx_> added. (Currently only DLL perl has this, it should 
 propagate to F<perl_.exe> shortly.)
 
+=head2 Threads
+
+One can build perl with thread support enabled by providing C<-D usethreads>
+option to F<Configure>.  Currently OS/2 support of threads is very 
+preliminary.
+
+Most notable problems: 
+
+=over 4
+
+=item C<COND_WAIT> 
+
+may have a race condition.  Needs a reimplementation (in terms of chaining
+waiting threads, with linker list stored in per-thread structure?).
+
+=item F<os2.c>
+
+has a couple of static variables used in OS/2-specific functions.  (Need to be
+moved to per-thread structure, or serialized?)
+
+=back
+
+Note that these problems should not discourage experimenting, since they
+have a low probability of affecting small programs.
+
 =cut
 
 OS/2 extensions