Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alecmocatta/palaver
Cross-platform polyfills.
https://github.com/alecmocatta/palaver
rust
Last synced: about 1 month ago
JSON representation
Cross-platform polyfills.
- Host: GitHub
- URL: https://github.com/alecmocatta/palaver
- Owner: alecmocatta
- License: apache-2.0
- Created: 2018-07-30T17:46:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-22T15:56:25.000Z (about 1 year ago)
- Last Synced: 2024-09-29T22:41:44.809Z (about 2 months ago)
- Topics: rust
- Language: Rust
- Size: 256 KB
- Stars: 14
- Watchers: 1
- Forks: 5
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE.txt
Awesome Lists containing this project
README
# palaver
[![Crates.io](https://img.shields.io/crates/v/palaver.svg?maxAge=86400)](https://crates.io/crates/palaver)
[![MIT / Apache 2.0 licensed](https://img.shields.io/crates/l/palaver.svg?maxAge=2592000)](#License)
[![Build Status](https://dev.azure.com/alecmocatta/palaver/_apis/build/status/tests?branchName=master)](https://dev.azure.com/alecmocatta/palaver/_build)[Docs](https://docs.rs/palaver/0.3.0-alpha.3)
Cross-platform polyfills.
This library attempts to provide reliable polyfills for functionality that isn't implemented on all platforms.
`palaver` = "Platform Abstraction Layer" + pa·lav·er *n.* prolonged and tedious fuss.
## Functionality
ThreadingDescriptionLinuxmacOSWindowsFreeBSDNetBSDiOSAndroid
gettid()
Get thread ID✓✓✓✓✓✓✓count()
Number of threads in current process✓✓ ✓✓
FilesDescriptionLinuxmacOSWindowsFreeBSDNetBSDiOSAndroidseal_fd()
Make a file descriptor read-only✓✓ ✓✓✓✓dup_fd()
Duplicate a file descriptor✓✓ ✓✓✓✓copy_fd()
Copy a file descriptor to a specific offset✓✓–✓✓✓✓move_fd()
Move a file descriptor to a specific offset✓✓–✓✓✓✓move_fds()
Move file descriptors to specific offsets✓✓–✓✓✓✓fd_dir()
Get a path to the file descriptor directory✓✓–✓✓✓✓fd_path()
Get a path to a file descriptor✓✓–✓✓✓✓FdIter
Iterate all open file descriptors✓✓ ✓✓✓✓memfd_create()
Create an anonymous file✓✓ ✓✓✓✓fexecve()
Execute program specified via file descriptor✓✓ ✓✓✓✓copy()
Copy by loopingio::copy
✓✓✓✓✓✓✓copy_sendfile()
Copy usingsendfile
✓✓ ✓ ✓✓copy_splice()
Copy usingsplice
✓ ✓pipe()
Create a pipe✓✓ ✓✓✓✓
SocketDescriptionLinuxmacOSWindowsFreeBSDNetBSDiOSAndroidsocket()
Create a socket✓✓ ✓✓✓✓accept()
Accept a connection on a socket✓✓ ✓✓✓✓is_connected()
Get whether a pending connection is connected✓✓ ✓✓✓✓unreceived()
Get number of bytes readable✓✓ ✓✓✓✓unsent()
Get number of bytes that have yet to be acknowledged✓✓ ✓✓✓✓
EnvDescriptionLinuxmacOSWindowsFreeBSDNetBSDiOSAndroidexe()
Opens the current running executable✓✓✓✓✓✓✓exe_path()
Get a path to the current running executable✓✓✓✓✓✓✓args()
Get command line arguments✓✓✓✓✓✓✓vars()
Get environment variables✓✓✓✓✓✓✓
ProcessDescriptionLinuxmacOSWindowsFreeBSDNetBSDiOSAndroidcount()
Count the processes visible to the current process✓✓–✓✓✓✓count_threads()
Count the threads visible to the current process✓✓–✓✓✓✓fork()
Fork a process, using process descriptors where available✓✓–✓✓✓✓
ValgrindDescriptionLinuxmacOSWindowsFreeBSDNetBSDiOSAndroidis()
Check if running under Valgrind✓✓✓✓✓✓✓start_fd()
Get Valgrind's file descriptor range✓✓–✓✓✓✓## License
Licensed under either of* Apache License, Version 2.0, ([LICENSE-APACHE.txt](LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT.txt](LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.