summaryrefslogtreecommitdiff
path: root/Lib/posixfile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-20 20:23:34 +0000
committerGuido van Rossum <guido@python.org>1996-08-20 20:23:34 +0000
commit0368b924efc85029fe21b9a162b4c0867a9f0880 (patch)
treecac9e322297c2388cb718fb54cfee7b17905c448 /Lib/posixfile.py
parent0315cf63562fa247619c0a7a27352da4e6fbc569 (diff)
downloadcpython-0368b924efc85029fe21b9a162b4c0867a9f0880.tar.gz
Added locking hacks for AIX
Diffstat (limited to 'Lib/posixfile.py')
-rw-r--r--Lib/posixfile.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/posixfile.py b/Lib/posixfile.py
index 64cda98622..f0df5433aa 100644
--- a/Lib/posixfile.py
+++ b/Lib/posixfile.py
@@ -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)