---
name: "kdk_set_inhibit_lockscreen"
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_set_inhibit_lockscreen"
---

# kdk\_set\_inhibit\_lockscreen(3)

设置禁止锁屏

## NAME

kdk\_set\_inhibit\_lockscreen - 设置禁止锁屏

## SYNOPSIS

```
#include <libkylockscreen.h>

extern uint32_t kdk_set_inhibit_lockscreen(const char *appName, const char *reason);

Link with -lkypowermanagement.
```

## Detailed Description

The main function of the interface is to set the lock screen to suppress.

The argument *appName* is the application name.

The argument *reason* is the reason for disabling the lock screen.

## RETURN VALUE

On success, return **0.**

On error, return **-1.**

## EXAMPLES

```
#include <libkylockscreen.h>
#include <stdio.h>
int main(void)
{
    char appName[] = "test-package";
    char reason[] = "test-reason";
    uint32_t flag;
    if ((flag = kdk_set_inhibit_lockscreen(appName , reason)) == 0) {
        printf("set inhibit lock screen fail !0);
        return -1;
    }
    if (kdk_un_inhibit_lockscreen(flag)) {
        printf("un inhibit lock screen fail !0);
        return -1;
    }
    return 0;
}
```

## CONFORMING TO

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: **kdk\_un\_inhibit\_lockscreen**().

## SEE ALSO

[**kdk\_un\_inhibit\_lockscreen**(3)](/man/kdk_un_inhibit_lockscreen/3.md).
