X-Spam-Check-By: sourceware.org Date: Mon, 18 Dec 2006 10:43:12 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: wtmpx support Message-ID: <20061218094312.GC8345@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <45860BAA DOT 6080505 AT cwilson DOT fastmail DOT fm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45860BAA.6080505@cwilson.fastmail.fm> User-Agent: Mutt/1.4.2.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Dec 17 22:31, Charles Wilson wrote: > I think that winsup/cygwin/include/utmpx.h should include the following > definition, similar to the existing one for UTMPX_FILE: > > #define WTMPX_FILE _PATH_WTMP > > I'm hitting a compile error in rxvt-unicode: > > # if defined(HAVE_STRUCT_UTMPX) && defined(HAVE_UPDWTMPX) > updwtmpx (WTMPX_FILE, utx); > # endif > > > Both HAVE_STRUCT_UTMPX and HAVE_UPDWTMPX are true, so I think we ought > also to have WTMPX_FILE. Since cygwin's utmp/wtmp file formats seem to > be arranged so that they can be opened and used without error by > functions that expect to populate either struct utmp OR struct utmpx, we > can use _PATH_UTMP for UTMP_FILE and UTMPX_FILE interchangeably -- that > part is already in cygwin's code. The same logic, I think, holds for > _PATH_WTMP, WTMP_FILE, and WTMPX_FILE. > > Hence the requested #define, above. I was going to do that at one point but I had a reason not to. When I created the utmpx/wtmpx handling, I intended to keep backward compatible with the existing utmp and wtmp files. So the utmpx/wtmpx functions are only wrappers around the utmp/wtmp functions and the file format is that of utmp/wtmp. Unfortunately there are applications which access the wtmp file manually, namely tools to inspect the content, for instance, last(1). If the WTMPX_FILE define is present, last tries to read this file in wtmpx format and fails. A couple of weeks ago I started to switch Cygwin to the wtmpx format but the problem is the same, just backwards. The only way I see to keep backwards compatibility while switching to a new format is to use new files /var/log/utmpx and /var/run/wtmpx. In theory, this should only require to rebuild the inspection tools like last. But it wouldn't be a nice transition, rather a cut. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/