From owner-freebsd-hackers Thu Jul 15 20:47:47 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from janus.syracuse.net (janus.syracuse.net [205.232.47.15]) by hub.freebsd.org (Postfix) with ESMTP id 5865714FE8 for ; Thu, 15 Jul 1999 20:47:45 -0700 (PDT) (envelope-from green@FreeBSD.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.2/8.8.7) with ESMTP id XAA49176; Thu, 15 Jul 1999 23:45:29 -0400 (EDT) X-Authentication-Warning: janus.syracuse.net: green owned process doing -bs Date: Thu, 15 Jul 1999 23:45:29 -0400 (EDT) From: "Brian F. Feldman" X-Sender: green@janus.syracuse.net To: Matthew Dillon Cc: Andrew Reilly , "Daniel C. Sobral" , lyndon@orthanc.ab.ca, freebsd-hackers@FreeBSD.org Subject: Re: Swap overcommit In-Reply-To: <199907160300.UAA14677@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 15 Jul 1999, Matthew Dillon wrote: > > The are dozens of libc routines which call malloc internally and return > allocated storage. strdup(), opendir(), fopen(), setvbuf(), asprintf(), > and so forth. Dozens. And while we might check some of these for NULL, > we don't check them all, and the ones we do check we tend to conclude > a failure other then a memory failure. We would assume that the directory > or file does not exist, for example. How many programmers check errno > after such a failure? Very few. How many programmers bother to even > *clear* errno before making these calls (since some system calls do not ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We're not supposed to have to clear errno unless we have to explicitly test if it has changed. We're not supposed to clear it before any system call which could possibly fail and set errno. > set errno if it already non-zero). Virtually nobody. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Erm... WTF?!?! If so, why the HELL are we doing that?!? > > -Matt > Matthew Dillon > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Brian Fundakowski Feldman _ __ ___ ____ ___ ___ ___ green@FreeBSD.org _ __ ___ | _ ) __| \ FreeBSD: The Power to Serve! _ __ | _ \._ \ |) | http://www.FreeBSD.org/ _ |___/___/___/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message