
___x_cmd_btime__iswsl_(){
    [ -z "$WSL_INTEROP" ] || return 0

    local v_
    if [ -r /proc/version ]; then
        while read -r v_; do
            case "$v_" in
                *[Mm]icrosoft*|*[Ww][Ss][Ll]2*) return 0 ;;
            esac
        done </proc/version
    fi

    if [ -r /proc/sys/kernel/osrelease ]; then
        read -r v_ </proc/sys/kernel/osrelease
        case "$v_" in
            *[Mm]icrosoft*|*[Ww][Ss][Ll]2*) return 0 ;;
        esac
    fi

    return 1
}

___x_cmd_btime_(){
    [ -z "$___X_CMD_BTIME" ] || {
        x_="$___X_CMD_BTIME"
        return 0
    }

    if [ ! -f "/proc/stat" ]; then
        ___x_cmd hascmd sysctl || return 1
        if x_="$(sysctl -n kern.boottime)"; then
            x_="${x_#*= }"
            x_="${x_%%,*}"
            ___X_CMD_BTIME="$x_"

            return 0
        else
            x_=""
            return 1
        fi
    fi

    while read -r x_; do
        case "$x_" in
            btime*)
                x_="${x_#* }"
                if ! ___x_cmd_btime__iswsl_; then
                    ___X_CMD_BTIME="$x_"
                fi
                return 0
            ;;
        esac
    done </proc/stat

    x_=""
    return 1
}

___x_cmd_btime(){
    local x_
    ___x_cmd_btime_ || return $?
    printf "%s\n" "$x_"
}
