criu/test/zdtm/static/file_locks06.checkskip
Radostin Stoyanov ede018176c make: remove checks for python 2 binary
This commit removes the checks for the Python 2 binary in the makefile
and makes sure that ZDTM tests always use python3. Since support for
Python 2 has been dropped, these checks are no longer needed.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2023-10-22 13:29:25 -07:00

19 lines
418 B
Python
Executable file

#!/usr/bin/env python3
import fcntl
import tempfile
import struct
import errno
F_OFD_SETLK = 37
try:
with tempfile.TemporaryFile() as fd:
flock = struct.pack('hhllhh', fcntl.F_RDLCK, 0, 0, 0, 0, 0)
fcntl.fcntl(fd.fileno(), F_OFD_SETLK, flock)
except IOError as e:
if e.errno == errno.EINVAL:
print("I/O error({0}): {1}".format(e.errno, e.strerror))
print("OFD locks are not supported.")
exit(1)
exit(0)