---
name: "sc_detect_card_presence"
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_detect_card_presence"
---

# sc\_detect\_card\_presence(3)

Detect presence of smart card in a reader

## NAME

sc\_detect\_card\_presence - Detect presence of smart card in a reader

## SYNOPSIS

```
#include <opensc.h>
int sc_detect_card_presence(sc_reader_t *reader, int slot_id);
```

## DESCRIPTION

This function checks whether *reader* has a card present in *slot\_id*.

## RETURN VALUE

If an error occurred, the return value is a a negative OpenSC error code. If no card is present, 0 is returned. Otherwise, a positive value is returned, which is a combination of flags. The flag SC\_SLOT\_CARD\_PRESENT is always set. In addition, if the card was exchanged, the SC\_SLOT\_CARD\_CHANGED flag is set.
