Unix-emulation, for Windows
UNIXem is a small and simple library that provides emulation of several popular Unix API functions on the Windows platform. Its primary purpose is to assist Windows programmers who are porting to Unix or are writing multi-platform code.
NOTE: UNIXem is a Windows-only library.
As of 1.12.7, CMake support is provided, and this is the recommended means of installation. Detailed instructions are provided in INSTALL.md.
Top-level compatibility headers (e.g. dirent.h, unistd.h) wrap the corresponding unixem/ headers.
| API(s) | Header | Purpose | Restrictions |
|---|---|---|---|
chdir(), getcwd(), mkdir(), rmdir() |
unixem/unistd.h |
Working directory; make/remove dirs | — |
close(), getpagesize(), link(), pathconf(), realpath(), unlink() |
unixem/unistd.h |
FD close; page size; links; paths | — |
dlopen(), dlclose(), dlsym(), dlerror() |
unixem/dlfcn.h |
Dynamic library load/lookup | — |
gethostname(), getpid(), usleep() |
unixem/unistd.h |
Host name; process id; sleep | — |
getrusage() |
unixem/sys/resource.h |
Process resource usage | Limited field coverage |
gettimeofday() |
unixem/sys/time.h |
Wall-clock time of day | — |
glob(), globfree() |
unixem/glob.h |
Pathname pattern expansion | Incomplete flag coverage |
mkdtemp(), mkstemp() |
unixem/unistd.h |
Temporary directory/file creation | — |
mmap(), munmap(), msync() |
unixem/sys/mman.h |
Memory-map files/regions | — |
opendir(), readdir(), rewinddir(), closedir() (+ w* wide forms) |
unixem/dirent.h |
Directory iteration | — |
readv(), writev() |
unixem/sys/uio.h |
Vectored file read/write | — |
setenv(), unsetenv() |
unixem/setenv.h |
Environment variable set/clear | — |
timegm() |
unixem/time.h |
UTC struct tm to time_t |
— |
| API(s) | Header | Purpose | Restrictions |
|---|---|---|---|
unixem_atomic_* (inc/dec/add/sub/set/read/write/test) |
unixem/asm/atomic.h |
Linux-style atomic integers | — |
| API(s) | Header | Purpose | Restrictions |
|---|---|---|---|
begins_with, ends_with |
unixem/util/str.h |
UNIXem.Util.Str string helpers | Helper API (also internal) |
char_is_path_sep, directory_exists, get_home_directory |
unixem/util/fs.h |
UNIXem.Util.FS path/FS helpers | Helper API (also internal) |
| API(s) | Header | Purpose | Restrictions |
|---|---|---|---|
| — | arpa/inet.h |
Compatibility include stub | Empty placeholder |
| — | netinet/in.h |
Compatibility include stub | Empty placeholder |
| — | sys/socket.h |
Compatibility include stub | Empty placeholder |
Examples are not yet provided in this distribution. See the component and unit tests under test/ for usage illustrations.
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/UNIXem.
There are no dependencies for installation and use of UNIXem.
The component-/unit-tests depend on:
UNIXem is used by a number of C/C++ libraries for compilation/linking/testing on Windows, including:
UNIXem is released under the 3-clause BSD license. See LICENSE for details.