[comp.sys.amiga] Patch for Aztec exec

walton@ametek.UUCP (Steve Walton) (12/17/86)

After much pain and heartache, I have found a solution for all of you
Manx users who need exec() or fexec() under 1.2 but don't have any
updates.  Compile, link, and run the following program in a directory
which also contains a copy of the Version 3.20a c.lib and c32.lib.
It will patch the libraries so the exec() and fexec() functions work
under AmigaDOS 1.2 but NOT under 1.1.  By the way, a bug: fexecl() is
equivalent to execvp(), and does NOT return to the calling program.
Use fexecv() for that.
--------------cut here: compilers don't speak English------------
/*
 * Patch for Aztec C Version 3.20a c.lib and c32.lib to enable
 * exec() and fexec() to work under AmigaDOS 1.2.
 */
#include "fcntl.h"

main()
{
    int fd;
    fd = open("c.lib", O_RDWR);
    if (fd > 0) {
	lseek(fd, 0x303eL, 0);
	write(fd, "\xa8", 1);
	lseek(fd, 0x348aL, 0);
	write(fd, "\xa8", 1);
	close(fd);
    }
    fd = open("c32.lib", O_RDWR);
    if (fd > 0) {
	lseek(fd, 0x3176L, 0);
	write(fd, "\xa8", 1);
	lseek(fd, 0x35beL, 0);
	write(fd, "\xa8", 1);
	close(fd);
    }
}
------------------cut here too---------------------------------
That's it!  Use it in good health.
          --Steve Walton, somewhere in time