ENOTTY error when executing cp(1)

Amos Shapir amos at taux01.UUCP
Wed Sep 13 00:51:39 AEST 1989


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 at taux01.nsc.com or amos at 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)



More information about the Comp.unix.wizards mailing list