def _get_os_name(platform):
    """Returns the OS name for the given platform. This value can be used when constructing target triplets.

    Args:
        platform: The `apple_platform` value describing the target platform.

    Returns:
        A `string` value representing the OS name.
    """
    platform_string = str(platform.platform_type)
    if platform_string == "macos":
        platform_string = "macosx"
    return platform_string