def METHOD_NAME(path):
    """Returns the maximum length of a file name in the underlying file system
    :param path: the complete filename path. if a non-absolute path is
                 given, it's transformed into an absolute path first.
    :type path: str
    :returns: the maximum length of a file name
    :rtype: int
    """
    if hasattr(os, "pathconf"):
        mount_point = get_path_mount_point(path)
        return os.pathconf(mount_point, "PC_NAME_MAX")
    else:
        # Given the unavailability of os.pathconf(), always available
        # under Unix, it should be safe to assume this is Windows.
        # About Windows, versions and configurations can yield different
        # file name length limits.  The value hardcoded here (248) is
        # calculated from the 260 MAX_PATH limit, plus the provision
        # for directories names allowing a 8.3 filename inside it.
        return 248