Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!caen!ox.com!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.programmer Subject: Re: Checking return values (was: Trojan Horses, NFS, etc.) Message-ID: <8215:Oct2521:30:3890@kramden.acf.nyu.edu> Date: 25 Oct 90 21:30:38 GMT References: <4315@pkmab.se> <1990Oct24.193712.8693@athena.mit.edu> <1990Oct25.075856.4923@robobar.co.uk> Organization: IR Lines: 11 In article <1990Oct25.075856.4923@robobar.co.uk> ronald@robobar.co.uk (Ronald S H Khoo) writes: > perror(name); > fprintf(stderr, "%s: error opening %s (see error message above)\n", > progname, name); Correct but ugly. As long as you have an array sys_errlist[] with the messages, you can just copy errno into a variable and use that. To skip coding most of the common idioms you might snarf err.c from the pty package. ---Dan