This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Issues in utmp/utmpx headers

Sorry I am totally unfamiliar with Cygwin internals, here are some
related questions:

1. how does one test a code path that involves a failed syscall
(strdup() in this case, but can be others) in cygwin dll?

2. If the call to strdup() fails, I want to debug_print() the errno
value set by strdup(). Do I have to save errno before debug_print()
that and restore afterwards?

3. Does the instruction from 6.21 in

   generates a debugging dll (i.e. contains debug symbols usable by
gdb)? If not, what modifications are needed to create one?


On 29 December 2015 at 13:16, Brian Inglis
<> wrote:
>> > David Lee <mailtolky <at>> 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>> wrote:
>> > Search packages for missing files e.g.
>> >
>> > 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>> 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/
> 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;
> _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:
> FAQ:         
> Documentation:
> Unsubscribe info:

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]