---
name: "BRLERR_CONNREFUSED"
section: "3"
platform: "linux"
package: "libbrlapi-dev"
version: "3.4.1-4"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/brlapi_error"
---

# BRLERR\_CONNREFUSED(3)

how to handle errors which might very well happen

Part of [brlapi\_error(3)](/brlapi_error/3.md).

## NAME

Error handling - how to handle errors which might very well happen

### Defines

\#define **BRLERR\_SUCCESS**   0\
 \#define **BRLERR\_NOMEM**   1\
 \#define **BRLERR\_TTYBUSY**   2\
 \#define **BRLERR\_UNKNOWN\_INSTRUCTION**   3\
 \#define **BRLERR\_ILLEGAL\_INSTRUCTION**   4\
 \#define **BRLERR\_INVALID\_PARAMETER**   5\
 \#define **BRLERR\_INVALID\_PACKET**   6\
 \#define **BRLERR\_RAWNOTSUPP**   7\
 \#define **BRLERR\_KEYSNOTSUPP**   8\
 \#define **BRLERR\_CONNREFUSED**   9\
 \#define **BRLERR\_OPNOTSUPP**   10\
 \#define **BRLERR\_GAIERR**   11\
 \#define **BRLERR\_LIBCERR**   12\
 \#define **BRLERR\_UNKNOWNTTY**   13\
 \#define **brlapi\_errno**   (\*brlapi\_errno\_location ())\

### Functions

void **brlapi\_perror** (const char \*s)\
 int \* **brlapi\_errno\_location** (void)\

### Variables

const char \* **brlapi\_errlist** \[\]\
 const int **brlapi\_nerr**\
 int **brlapi\_errno**\

## Detailed Description

## Define Documentation

### #define brlapi\_errno (\*brlapi\_errno\_location ())

cheat about the brlapi\_errno C token

### #define BRLERR\_CONNREFUSED 9

Connection refused

### #define BRLERR\_GAIERR 11

Getaddrinfo error

### #define BRLERR\_ILLEGAL\_INSTRUCTION 4

Forbiden in current mode

### #define BRLERR\_INVALID\_PACKET 6

Invalid size

### #define BRLERR\_INVALID\_PARAMETER 5

Out of range or have no sense

### #define BRLERR\_KEYSNOTSUPP 8

Reading of key codes not supported by loaded driver

### #define BRLERR\_LIBCERR 12

Libc error

### #define BRLERR\_NOMEM 1

Not enough memory

### #define BRLERR\_OPNOTSUPP 10

Operation not supported

### #define BRLERR\_RAWNOTSUPP 7

Raw mode not supported by loaded driver

### #define BRLERR\_SUCCESS 0

Success

### #define BRLERR\_TTYBUSY 2

Already a connection running in this tty

### #define BRLERR\_UNKNOWN\_INSTRUCTION 3

Not implemented in protocol

### #define BRLERR\_UNKNOWNTTY 13

Couldn't find out the tty number

## Function Documentation

### int\* brlapi\_errno\_location (void)

Get per-thread errno location

In multithreaded software, brlapi\_errno is thread specific, so **brlapi.h** cheats about the brlapi\_errno token and actually calls **brlapi\_errno\_location()**

This gets the thread specific location of global variable brlapi\_errno

### void brlapi\_perror (const char \* s)

Print a BrlAPI error message

**brlapi\_perror()** reads brlapi\_errno, and acts just like perror()

## Variable Documentation

### const char\* brlapi\_errlist\[\]

Error message list

These are the string constants used by **brlapi\_perror()**

### int brlapi\_errno

Global variable brlapi\_errno

brlapi\_errno is a global left-value containing the last error code. It is not reset to BRLERR\_SUCCESS on success.

### const int brlapi\_nerr

Number of error messages
