From: utzoo!decvax!harpo!seismo!rlgvax!guy Newsgroups: net.unix-wizards Title: Re: printf(3) as a system call? Article-I.D.: rlgvax.207 Posted: Sat Apr 9 00:16:31 1983 Received: Sun Apr 10 01:05:20 1983 References: ariel.276 unc.4910 printf should probably not be a system call, because things should only be system calls if: 1) it requires kernel privileges, 2) you get a significant performance improvement, or 3) the code *really* wants access to kernel data structures and becomes massively kludgy if it has to run in user mode. The better way to handle "printf" is to implement shared libraries in UNIX, but shared libraries are a pain in the neck (the code would either have to have its references to external data resolved by the "exec" system call or would have to reference all such data through an indirect pointer). The 16032 has a "module table" and a "module pointer" register like the stack and frame pointers, which points to a given object module's static/global data, which solves 90% of the problem (the other 10% is references by a routine in a library to a user-supplied routine or global area). A *lot* of operating systems seem to have the idea that anything that could be considered a service routine for user code belongs as a system call; things like printf, ctime, etc. The "real" solution, of course, is to have a domain-oriented protection system (or *no* protection system, like Xerox's Pilot OS), and make all system calls library routines! Of course, this works only with the right hardware... Guy Harris RLG Corporation {seismo,mcnc,we13}!rlgvax!guy