---
name: "kdk_cpu_get_virt"
section: "3"
platform: "linux"
package: "libkysdk-system"
version: "3.0.1.4-1"
release: "Arch Linux 2026-11-07"
platforms: ["linux"]
url: "https://carta.tech/man/kdk_cpu_get_virt"
---

# kdk\_cpu\_get\_virt(3)

获取CPU对虚拟化的支持

## NAME

kdk\_cpu\_get\_virt - 获取CPU对虚拟化的支持

## SYNOPSIS

```
#include <libkycpu.h>

extern const char* kdk_cpu_get_virt();

Link with -lkyhw.
```

## Detailed Description

The main function of the interface is to obtain CPU support for virtualization

## RETURN VALUE

If the CPU supports virtualization, return virtualization technology, such as "vmx"; If not supported, return NULL; The return is const char\*, do not *free*

## EXAMPLES

```
#include "libkycpu.h"
#include <stdio.h>
int main()
{
    printf("架构：%s\n", kdk_cpu_get_arch());
    printf("生产厂商：%s\n", kdk_cpu_get_vendor());
    printf("CPU 型号：%s\n", kdk_cpu_get_model());
    printf("CPU 主频：%s MHz\n", kdk_cpu_get_freq_MHz());
    printf("CPU 单核核心数量：%u\n", kdk_cpu_get_corenums());
    printf("CPU 虚拟化支持：%s\n", kdk_cpu_get_virt());
    printf("CPU 线程数：%u\n", kdk_cpu_get_process());
    return 0;
}
```

## CONFORMING TO

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: **kdk\_cpu\_get\_arch**(), **kdk\_cpu\_get\_model**(), **kdk\_cpu\_get\_freq\_MHz**(), **kdk\_cpu\_get\_corenums**(), **kdk\_cpu\_get\_vendor**() and **kdk\_cpu\_get\_process**().

## SEE ALSO

[**kdk\_cpu\_get\_arch**(3)](/man/kdk_cpu_get_arch/3.md), [**kdk\_cpu\_get\_model**(3)](/man/kdk_cpu_get_model/3.md), [**kdk\_cpu\_get\_freq\_MHz**(3)](/man/kdk_cpu_get_freq_MHz/3.md), [**kdk\_cpu\_get\_corenums**(3)](/man/kdk_cpu_get_corenums/3.md), [**kdk\_cpu\_get\_vendor**(3)](/man/kdk_cpu_get_vendor/3.md) and [**kdk\_cpu\_get\_process**(3)](/man/kdk_cpu_get_process/3.md).
