Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!decwrl!nsc!taux01!amos From: amos@taux01.UUCP (Amos Shapir) Newsgroups: comp.unix.wizards Subject: Re: ENOTTY error when executing cp(1) Message-ID: <2556@taux01.UUCP> Date: 12 Sep 89 14:51:39 GMT References: <507@fdmetd.uucp> Organization: National Semiconductor (IC) Ltd, Israel Home of the 32532 Lines: 15 Hdate: 12 Elul 5749 There's a combination of two common errors here: 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. 2. Despite its name, system() is not a system call, but a routine; its return value is the shell's exit status, which is usually specific to the command it runs. Errno has nothing to do with it. RTFM. -- Amos Shapir amos@taux01.nsc.com or amos@nsc.nsc.com National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel Tel. +972 52 522261 TWX: 33691, fax: +972-52-558322 34 48 E / 32 10 N (My other cpu is a NS32532)