Amiga Unix — 68040 · 68060

Manual pages › Libraries: curses, OPEN LOOK and others (3)

strcasecmp(3)

libamixcompat, the C library functions and headers Amix lacks

Package: acompat, added for amigaux.

Also by this name: acompat(3), Libraries: curses, OPEN LOOK and others

acompat - libamixcompat, the C library functions and headers Amix lacks

#include <amixcompat.h>
int snprintf(char *str, size_t size, const char *format, ...);
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
int setenv(const char *name, const char *value, int overwrite);
int unsetenv(const char *name);
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
int mkstemp(char *template);
int usleep(unsigned int usec);
int gettimeofday(struct timeval *tp, void *tzp);
const char *amix_compat_version(void);
#include <stdint.h>
#include <strings.h>
cc -I/usr/local/include ... -L/usr/local/lib -lacompat

libacompat is a static library of the C library functions the Amix (SVR4.0) libc does not have, with the headers that declare them. Each one was measured absent from /usr/lib/libc.so.1. The archive is named libacompat.a because the s5 root file system keeps 14 bytes of a name, and libamixcompat.a is 15.

C99 formatted output into a buffer of size bytes, always terminated, returning the length the full output would have. They handle the ll, j, z and t length modifiers, so 64-bit integers print correctly; the stock printf(3S) has no ll modifier. Floating-point conversions are done by the stock sprintf(3S), and need a 68881 or 68882. %n is not implemented: it is printed as written. A null string prints as (null), truncated by a precision; a null pointer prints as 0x0.
Add, change or remove an environment variable; the strings are copied.
Compare strings ignoring ASCII case.
Replace the trailing XXXXXX of template and create the file exclusively, mode 0600; returns its descriptor.
Sleep for usec microseconds, rounded up to the clock tick; built on poll(2), so it leaves the caller's timers alone.
The time of day, seconds and microseconds, from the stock one-argument _abi_gettimeofday; tzp is ignored.
The library's version string, e.g. 0.1-7-gcc14.

<stdint.h> gives the exact-width integer types of this ILP32 big-endian target, and <strings.h> declares strcasecmp and strncasecmp only; neither header exists on a stock system. <amixcompat.h> also defines ssize_t.

snprintf and vsnprintf return the length the output would have had, or -1 with errno set to ENOMEM when a floating-point conversion cannot get its buffer. setenv, unsetenv, usleep and gettimeofday return 0, or -1 with errno set. mkstemp returns a file descriptor, or -1.

Do not compile with -ansi or -D_POSIX_SOURCE: many Amix headers hide declarations in their ANSI view, among them struct timeval, which gettimeofday needs.

strcasecmp is absent from libc but present in libresolv.a, declared in no system header. Linking both -lresolv and -lacompat, the archive the linker reaches first wins; both agree on ASCII.

Programs built with GCC 14 get these functions from the toolchain's own runtime, and do not link libacompat.

/usr/local/lib/libacompat.a
The library.
/usr/local/include/{amixcompat.h,stdint.h,strings.h}
The headers.
/usr/local/bin/acompat-test
The on-box acceptance test, acompat-test(1).

acompat-test(1)

2026-10-30 acompat 0.1