---
name: "kdk_get_disklist"
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_get_disklist"
---

# kdk\_get\_disklist(3)

获取磁盘列表信息

## NAME

kdk\_get\_disklist - 获取磁盘列表信息

## SYNOPSIS

```
#include <libkydiskinfo.h>

extern char** kdk_get_disklist();

Link with -lkydiskinfo.
```

## Detailed Description

The **kdk\_get\_disklist()** function obtains disk list information during the call process.

## RETURN VALUE

The return value is a char\*\* type, with each string representing the absolute path of a disk and ending with a NULL character.

After completion, **kdk\_free\_disklist()** function releases a list of disk information.

## EXAMPLES

```
#include "libkydiskinfo.h"
#include <stdio.h>
int main()
{
    char **disklist = kdk_get_disklist();
    for (int i = 0; disklist[i]; i ++)
    {
        printf("%s0, disklist[i]);
    }
    kdk_free_disklist(disklist);
    return 0;
}
```

## CONFORMING TO

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: **kdk\_get\_diskinfo**(), **kdk\_get\_hard\_disk**(), and **kdk\_get\_hard\_disk\_size**().

## SEE ALSO

[**kdk\_free\_disklist**(3)](/man/kdk_free_disklist/3.md), [**kdk\_get\_diskinfo**(3)](/man/kdk_get_diskinfo/3.md), **kdk\_free\_diskinfo**(3)
