magic numbers? (teach me, please)

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Nov 28 03:31:16 AEST 1985


There is no central authority who issues "official" magic numbers
for UNIX.  System V keeps a list in /etc/magic (perhaps
/usr/lib/magic or /usr/5lib/magic, depending on your system) and
the "file" command uses this (along with some heuristic tests) to
identify types of files.  a.out types are hard-wired into the
kernel (they're usually described in /usr/include/a.out.h).  The
same type of a.out is supposed to have the same magic number
across UNIX implementations, but this scheme has broken down
over the years and it is likely that different CPUs and even
different UNIX vendors use different numbers for the same type.



More information about the Comp.unix.wizards mailing list