ENOTTY error when executing cp(1)

Brian Matthews blm at 6sigma.UUCP
Wed Sep 13 16:36:00 AEST 1989


In article <2556 at taux01.UUCP> amos at taux01.UUCP (Amos Shapir) writes:
|1. Errno is meaningful only after a system call fails; ENOTTY is usually
|  generated in the normal course of starting up stdio.  To make sure
|  its value is relevant, always clear errno before doing a system call.

Is it guarenteed anywhere that errno is left untouched if a system call
succeeds?  I couldn't find it.  Intro(2) (in my System V manuals) states:

    "Errno is not cleared on successful calls, so it should be tested
     only after an error has been indicated."

The second half of that sentence says to me that errno may be modified
even if the system call succeeds, so relying on errno staying zero is
a Bad Thing.  But the first half of the sentence seems to talk about
clearing errno on success, so the second half might not say anything
about whether errno is modified on success.
-- 
Brian L. Matthews			blm at 6sigma.UUCP
Six Sigma CASE, Inc.			+1 206 854 6578
PO Box 40316, Bellevue, WA  98004



More information about the Comp.unix.wizards mailing list