Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 20 Jul 2002 12:41:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 20 Jul 2002 12:41:59 -0400 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:47881 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Sat, 20 Jul 2002 12:41:58 -0400 Date: Sat, 20 Jul 2002 09:45:40 -0700 (PDT) From: Linus Torvalds To: Florian Weimer cc: "David S. Miller" , Subject: Re: close return value In-Reply-To: <8765zazv5r.fsf@CERT.Uni-Stuttgart.DE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1100 Lines: 32 On Sat, 20 Jul 2002, Florian Weimer wrote: > > Returning an error and still doing the operation is slightly awkward. > Are there any other syscalls which do similar things? mmap(MAP_FIXED) may have already unmapped any underlying old area if an error occurs. And EFAULT may have strange behaviour for left-over stuff. If I remember correctly, at some point, for example, EFAULT on a write to a TCP socket (if the fault happened in the middle) would still send out the full-sized packet zero-padded, because not doing so would have screwed up the state machine. (But EFAULT is a special case in general, it's documented to be undefined behaviour). I can't think of any others, but at least close() isn't _completely_ alone. And as you say, we really cannot change it anyway, even if we wanted to (which I'm personally convinced we do not). Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/