All Projects → svartalf → hostname

svartalf / hostname

Licence: MIT license
Cross-platform hostname functions in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to hostname

Cloudlibc
CloudABI's standard C library
Stars: ✭ 254 (+429.17%)
Mutual labels:  unix, posix
go-sysconf
sysconf for Go, without using cgo
Stars: ✭ 119 (+147.92%)
Mutual labels:  unix, posix
Ecominit
eComInit is a free init system and service manager designed to scale from lightweight desktops to web-scale cloud deployments. It aims to offer feature-parity with systemd but with a modular, portable architecture compliant with software engineering best-practice.
Stars: ✭ 352 (+633.33%)
Mutual labels:  unix, posix
duckOS
Yet another hobby x86 UNIX-like operating system written in C and C++. Features a dynamically linked userspace, an in-house c standard library, and more! And yes, it runs DOOM.
Stars: ✭ 250 (+420.83%)
Mutual labels:  unix, posix
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (+104.17%)
Mutual labels:  unix, posix
kernel
Main kernel tree
Stars: ✭ 28 (-41.67%)
Mutual labels:  unix, posix
Awesome Unix
All the UNIX and UNIX-Like: Linux, BSD, macOS, Illumos, 9front, and more.
Stars: ✭ 973 (+1927.08%)
Mutual labels:  unix, posix
tupai
Tupai is a multi-tasking operating system I wrote for my degree that focuses on safety and design, targeting a variety of platforms.
Stars: ✭ 21 (-56.25%)
Mutual labels:  unix, posix
Skalibs
The skarnet.org C system programming library
Stars: ✭ 58 (+20.83%)
Mutual labels:  unix, posix
Parsrs
CSV, JSON, XML text parsers and generators written in pure POSIX shellscript
Stars: ✭ 56 (+16.67%)
Mutual labels:  unix, posix
gitpack
Git-based package manager written in POSIX shell
Stars: ✭ 72 (+50%)
Mutual labels:  unix, posix
Ltp
Linux Test Project http://linux-test-project.github.io/
Stars: ✭ 1,654 (+3345.83%)
Mutual labels:  unix, posix
timebox
A timer script for Windows/Linux/Unix/macOS to practice timeboxing (the time management technique)
Stars: ✭ 42 (-12.5%)
Mutual labels:  unix, posix
fil
😋 Unix file command written in Go
Stars: ✭ 69 (+43.75%)
Mutual labels:  unix, posix
Onyx
UNIX-like operating system written in C and C++
Stars: ✭ 52 (+8.33%)
Mutual labels:  unix, posix
Kirc
A tiny IRC client written in POSIX C99.
Stars: ✭ 416 (+766.67%)
Mutual labels:  unix, posix
onionjuggler
Manage your Onion Services via CLI or TUI on Unix-like operating system with a POSIX compliant shell.
Stars: ✭ 31 (-35.42%)
Mutual labels:  unix, posix
InitKit
Neo-InitWare is a modular, cross-platform reimplementation of the systemd init system. It is experimental.
Stars: ✭ 364 (+658.33%)
Mutual labels:  unix, posix
Posnk
An operating system project.
Stars: ✭ 34 (-29.17%)
Mutual labels:  unix, posix
Unix Permissions
Swiss Army knife for Unix permissions
Stars: ✭ 106 (+120.83%)
Mutual labels:  unix, posix

hostname

Latest Version Latest Version Build Status Minimum rustc version MIT licensed Crates.io

Cross-platform system's host name functions in Rust

Supported platforms

  • POSIX-compliant systems
    (Linux, macOS, Android, FreeBSD, OpenBSD, NetBSD, Solaris, Redox, and so on)
  • Windows

Rust version requirements

Since version 0.2.0 this crate requires Rust version 1.19.0 or greater.

This version is explicitly tested in CI and may be bumped in any major or minor release as needed.
Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes.

Usage

Add the following dependency to your Cargo manifest:

[dependencies]
hostname = "^0.3"

Crate API provides two simple functions for retrieving and setting the system's host name:

use std::io;

fn main() -> io::Result<()> {
    // Retrieve the hostname
    dbg!(hostname::get()?);

    // And set a new one
    hostname::set("potato")?;

    Ok(())
}

License

hostname is primarily distributed under the terms of the MIT license (LICENSE or http://opensource.org/licenses/MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].