Kaydet (Commit) 0f6a3bf4 authored tarafından Guido van Rossum's avatar Guido van Rossum

Added locking hacks for AIX

üst f85de8a4
...@@ -174,11 +174,15 @@ class _posixfile_: ...@@ -174,11 +174,15 @@ class _posixfile_:
elif len(args) > 3: elif len(args) > 3:
raise TypeError, 'too many arguments' 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 import sys, os
if sys.platform == 'freebsd2': if sys.platform == 'freebsd2':
flock = struct.pack('lxxxxlxxxxlhh', \ flock = struct.pack('lxxxxlxxxxlhh', \
l_start, l_len, os.getpid(), l_type, l_whence) 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: else:
flock = struct.pack('hhllhh', \ flock = struct.pack('hhllhh', \
l_type, l_whence, l_start, l_len, 0, 0) l_type, l_whence, l_start, l_len, 0, 0)
...@@ -189,6 +193,9 @@ class _posixfile_: ...@@ -189,6 +193,9 @@ class _posixfile_:
if sys.platform == 'freebsd2': if sys.platform == 'freebsd2':
l_start, l_len, l_pid, l_type, l_whence = \ l_start, l_len, l_pid, l_type, l_whence = \
struct.unpack('lxxxxlxxxxlhh', flock) 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: else:
l_type, l_whence, l_start, l_len, l_sysid, l_pid = \ l_type, l_whence, l_start, l_len, l_sysid, l_pid = \
struct.unpack('hhllhh', flock) struct.unpack('hhllhh', flock)
......
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