---
name: "sc_lock"
section: "3"
platform: "linux"
package: "libopensc2-dev"
version: "0.11.13-1.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_lock"
---

# sc\_lock(3)

Lock a card for exclusive use

## NAME

sc\_lock - Lock a card for exclusive use

## SYNOPSIS

```
#include <opensc.h>
int sc_lock(struct sc_card *card);
```

## DESCRIPTION

This function locks the card against modification from other threads or processes. The function may be called several times; a counter will be increased, and the card will be unlocked only when this counter reaches zero.

## RETURN VALUE

Returns 0 on success, or a negative value in case of error.
