Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.wizards Subject: Re: ENOTTY error when executing cp(1) Message-ID: <11056@smoke.BRL.MIL> Date: 13 Sep 89 19:02:19 GMT References: <507@fdmetd.uucp> <2556@taux01.UUCP> <301@6sigma.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <301@6sigma.UUCP> blm@6sigma.UUCP (Brian Matthews) writes: >Is it guarenteed anywhere that errno is left untouched if a system call >succeeds? This isn't guaranteed in any "standard" (SVID, POSIX, whatever), partly because some apparent "system calls" may actually be implemented as library functions that perform other real system calls to get the job done, and some of those subordinate system calls may set errno as a side effect without the overall emulated system call failing. To require that errno remain untouched would force such implementations to continually save and restore its value, a lot of work for no real gain. You should only inspect errno when it is documented to contain a valid value.