public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Issues in utmp/utmpx headers
Date: Tue, 29 Dec 2015 05:16:00 -0000	[thread overview]
Message-ID: <loom.20151229T054517-919@post.gmane.org> (raw)
In-Reply-To: <CALiPeun3v+vME=6YU5bgvKp2ENv+csuLLSdKu5Jj0T9x66eQjw@mail.gmail.com>

> > 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

  reply	other threads:[~2015-12-29  5:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27  2:58 David Lee
2015-12-27 19:02 ` Brian Inglis
2015-12-28  3:24   ` David Lee
2015-12-29  5:16     ` Brian Inglis [this message]
2016-01-04  3:11       ` David Lee
2016-01-04 18:31         ` Brian Inglis
2016-01-07 14:43       ` Corinna Vinschen
2016-01-07 14:41 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20151229T054517-919@post.gmane.org \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).