Unix Incompatibility Notes:

Jan Wolter

I've written a fair number of supposedly portable Unix C packages. As I do so, I often find I have to figure out a few dozen variations on different libraries and packages and how they work differently and are installed differently on different Unix systems. I've decided to start documenting these as I figure them out, so I'll never have to do so again.

To some degree, the problem addressed by these notes is a vanishing one. The variation among Unixes seems to be much less than it used to be. This is partly because many standards have been established, and partly because the availability of open source versions of virtually all Unix software has reduced the temptation for everyone to implement the same things differently. Not surprisingly, support for older Unixes has been vanishing from many widely distributed packages. Three years ago, any open source software package could be compiled on SunOS 4.1. Today nearly all require at least some fixing. Many developers support little beyond the free Unixes and Solaris.

Nevertheless, these notes describe a few of the differences in Unix and C library implementations, and give advice on how to program around them. These notes are not meant to substitute for "man" pages. Some web searching will find you man pages for most any system you are interested in. Some links to man pages are included below. Instead of describing any one version of these commands in detail, I focus on differences between implementations, and possible pitfalls that confront the programmer who wants his code to work in lots of places.

These notes are not meant to be comprehensive. My intent is to document as much as I find out in the course of writing my programs, but the primary goal is to write my programs, not to write these notes. I don't intend to document variations in portions of the API that I never use. I'm not really a collector of Unix trivia, and am probably not the ideal person to be writing these pages. Still, comments and corrections can be sent to me.

All code fragments appearing in these notes may be considered to be in the public domain, and may be freely used without license constraints.


Byte Order - Big endian or little endian.
Character Classification and Conversion - ctype.h macros.
DBM Hash Libraries - (dbm, ndbm, gdbm, and db)
Header Files
I/O Functions - (printf(), snprintf(), etc.)
Memory Management Functions
PAM Pluggable Authentication Module - (Solaris and Linux-PAM)
Password Checking
Regular Expression Libraries
String and Memory Functions - (strchr(), memmove(), etc.)
UID Setting Functions - (setuid(), setreuid(), etc.)
Variadic Functions - (stdargs and varargs)

Man Pages:

Man Page Collection - FreeBSD.org's collection of man page sets from lots of Unixes.

OpenBSD - Various OpenBSD versions.
AIX Library - AIX 4.3 documentation.
WWW.Docs.HP.Com - HP-UX documentation.
SGI Technical Publications - IRIX documentation.
Docs.Sun.Com - Solaris documentation.

Other Links:

Enabling High Performance Data Transfers on Hosts - Information on TCP implementations under different OS's.

Jan Wolter (E-Mail)
Sun Apr 2 17:34:00 EDT 2000 - Original Release.
Tue May 23 14:58:06 EDT 2000 - Added Regular Expression Stuff.
Sat Aug 25 00:01:33 EDT 2001 - Added Variadic Stuff.
Wed Feb 6 01:29:46 EST 2002 - Added Byte Order Stuff.
Mon Sep 23 10:52:37 EDT 2002 - Added Setuid Stuff.
Thu Mar 6 10:46:38 EST 2003 - Added Ctype Stuff.