Patch #488073: AtheOS port.
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index ec72557..77ae9c5 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -721,6 +721,34 @@
         test_zipfile
         test_zlib
         """,
+    'atheos':
+	"""
+	test_al 
+	test_cd 
+	test_cl 
+	test_curses 
+	test_dl 
+	test_email_codecs
+	test_gdbm 
+	test_gl 
+	test_imgfile 
+	test_largefile 
+	test_linuxaudiodev
+	test_locale 
+	test_mhlib
+	test_mmap 
+	test_mpz 
+	test_nis 
+	test_poll
+	test_popen2
+	test_resource
+	test_socket_ssl 
+	test_socketserver 
+	test_sunaudiodev
+	test_unicode_file
+	test_winreg
+	test_winsound
+	""",
 }
 
 class _ExpectedSkips:
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index c4e47ad..cc4f213 100755
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -17,6 +17,9 @@
 else:
     start_len = "qq"
 
+if sys.platform.startswith('atheos'):
+    start_len = "qq"
+
 if sys.platform in ('netbsd1', 'Darwin1.2', 'darwin',
                     'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
                     'bsdos2', 'bsdos3', 'bsdos4',
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 71222c1..261db2c 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -1,3 +1,4 @@
+import sys
 import os
 from array import array
 
@@ -88,7 +89,11 @@
 if not f.closed:
     raise TestFailed, 'file.closed should be true'
 
-for methodname in ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', 'xreadlines' ]:
+methods = ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', 'xreadlines' ]
+if sys.platform.startswith('atheos'):
+    methods.remove('truncate')
+
+for methodname in methods:
     method = getattr(f, methodname)
     try:
         method()
diff --git a/Lib/test/test_mhlib.py b/Lib/test/test_mhlib.py
index 91c1a1a..ef5877d 100644
--- a/Lib/test/test_mhlib.py
+++ b/Lib/test/test_mhlib.py
@@ -12,7 +12,7 @@
 import sys
 import mhlib
 
-if sys.platform.startswith("win") or sys.platform=="riscos":
+if sys.platform.startswith("win") or sys.platform=="riscos" or sys.platform.startswith("atheos"):
     raise TestSkipped("test_mhlib skipped on %s -- "%sys.platform +
                       "too many Unix assumptions")
 
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 12c016b..735d4cb 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -139,7 +139,13 @@
             return
 
         import statvfs
-        result = os.statvfs(self.fname)
+        try:
+            result = os.statvfs(self.fname)
+        except OSError, e:
+            # On AtheOS, glibc always returns ENOSYS
+            import errno
+            if e.errno == errno.ENOSYS:
+                return
 
         # Make sure direct access works
         self.assertEquals(result.f_bfree, result[statvfs.F_BFREE])
diff --git a/Lib/test/test_popen2.py b/Lib/test/test_popen2.py
index 799df4a..c67dd71 100644
--- a/Lib/test/test_popen2.py
+++ b/Lib/test/test_popen2.py
@@ -14,11 +14,12 @@
 
 def main():
     print "Test popen2 module:"
-    if sys.platform[:4] == 'beos' and __name__ != '__main__':
+    if (sys.platform[:4] == 'beos' or sys.platform[:6] == 'atheos') \
+           and __name__ != '__main__':
         #  Locks get messed up or something.  Generally we're supposed
         #  to avoid mixing "posix" fork & exec with native threads, and
         #  they may be right about that after all.
-        raise TestSkipped, "popen2() doesn't work during import on BeOS"
+        raise TestSkipped, "popen2() doesn't work during import on " + sys.platform
     try:
         from os import popen
     except ImportError: