Crates.io | errno-codes |
lib.rs | errno-codes |
version | 0.1.0 |
source | src |
created_at | 2018-05-26 15:25:35.849625 |
updated_at | 2018-05-26 15:25:35.849625 |
description | errno codes with messages from various OSes and architectures |
homepage | |
repository | https://github.com/im-0/errno-codes |
max_upload_size | |
id | 67147 |
size | 1,515,548 |
Rust library for dealing with errno
codes sent over the network from
different operation systems and/or CPU architectures.
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.
Source code with constants and mappings generate automatically based on header files from following OSes:
Add this to your Cargo.toml:
[dependencies]
errno-codes = "0.1"
See examples/
directory and crate errno-codes-tool
for usage examples.