From owner-freebsd-current Thu Dec 10 22:08:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA20351 for freebsd-current-outgoing; Thu, 10 Dec 1998 22:08:52 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA20346; Thu, 10 Dec 1998 22:08:49 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id WAA09469; Thu, 10 Dec 1998 22:07:04 -0800 (PST) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma009463; Thu, 10 Dec 98 22:06:52 -0800 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id WAA22141; Thu, 10 Dec 1998 22:06:52 -0800 (PST) From: Archie Cobbs Message-Id: <199812110606.WAA22141@bubba.whistle.com> Subject: Re: mformat in free(): warning: junk pointer, too high to make sense. In-Reply-To: <2923.913355388@zippy.cdrom.com> from "Jordan K. Hubbard" at "Dec 10, 98 09:49:48 pm" To: jkh@zippy.cdrom.com (Jordan K. Hubbard) Date: Thu, 10 Dec 1998 22:06:52 -0800 (PST) Cc: eivind@yes.no, vallo@matti.ee, current@FreeBSD.ORG, dg@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jordan K. Hubbard writes: > > > As for the inetd problem: We know what it is, we have a fix, and David > > > Greenman seems to be vetoing committing it due to its "inelegance". > > > > So let's see his version. > > Why doesn't someone just commit it? David's already in hot water over > his filesystem destroying fragmentation changes and I don't think > anyone will side with him if you just bring the inetd change into > -current at this point. :-) :-) Well, this brings up an unrelated question. I've written a little library that comes in very handy in situations like this (I have heard there are similar things out there but this was a custom job). Basically, it allows you to write an event driven program, where each event is handled atomically from all others, without resorting to threads and libc_r. An event is a file descriptor read/write condition, a timer timeout, or a signal receipt. The header file looks like this.. /* Types of events */ enum { EVENT_READ, /* value = file descriptor */ EVENT_WRITE, /* value = file descriptor */ EVENT_EXCEPTION, /* value = file descriptor */ EVENT_TIMEOUT, /* value = time in miliseconds */ EVENT_SIGNAL, /* value = signal number */ EVENT_USER, /* value = user defined */ }; typedef u_int EventRef; typedef void (*EventHdlr)(int type, void *cookie); /* Register a new event */ extern int EventRegister(EventRef *ref, int type, int value, int prio, EventHdlr action, void *cookie); /* Unregister a pending event */ extern int EventUnRegister(EventRef *ref); /* Check if an event is pending */ extern int EventIsRegistered(EventRef ref); /* Check time remaining on a timeout event */ extern int EventTimerRemain(EventRef ref); /* Trigger a user defined event */ extern int EventUserEvent(int value); /* Begin servicing events */ extern int EventStart(void); /* Stop servicing events */ extern void EventStop(void); Is this something possibly worth it's own little library? I'd be willing to refine it and write a man page. Then maybe the inetd problem could be solved more 'elegantly'. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message