Path: utzoo!utgpu!watserv1!watmath!att!rutgers!dimacs.rutgers.edu!seismo!uunet!world!bzs From: bzs@world.std.com (Barry Shein) Newsgroups: comp.unix.internals Subject: Re: Trojan Horses Message-ID: Date: 18 Oct 90 01:57:07 GMT References: <1990Oct7.155203.13283@hq.demos.su> <18578@rpp386.cactus.org> <3173@unisoft.UUCP> Sender: bzs@world.std.com (Barry Shein) Organization: The World Lines: 16 In-Reply-To: greywolf@unisoft.UUCP's message of 17 Oct 90 22:12:34 GMT >I wonder, incidentally, why does close() return something? Is it just that >it's a system call? What checks for close()'s return value? I could see it >being used for security checks and such, I suppose (verifying that "fd %d >had to be closed -- CHECK THIS"). Trying to close a closed file descriptor will cause -1 to be returned and errno set to EBADF. Close can also be interrupted (EINTR), I would guess that's most likely to happen with socketio. These are conditions a program might want to check for, even if (in the first case) just to check for logic bugs in the program. -- -Barry Shein Software Tool & Die | {xylogics,uunet}!world!bzs | bzs@world.std.com Purveyors to the Trade | Voice: 617-739-0202 | Login: 617-739-WRLD