]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added locking hacks for AIX
authorGuido van Rossum <guido@python.org>
Tue, 20 Aug 1996 20:23:34 +0000 (20:23 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 20 Aug 1996 20:23:34 +0000 (20:23 +0000)
Lib/posixfile.py

index 64cda986223f373a1cc10d43c712e67dd1ef55ec..f0df5433aa0c1c2be180fc35755df60b631c46e8 100644 (file)
@@ -174,11 +174,15 @@ class _posixfile_:
        elif len(args) > 3:
            raise TypeError, 'too many arguments'
 
-       # Hack by davem@magnet.com to get locking to go on freebsd
+       # Hack by davem@magnet.com to get locking to go on freebsd;
+       # additions for AIX by Vladimir.Marangozov@imag.fr
         import sys, os
         if sys.platform == 'freebsd2':
            flock = struct.pack('lxxxxlxxxxlhh', \
                  l_start, l_len, os.getpid(), l_type, l_whence) 
+        elif sys.platform in ['aix3', 'aix4']:
+            flock = struct.pack('hhlllii', \
+                  l_type, l_whence, l_start, l_len, 0, 0, 0)
        else:
            flock = struct.pack('hhllhh', \
                  l_type, l_whence, l_start, l_len, 0, 0)
@@ -189,6 +193,9 @@ class _posixfile_:
            if sys.platform == 'freebsd2':
                l_start, l_len, l_pid, l_type, l_whence = \
                    struct.unpack('lxxxxlxxxxlhh', flock)
+            elif sys.platform in ['aix3', 'aix4']:
+                l_type, l_whence, l_start, l_len, l_sysid, l_pid, l_vfs = \
+                    struct.unpack('hhlllii', flock)
            else:
                l_type, l_whence, l_start, l_len, l_sysid, l_pid = \
                    struct.unpack('hhllhh', flock)