Commit 56221a7c authored by Fred Drake's avatar Fred Drake

Chris Herborth <chrish@pobox.com>:

Minor updates for BeOS R5.

Use of OSError in test.test_fork1 changed to TestSkipped, with corresponding
change in BeOS/README (by Fred).

This closes SourceForge patch #100978.
parent d3415791
Python 1.5.x (x > 1) for BeOS Python for BeOS R5
This directory contains several useful things to help you build your own This directory contains several useful things to help you build your own
version of Python for BeOS. version of Python for BeOS.
...@@ -45,23 +45,25 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this: ...@@ -45,23 +45,25 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
4) Edit Modules/Setup to turn on all the modules you want built. 4) Edit Modules/Setup to turn on all the modules you want built.
Make sure you use _socket instead of socket for the name of the Make sure you use _socket instead of socket for the name of the
socketmodule on BeOS. socketmodule on BeOS (at least, until we get the new BONE networking).
If you want the modules to be built as shared libraries, instead of as If you want the modules to be built as shared libraries, instead of as
part of the Python shared library, be sure to uncomment the #*shared* part of the Python shared library, be sure to uncomment the #*shared*
line. line. I haven't done much testing with static linking, it's not as
interesting.
I've tried the following modules: I've tried the following modules:
regex pcre posix signal readline array cmath math strop struct time array audioop binascii cmath _codecs cPickle crypt cStringIO _curses
operator _locale fcntl pwd grp select _socket errno crypt termios errno fcntl gdbm grp imageop _locale math md5 new operator parser
audioop imageop rgbimg md5 timing rotor syslog curses new gdbm soundex pcre posix pwd pyexpat readline regex rgbimg rotor select sha signal
binascii parser cStringIO cPickle zlib _socket soundex _sre strop struct syslog termios time timing ucnhash
unicodedata zlib
Note that some of these (readline, curses, gdbm, and zlib) require extra Note that some of these require extra libraries that aren't supplied
libraries that aren't supplied with Python. If you don't have the extra with Python. If you don't have the extra libs (you can probably get
libs (you can probably get them from GeekGadgets), don't try to use them from GeekGadgets), don't try to use these modules; they won't
these modules; they won't compile. compile.
5) Make: 5) Make:
...@@ -71,17 +73,45 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this: ...@@ -71,17 +73,45 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
make test make test
test_popen2 will probably hang; it's deadlocked on a semaphore. I should
probably disable popen2 support... it uses fork(), and fork() doesn't mix
with threads on BeOS. In *THEORY* you could use it in a single-threaded
program, but I haven't tried.
If test_popen2 does hang, you can find the semaphore it's hung on via the
"ps" command. Look for python and you'll find something like this:
./python -tt ../src/Lib/test/regrtest.py (team 26922) (uid 0) (gid 0)
39472 python sem 10 3785 1500 piperd(360526)
./python -tt ../src/Lib/test/regrtest.py (team 26923) (uid 0) (gid 0)
39477 python sem 10 25 4 python lock (1)(360022)
^^^^^^
That last number is the semaphore the fork()'d python is stuck on
(see how it's helpfully called "python lock (1)"? :-). You can unblock
that semaphore to let the tests continue using the "release" command
with that semaphore number. Be _very_ careful with "release" though,
releasing the wrong semaphore can be hazardous.
Expect the following errors: Expect the following errors:
test_grp crashed -- exceptions.KeyError : getgrnam(): name not found test * skipped -- an optional feature could not be imported (you'll see
test_pwd failed -- Writing: 'fakename', expected: 'caught e' quite a few of these, based on what optional modules
test_socket crashed -- exceptions.AttributeError : SOCK_RAW you've included)
test test_fork1 skipped -- can't mix os.fork with threads on BeOS
test test_re failed -- Writing: '=== Failed incorrectly', expected:
"('abc', 'abc', 0, 'fou"
test test_select crashed -- select.error : (-2147459072, 'Bad file
descriptor')
test test_socket crashed -- exceptions.AttributeError : SOCK_RAW
These are all due to either partial support for certain things (like These are all due to either partial support for certain things (like
sockets), or valid differences between systems. sockets), or valid differences between systems.
NOTE: On R4/x86, the pause() function is broken; expect the signal That test_re failure is a little worrysome though.
module test to crash Python!
7) Install: 7) Install:
...@@ -89,5 +119,5 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this: ...@@ -89,5 +119,5 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
8) Enjoy! 8) Enjoy!
- Chris Herborth (chrish@beoscentral.com) - Chris Herborth (chrish@pobox.com)
January 12, 1999 July 21, 2000
...@@ -46,7 +46,7 @@ fi ...@@ -46,7 +46,7 @@ fi
# The shared libraries and glue objects we need to link against; these # The shared libraries and glue objects we need to link against; these
# libs are overkill for most of the standard modules, but it makes life # libs are overkill for most of the standard modules, but it makes life
# in this shell script easier. # in this shell script easier.
LIBS="-L.. -lpython1.5 -lbe -lnet -lroot" LIBS="-L.. -lpython$VERSION -lbe -lnet -lroot"
case $BE_HOST_CPU in case $BE_HOST_CPU in
ppc) ppc)
......
...@@ -6,11 +6,20 @@ child after a fork(). ...@@ -6,11 +6,20 @@ child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error. active threads survive in the child after a fork(); this is an error.
On BeOS, you CANNOT mix threads and fork(), the behaviour is undefined.
That's OK, fork() is a grotesque hack anyway. ;-) [cjh]
""" """
import os, sys, time, thread import os, sys, time, thread
from test_support import TestSkipped from test_support import TestSkipped
try:
if os.uname()[0] == "BeOS":
raise TestSkipped, "can't mix os.fork with threads on BeOS"
except AttributeError:
pass
try: try:
os.fork os.fork
except AttributeError: except AttributeError:
......
...@@ -3620,11 +3620,6 @@ static char posix_putenv__doc__[] = ...@@ -3620,11 +3620,6 @@ static char posix_putenv__doc__[] =
"putenv(key, value) -> None\n\ "putenv(key, value) -> None\n\
Change or add an environment variable."; Change or add an environment variable.";
#ifdef __BEOS__
/* We have putenv(), but not in the headers (as of PR2). - [cjh] */
int putenv( const char *str );
#endif
/* Save putenv() parameters as values here, so we can collect them when they /* Save putenv() parameters as values here, so we can collect them when they
* get re-set with another call for the same key. */ * get re-set with another call for the same key. */
static PyObject *posix_putenv_garbage; static PyObject *posix_putenv_garbage;
......
...@@ -29,13 +29,6 @@ exception is raised if the entry asked for cannot be found."; ...@@ -29,13 +29,6 @@ exception is raised if the entry asked for cannot be found.";
static PyObject * static PyObject *
mkpwent(struct passwd *p) mkpwent(struct passwd *p)
{ {
#ifdef __BEOS__
/* For faking the GECOS field. - [cjh] */
char *be_user = NULL;
be_user = getenv( "USER" );
#endif
return Py_BuildValue( return Py_BuildValue(
"(ssllsss)", "(ssllsss)",
p->pw_name, p->pw_name,
...@@ -49,12 +42,7 @@ mkpwent(struct passwd *p) ...@@ -49,12 +42,7 @@ mkpwent(struct passwd *p)
(long)p->pw_uid, (long)p->pw_uid,
(long)p->pw_gid, (long)p->pw_gid,
#endif #endif
#ifdef __BEOS__
/* BeOS doesn't have a GECOS field, oddly enough. - [cjh] */
be_user ? be_user : "baron",
#else
p->pw_gecos, p->pw_gecos,
#endif
p->pw_dir, p->pw_dir,
p->pw_shell); p->pw_shell);
} }
......
...@@ -70,13 +70,10 @@ extern int ftime(struct timeb *); ...@@ -70,13 +70,10 @@ extern int ftime(struct timeb *);
#endif #endif
#ifdef __BEOS__ #ifdef __BEOS__
#include <time.h>
/* For bigtime_t, snooze(). - [cjh] */ /* For bigtime_t, snooze(). - [cjh] */
#include <support/SupportDefs.h> #include <support/SupportDefs.h>
#include <kernel/OS.h> #include <kernel/OS.h>
#ifndef CLOCKS_PER_SEC
/* C'mon, fix the bloody headers... - [cjh] */
#define CLOCKS_PER_SEC 1000
#endif
#endif #endif
/* Forward declarations */ /* Forward declarations */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment