hopefully have a working cross-platform implementation

Signed-off-by: Robert J. Ennis <rje@sdf.org>