delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/12/29/00:16:49

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=OrBl5/tbDcAHJROgnzLazrcGg/Ju18EgranWzv5bqUGMSzB54DFqL
KSZD+E+T6bj7O3pMsisacnTwFhiZim9OXg4son1+hK/gYsZOFIBjJCYNHNcJZKKd
vaG622Kvd7hbkrJtt3j3YA5K6c7j1r0ZY94oU5kg/Tb7DDHqM24v8M=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=JT3+uGwgFrH1QjHWiRSzXWHWg5c=; b=mBAr5ci2SOOaKBb0Y6gMTOU7uDL4
nc6Ml33eSR7XMOYF0mAjDQlV6PMaRtWXmgMdSzyFgJct0/sqq7ed2KviEggOBlNe
o6e8lgIEV+T/mWwxVLpqWI4crYIcIpDEjv9gOFGTl2i3uQMWOYHxNaPWP9mg0bJb
lbG+pPqIPFmB4ME=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=pardon, H*f:6YU5bgvKp2ENv, H*f:CALiPeun3v, UD:Brian.Inglis
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: Issues in utmp/utmpx headers
Date: Tue, 29 Dec 2015 05:16:17 +0000 (UTC)
Lines: 38
Message-ID: <loom.20151229T054517-919@post.gmane.org>
References: <CALiPeumt3nnNr=6P_p7WUUy1QHk6CBHXpv0i36Y3QanqoN3DbQ AT mail DOT gmail DOT com> <loom DOT 20151227T200026-993 AT post DOT gmane DOT org> <CALiPeun3v+vME=6YU5bgvKp2ENv+csuLLSdKu5Jj0T9x66eQjw AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

> > David Lee <mailtolky <at> gmail.com> writes:
> >> While trying to port bsdgames to Cygwin I spotted the following issues:
> >> (1) In /usr/include/utmpx.h, utmpxname() is declared a void function.
> >> Should it return int?
> >> (2) In /usr/include/sys/utmp.h, utmpname() is declared a void
> >> function. Should it return int?
> >> (3) _PATH_UTMPX is not defined in any system headers.

> On 28 December 2015 at 03:02, Brian Inglis
> <Brian.Inglis <at> systematicsw.ab.ca> wrote:
> > Search packages for missing files e.g.
> > https://cygwin.com/cgi-bin2/package-grep.cgi?grep=utmp.h&arch=x86_64
> > brings up package cygwin-devel and cygwin32.
> > Download and run setup and select cygwin-devel to install the headers and
> > libraries.

David Lee <mailtolky <at> gmail.com> writes:
> The issue isn't missing, not-installed packages. The issues are (1)
> some function declaration seem wrong; and (2) a constant is missing.

Pardon my reading comprehension bork! 

The utmpname implementation in newlib-cygwin/winsup/cygwin/syscalls.cc
could probably be improved to: avoid a memory leak; return -1 if 
strdup fails, zero otherwise; default the path if a null pointer or string
argument is passed. 
That would also fix utmpxname which is an alias.
Such a change would have little likely impact on downstream apps, but could
produce warnings about ignoring return values. 

Unfortunately there appears to be no standard defined names to access the
default file name although GNU and Cygwin provide UTMP_FILE and UTMPX_FILE;
GNU also provide UTMP_FILENAME and UTMPX_FILENAME. 
_PATH_UTMP and _PATH_UTMPX are implementation reserved names which may or
may not be provided, though adding the latter in paths.h would be trivial. 

As the developers say, patches always welcome. 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019