LIBRETRO(UCB) — UNIX Programmer’s Manual
NAME
libretro − library to fit version 7 programs on version 6 systems
SYNOPSIS
cc −I/usr/include/retrofit ... -lretro -lS
#include <retrofit.h>
int getuid();
#include <sgtty.h>
stty(unit, buf)
struct sgttyb *buf;
gtty(unit, buf)
struct sgttyb *buf;
#include <sys/types.h>
#include <sys/stat.h>
stat(name, stbuf)
char *name;
struct stat *stbuf;
fstat(name, stbuf)
char *name;
struct stat *stbuf;
char *
getenv(name)
char *name;
isatty(unit)
int unit;
wait(status)
int *status;
DESCRIPTION
These implement version 7 functions on version 6 systems.
Getuid returns just the real user id; the high 8 bits are thus normally clear. Stty and gtty perform the normal operations, but rearrange the expand tabs bit into “tab3” delay as version 7 does.
Stat and fstat maps a version 6 stat into the version 7 structure.
Getenv can be called with “HOME” to return the home directory of the real user, or “TERM” to return a string giving the terminal type in use. It returns 0 for everything else.
Isatty tells whether the specified unit is attaches to a terminal.
Wait does not call nargs so it will work separate i/d.
This library also defines “_ctype” as in stdio, but fixed so that end-of-file (−1) has the correct attributes (as it does in version 7), and contains the htmp routines used to fake getenv.
FILES
/usr/include/retrofitroot for header files
/etc/htmpdata base for getenv
SEE ALSO
UNIX Programmers manual, version 7.
AUTHOR
William Joy
BUGS
7th Edition — 4/8/79