Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!vector!rpp386!jfh From: jfh@rpp386.UUCP (John F. Haugh II) Newsgroups: comp.sources.d Subject: Re: newgetty question Message-ID: <2525@rpp386.UUCP> Date: 8 Jun 88 02:27:42 GMT References: <1259@percival.UUCP> Reply-To: jfh@rpp386.UUCP (The Beach Bum) Organization: Big "D" Home for Wayward Hackers Lines: 53 In article <1259@percival.UUCP> nerd@percival.UUCP (Michael Galassi) writes: >Howdy, > I just finished trying to compile the newgetty program recently >posted. I got _rdchk, _defread and _defopen as undefined by ld. I >solved the _rdchk as follows but have no clue as to what the other two >routines are supposed to do. Anyone have a clue for me to go by? As >per usual, >thanks in advance, > -michael defopen() and defread() and routines for using defaults files. the idea being that OEM's would want to be able to configure their systems without having to provide sources. using a ``defaults'' file allows different configurations using the same binary. an example of a defaults file for dump(1) might be tape=/dev/rfd0 disk=/dev/rroot for a small pc, and then tape=/dev/rmt/0m disk=/dev/dsk/0s1 for a larger machine using the system v naming convention. the normal convention is for a program named 'xxx' to store its defaults in the file '/etc/default/xxx'. the call to defopen() for that program would be int defopen (char *); defopen ("xxx"); and the call to defread() to determine the tape device would be something like char *defread (char *); char *mytape, *cp; if ((cp = defread ("tape")) == (char *) 0) cp = "/dev/rmt/0m"; strdup (mytape, cp); i seem to recall there is a bug (or was in the Microsoft Xenix version i used to use) with these routines. you may want to write your own. i did once and it took mere minutes. don't forget the strdup() call, the return value from defread() "points to static data, whose contents are overwritten by each call." - john.