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

# netclose(3)

close an existing socket

## NAME

netclose - close an existing socket

## SYNOPSIS

**#include "net.h"**

**int netclose (int** *s***);**

## DESCRIPTION

**netclose** closes an existing socket.

## RETURN VALUE

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

## ERRORS

- **EINTR**

  The function was interrupted by a signal.

- **EBADF**

  *s* is not a valid descriptor.

- **ENOTSOCK**

  *s* is not a socket.

## SEE ALSO

**[close(2)](/close/2.md)**, **closesocket(WNT)**, **neterror(3)**

## AUTHOR

**LCG Grid Deployment** Team
