#polyfill #pal #platform-abstraction


Cross-platform polyfills. This library attempts to provide reliable polyfills for functionality that isn’t implemented on all platforms

3 unstable releases

✓ Uses Rust 2018 edition

0.2.1 Jan 18, 2019
0.2.0 Jan 11, 2019
0.1.0 Aug 3, 2018

#55 in Unix APIs

Download history 16/week @ 2018-12-14 15/week @ 2018-12-21 12/week @ 2018-12-28 2/week @ 2019-01-04 65/week @ 2019-01-11 30/week @ 2019-01-18 15/week @ 2019-01-25 15/week @ 2019-02-01 13/week @ 2019-02-08 12/week @ 2019-02-15 16/week @ 2019-02-22 63/week @ 2019-03-01 44/week @ 2019-03-08 14/week @ 2019-03-15 30/week @ 2019-03-22

101 downloads per month
Used in 2 crates


1.5K SLoC


Crates.io MIT / Apache 2.0 licensed Build Status Build Status Build Status


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.


gettid()Get thread ID
count()Number of threads in current process
seal_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
FdIterIterate all open file descriptors
memfd_create()Create an anonymous file
fexecve()Execute program specified via file descriptor
copy()Copy by looping io::copy
copy_sendfile()Copy using sendfile
copy_splice()Copy using splice
pipe()Create a pipe
socket()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
exe()Opens the current running executable
exe_path()Get a path to the current running executable
args()Get command line arguments
vars()Get environment variables
fork()Fork a process, using process descriptors where available
is()Check if running under Valgrind
start_fd()Get Valgrind's file descriptor range


Licensed under either of

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.


~13K SLoC