Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon S. Allbery) Newsgroups: comp.sources.d Subject: Re: newgetty question Message-ID: <8003@ncoast.UUCP> Date: 15 Jun 88 21:31:45 GMT References: <1259@percival.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Followup-To: comp.sources.d Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 37 As quoted from <1259@percival.UUCP> by nerd@percival.UUCP (Michael Galassi): +--------------- | I just finished trying to compile the newgetty program recently | posted. I got _rdchk, _defread and _defopen as undefined by ld. I +--------------- rdchk() works on a Unix fd, not a stdio (FILE *). The "newgetty" posting was specific to Tandy Xenix 3.2, and will need some work to be ported elsewhere. Be warned that it may not function correctly on your system, depending on what BSD expects of a getty vs. what Tandy Xenix expects. defopen() and defread() comprise a simple global environment. defopen() opens the named file (Xenix convention is that defopen() files live in the /etc/default directory) and saves the file descriptor for defread(). Any open defopen() file is closed before the new file is opened. defread() looks for lines beginning with the string passed to it and returns a pointer to the rest of the line. An example (mirroring an actual use, although this better not be the actual code!) follows: /etc/default/mail: SPOOLONLY=yes mail.c: ... defopen("/etc/default/mail"); if ((cp = defread("SPOOLONLY=")) == (char *) 0 || strcmp(cp, "yes")) execl("/usr/lib/uucp/uucico", "UUCICO", "-r1", (char *) 0); ++Brandon -- Brandon S. Allbery | "Given its constituency, the only uunet!marque,sun!mandrill}!ncoast!allbery | thing I expect to be "open" about Delphi: ALLBERY MCI Mail: BALLBERY | [the Open Software Foundation] is comp.sources.misc: ncoast!sources-misc | its mouth." --John Gilmore