Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!urlichs From: urlichs@smurf.sub.org (Matthias Urlichs) Newsgroups: comp.unix.aux Subject: Re: Here are some useful patches to rn for A/UX Keywords: rn patches Message-ID: <#-1qg2.0-5@smurf.sub.org> Date: 3 Dec 90 18:53:54 GMT References: <1990Nov30.015100.6211@wiskit.pdx.com> <1990Dec2.014221.12113@panix.uucp> Organization: University of Karlsruhe, FRG Lines: 62 In comp.unix.aux, article <1990Dec2.014221.12113@panix.uucp>, alexis@panix.uucp (Alexis Rosen) writes: < < Also, I did not know anything about the compatibility libraries (my knowledge < of A/UX coding is basically non-existent yet...), although I know about the < compiler define switches like _SYSV_SOURCE. Is there a brief and concise < description of stuff like this in one place, or do I need to fish through < the man pages for a year in order to discover everything? < Man pages? There are basically four "compatibility modes" or whatever Apple chooses to call them: - A/UX standard stuff (no additional library) - SysV (use -lsysv) - BSD (use -lbsd) - POSIX (use -lposix) This is the environment which programs expect when you run them. Obviously, it doesn't make sense to use more than one of the above. If you need anything weird, include the appropriate setcompat() call in your program. (There are some other minor differences, e.g. when enumerating directories.) Distinguished from this are the various defining flags for cc which make your C code compile in the first place: -D_SYSV_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_AUX_SOURCE if your program uses any special features from System V, BSD, Posix, or A/UX, respectively. These can be combined freely. There are some bugs in the include files; you can't include some of the Streams stuff without using -D_SYSV_SOURCE or some of the networking code without -D_POSIX_SOURCE because Apple forgot to replace some of the standard typedef'd names in the Streams/networking-specific .h files. Incidentally, Apple seems to have licensing problems with AT&T because Apple modified all these include files. (AT&T doesn't seem to like that at all.) These -D_XXX_SOURCE flags are somewhat awkward at first, but very easy to work with if / as soon as you know what you want to do and what kind of compile- and runtime environment the programs you're trying to compile expect -- lots easier than mucking around with "universe" stuff like some other vendors' Unix. NB: None of the above applies to the TTY interface, which is System Five throughout. The odd code which still doesn't have SysV terminal support will have to be rewritten. The biggest hassle are programs which don't use "feature flags" but expect that there's either a -DBSD or a -DSYSV (or -DUSG) in the Makefile which switches everything around. This is a problem because the A/UX terminal handling is SysV while the signal handling is BSD. (Mostly.) Fortunately, programmers learn, and the percentage of new code which does this sort of thing is decreasing fast. Disclaimer: All of the above is gross conjecture and should not be taken seriously. -- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de /(o\ Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330) \o)/