'Emulates the most basic behavior of Linux\'s flock(1).'

def ExecFlock(self, lockfile, *cmd_list):

    fd = os.open(lockfile, ((os.O_RDONLY | os.O_NOCTTY) | os.O_CREAT), 438)
    fcntl.flock(fd, fcntl.LOCK_EX)
    return subprocess.call(cmd_list)
