---
name: "dpns_closedir"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/dpns_closedir"
---

# dpns\_closedir(3)

close DPNS directory opened by dpns\_opendir in the name server

## NAME

dpns\_closedir - close DPNS directory opened by **dpns\_opendir** in the name server

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "dpns\_api.h"**

**int dpns\_closedir (dpns\_DIR \****dirp***)**

## DESCRIPTION

**dpns\_closedir** closes the DPNS directory opened by **dpns\_opendir** in the name server and frees the **dpns\_DIR** structure pointed by *dirp*.

- *dirp*

  specifies the pointer value returned by **dpns\_opendir**.

## RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **EBADF**

  File descriptor in DIR structure is invalid.

- **EFAULT**

  *dirp* is a NULL pointer.

- **SENOSSERV**

  Service unknown.

- **SECOMERR**

  Communication error.

- **ENSNACT**

  Name server is not running or is being shutdown.

## SEE ALSO

**[dpns\_opendir(3)](/dpns_opendir/3.md)**, **[dpns\_readdir(3)](/dpns_readdir/3.md), [dpns\_readdirx(3)](/dpns_readdirx/3.md)**, **[dpns\_rewinddir(3)](/dpns_rewinddir/3.md)**

## AUTHOR

**LCG Grid Deployment** Team
