.\" Copyright Warren Toomey
.\"
-.\" $Revision: 1.9 $
-.\" $Date: 2002/06/10 12:08:27 $
+.\" $Revision: 1.10 $
+.\" $Date: 2008/05/15 03:20:52 $
.\"
.Dd December, 2000
.Dt APOUT 1
.Ev APOUT_ROOT
before you can run
.Nm apout.
+.Pp
+There is one other optional environment variable:
+.Ev APOUT_UNIX_VERSION.
+This is mainly required for UNIX binaries that use the 0407 header,
+which was used across several versions of UNIX, each with a different set
+of system calls. If APOUT_UNIX_VERSION is set,
+.Nm apout
+will use the given version when it cannot determine which version of UNIX a
+binary belongs to. The available values are "V1", "V2", "V3", "V4", "V5", "V6",
+"V7", "2.9BSD" and "2.11BSD".
+.Pp
.Sh EMULATED ENVIRONMENT VARIABLES
Initially, PDP-11 binaries run via
.Nm apout
* a.out header. If it matches any of the checksums below, it returns
* the appropriate environment value. Otherwise, it returns IS_UNKNOWN.
*
- * $Revision: 1.14 $
- * $Date: 2008/05/06 23:31:53 $
+ * $Revision: 1.15 $
+ * $Date: 2008/05/15 03:20:52 $
*/
#include "defines.h"
{
u_int32_t cksum=0;
int i;
+ char *unix_version;
if (cptr==NULL) return(IS_UNKNOWN);
/* Calculate the checksum */
return(S[i].environment);
}
- /* None, return 0 */
+ /* See if user tells us what version to use */
+ if ((unix_version = getenv("APOUT_UNIX_VERSION"))) {
+ if (!strcmp(unix_version, "V1")) return(IS_V1);
+ if (!strcmp(unix_version, "V2")) return(IS_V2);
+ if (!strcmp(unix_version, "V3")) return(IS_V3);
+ if (!strcmp(unix_version, "V4")) return(IS_V4);
+ if (!strcmp(unix_version, "V5")) return(IS_V5);
+ if (!strcmp(unix_version, "V6")) return(IS_V6);
+ if (!strcmp(unix_version, "V7")) return(IS_V7);
+ if (!strcmp(unix_version, "2.9BSD")) return(IS_29BSD);
+ if (!strcmp(unix_version, "2.11BSD")) return(IS_211BSD);
+ }
+
+ /* We can't tell what version of Unix, give up */
(void)printf("Apout - unknown magic in header: 0x%x\n",cksum);
return(IS_UNKNOWN);
}