errno-codes

Crates.ioerrno-codes
lib.rserrno-codes
version0.1.0
sourcesrc
created_at2018-05-26 15:25:35.849625
updated_at2018-05-26 15:25:35.849625
descriptionerrno codes with messages from various OSes and architectures
homepage
repositoryhttps://github.com/im-0/errno-codes
max_upload_size
id67147
size1,515,548
Ivan Mironov (im-0)

documentation

https://docs.rs/crate/errno-codes

README

Build Status crates.io MIT/Apache 2.0

errno-codes

Rust library for dealing with errno codes sent over the network from different operation systems and/or CPU architectures.

Documentation on docs.rs

Why?

errno is a standard way for handling errors in many standard libraries of many operating systems. Unfortunately, very few errno constant identifiers are standardized, and a lot of errno values with the same meaning use different numeric constants across different OSes.

On Linux, some CPU architectures may define their own numeric constants (see $KERNEL_SRC/arch/$ARCH/include/uapi/asm/errno.h), different from common values used by the most of other architectures (see $KERNEL_SRC/include/uapi/asm-generic/errno*.h). It looks like this was done for source-level compatibility with proprietary Unixes for these CPU architectures.

Despite compatibility complications, raw errno codes are sometimes used in network protocols. This library simplifies working with such protocols.

Known errno codes

Source code with constants and mappings generate automatically based on header files from following OSes:

  • Linux, all architectures known by kernel 4.16
  • Windows (MinGW)

Usage

Add this to your Cargo.toml:

[dependencies]
errno-codes = "0.1"

See examples/ directory and crate errno-codes-tool for usage examples.

Commit count: 17

cargo fmt