]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
5 months agoCygwin: (mostly) drop NT4 and Samba < 3.0 support
Corinna Vinschen [Wed, 20 Mar 2024 11:31:12 +0000 (12:31 +0100)]
Cygwin: (mostly) drop NT4 and Samba < 3.0 support

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: dirent.h: fix a comment
Corinna Vinschen [Tue, 19 Mar 2024 22:21:35 +0000 (23:21 +0100)]
Cygwin: dirent.h: fix a comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: readdir(3): stop support for pre-Cygwin 1.5.0 apps
Corinna Vinschen [Tue, 19 Mar 2024 15:22:40 +0000 (16:22 +0100)]
Cygwin: readdir(3): stop support for pre-Cygwin 1.5.0 apps

We're filling dirent::__d_internal1 with the inode number to
support apps built under Cygwin 1.3 and earlier.  This doesn't
make sense anymore.  Drop this to free up __d_internal1 for
other TBD use.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agowinsup/cygwin/fhandler/proc.cc: format_proc_cpuinfo() Linux 6.8 cpuinfo flags
Brian Inglis [Sat, 16 Mar 2024 16:44:00 +0000 (10:44 -0600)]
winsup/cygwin/fhandler/proc.cc: format_proc_cpuinfo() Linux 6.8 cpuinfo flags

add Linux 6.8 cpuinfo flags:
Intel 0x00000007:1 eax:17 fred Flexible Return and Event Delivery;
AMD   0x8000001f   eax:4  sev_snp SEV secure nested paging;
document unused and some unprinted bits that could look like omissions;
fix typos and misalignments;

Signed-off-by: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
5 months agoRevert "Cygwin: glob: perform ignore_case_with_glob on input"
Corinna Vinschen [Mon, 18 Mar 2024 09:50:30 +0000 (10:50 +0100)]
Revert "Cygwin: glob: perform ignore_case_with_glob on input"

This reverts commit a51147467e6cf58618433286f93d17043e00b0fc.

Dumb thinko on my part.  What was supposed to be an optimization
actually broke caseinsensitive globbing in that the entire input
of globbed expressions were downcased.

Drop the unused CCHAR() macro nevertheless.

Fixes: a51147467e6cf ("Cygwin: glob: perform ignore_case_with_glob on input")
Reported-by: Michael Goldshteyn <mgold10000@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agolibc/include/sys/select.h: Use elif not elifdef
Joel Sherrill [Wed, 13 Mar 2024 14:29:36 +0000 (09:29 -0500)]
libc/include/sys/select.h: Use elif not elifdef

The cpp directive "elifdef" is only available in very recent GCC versions.
This should be able to compile on older toolchains in C99 mode.`

5 months agoRTEMS: Increase FS_SETSIZE to 256 bits
Chris Johns [Tue, 20 Feb 2024 00:46:05 +0000 (11:46 +1100)]
RTEMS: Increase FS_SETSIZE to 256 bits

5 months agoCygwin: pipe: Make sure to set read pipe non-blocking for cygwin apps.
Takashi Yano [Mon, 11 Mar 2024 13:08:00 +0000 (22:08 +0900)]
Cygwin: pipe: Make sure to set read pipe non-blocking for cygwin apps.

If pipe reader is a non-cygwin app first, and cygwin process reads
the same pipe after that, the pipe has been set to bclocking mode
for the cygwin app. However, the commit 9e4d308cd592 assumes the
pipe for cygwin process always is non-blocking mode. With this patch,
the pipe mode is reset to non-blocking when cygwin app is started.

Addresses: https://cygwin.com/pipermail/cygwin/2024-March/255644.html
Fixes: 9e4d308cd592 ("Cygwin: pipe: Adopt FILE_SYNCHRONOUS_IO_NONALERT flag for read pipe.")
Reported-by: wh <wh9692@protonmail.com>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
5 months agoCygwin: 3.6.0: add release entries for pinned/unpinned flag handling
Corinna Vinschen [Mon, 11 Mar 2024 11:53:50 +0000 (12:53 +0100)]
Cygwin: 3.6.0: add release entries for pinned/unpinned flag handling

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: add 3.5.2 release entries for latest commits
Corinna Vinschen [Mon, 11 Mar 2024 11:53:24 +0000 (12:53 +0100)]
Cygwin: add 3.5.2 release entries for latest commits

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: getgrent: don't skip SAM-only builtin-accounts
Corinna Vinschen [Mon, 11 Mar 2024 11:38:39 +0000 (12:38 +0100)]
Cygwin: getgrent: don't skip SAM-only builtin-accounts

Since commit 15e82eef3a40b ("Cygwin: getgrent: fix local SAM enumeration
on domain member machines") we skip enumerating local BUILTIN accounts
if we also enumerate AD.  However, there are two local accounts which
are only available in local SAM, not in AD.  Don't skip enumerating
those.

Fixes: 15e82eef3a40b ("Cygwin: getgrent: fix local SAM enumeration on domain member machines")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agolibc/stdio: Remove wchar_t functions from NEWLIB_NANO_FORMATTED_IO
Torbjörn SVENSSON [Sat, 9 Mar 2024 08:15:17 +0000 (09:15 +0100)]
libc/stdio: Remove wchar_t functions from NEWLIB_NANO_FORMATTED_IO

Regression tested in basepoints/gcc-14-9032-g945cb8490cb with arm-none-eabi.

Example failure without this change:
$ arm-none-eabi-g++ .../pr100611.C -std=c++20 --specs=nosys.specs -o /dev/null --specs=nano.specs
.../ld: .../libc_nano.a(libc_a-svfwprintf.o): in function `_svfwprintf_r':
(.text._svfwprintf_r+0xd8): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x834): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x85c): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x8a8): undefined reference to `__ssputws_r'
.../ld: (.text._svfwprintf_r+0x8dc): undefined reference to `__ssputws_r'
.../ld: .../libc_nano.a(libc_a-svfwprintf.o):(.text._svfwprintf_r+0x900): more undefined references to `__ssputws_r' follow
collect2: error: ld returned 1 exit status

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Co-authored-by: Yvan ROUX <yvan.roux@foss.st.com>
5 months agoCygwin: FS_IOC_[GS]ETFLAGS: handle pinned and unpinned attributes
Corinna Vinschen [Fri, 8 Mar 2024 20:54:58 +0000 (21:54 +0100)]
Cygwin: FS_IOC_[GS]ETFLAGS: handle pinned and unpinned attributes

Add FS_PINNED_FL and FS_UNPINNED_FL flags and handle them with
mode bits 'p' and 'u' in chattr(1) and lsattr(1).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: get/set security descriptors using FILE_OPEN_NO_RECALL
Corinna Vinschen [Fri, 8 Mar 2024 20:30:57 +0000 (21:30 +0100)]
Cygwin: get/set security descriptors using FILE_OPEN_NO_RECALL

Add FILE_OPEN_NO_RECALL to NtOpenFile calls trying to fetch
or write file security descriptors so as not to recall them
from offline storage inadvertently.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: try to avoid recalling offline files
Corinna Vinschen [Fri, 8 Mar 2024 19:57:06 +0000 (20:57 +0100)]
Cygwin: try to avoid recalling offline files

Chances are high that Cygwin recalls offline files from remote
storage, even if the file is only accessed during stat(2) or
readdir(3).

To avoid this
- make sure Cygwin is placeholder-aware,
- open files in path_conv handling, as well as in stat(2)/readdir(3)
  scenarios with FILE_OPEN_NO_RECALL, and
- during symlink checking or testing for executablility, don't even
  try to open the file if one of the OFFLINE attributes is set.

Reported-by: Marcin Wisnicki <mwisnicki@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: move EXPORT_ALIAS expressions to end of source
Corinna Vinschen [Thu, 7 Mar 2024 20:50:07 +0000 (21:50 +0100)]
Cygwin: move EXPORT_ALIAS expressions to end of source

This isn't strictly required, but it avoids confusion in ctags.
Ctags fails to record the next function or method following the
EXPORT_ALIAS expression.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: pipe: Simplify chhecking procedure of query_hdl.
Takashi Yano [Tue, 5 Mar 2024 14:34:21 +0000 (23:34 +0900)]
Cygwin: pipe: Simplify chhecking procedure of query_hdl.

This patch eliminates verbose NtQueryObject() calls in the procedure
to get query_hdl by storing pipe name into fhandler_base::pc when
the pipe is created.  fhandler_pipe::temporary_query_hdl() uses the
storedpipe name rather than the name retrieved by NtQueryObject().

Suggested-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
5 months agoCygwin: pipe: Give up to use query_hdl for non-cygwin apps.
Takashi Yano [Sun, 3 Mar 2024 04:44:17 +0000 (13:44 +0900)]
Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

Non-cygwin app may call ReadFile() for empty pipe, which makes
NtQueryObject() for ObjectNameInformation block in fhandler_pipe::
get_query_hdl_per_process. Therefore, do not to try to get query_hdl
for non-cygwin apps.

Addresses: https://github.com/msys2/msys2-runtime/issues/202

Fixes: b531d6b06eeb ("Cygwin: pipe: Introduce temporary query_hdl.")
Reported-by: Alisa Sireneva, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
5 months agoCygwin: console: Fix a race issue between close() and open().
Takashi Yano [Mon, 4 Mar 2024 02:32:34 +0000 (11:32 +0900)]
Cygwin: console: Fix a race issue between close() and open().

The open() call for console sometimes fails if the console owner
process is closing the console by close() at the same time. This
is due to mismatch state of con.owner variable and attaching state
to the console. With this patch, checking con.owner and attaching
to con.owner sequence in open(), and resetting con.owner and freeing
console sequence in close() are guarded by output_mutex to avoid
such a race issue.
Addresses: https://cygwin.com/pipermail/cygwin/2024-March/255575.html

Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Reported-by: Kate Deplaix <kit-ty-kate@outlook.com>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
5 months agoCygwin: cygheap: compute bucket instead of looping over it
Corinna Vinschen [Fri, 1 Mar 2024 21:27:40 +0000 (22:27 +0100)]
Cygwin: cygheap: compute bucket instead of looping over it

Start at index 0 and use 32 bytes as minimal allocation size.
Reduce NBUCKETS, we don't have such big objects on the
cygheap anyway.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: cygheap: use SRWLOCK for cygheap locking
Corinna Vinschen [Fri, 1 Mar 2024 21:24:37 +0000 (22:24 +0100)]
Cygwin: cygheap: use SRWLOCK for cygheap locking

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: posix_getdents: do not clear attached DIR structure at fork(2)
Corinna Vinschen [Fri, 1 Mar 2024 14:31:57 +0000 (15:31 +0100)]
Cygwin: posix_getdents: do not clear attached DIR structure at fork(2)

The upcoming POSIX issue 8 will require that posix_getdents after
fork() will pick up at the right spot, independently of being
called in the parent or in the child process.  Remove the expression
clearing out the attached DIR after fork.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: lseek: improve seeking posix_getdents descriptors
Corinna Vinschen [Fri, 1 Mar 2024 14:16:44 +0000 (15:16 +0100)]
Cygwin: lseek: improve seeking posix_getdents descriptors

Transfer code lseeking on posix_getdents() directory descriptor
into its own static function and rework it so SEEK_END, SEEK_DATA
and SEEK_HOLE work here as expected, too.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: console: Do not unmap shared console memory belonging to ctty.
Takashi Yano [Fri, 1 Mar 2024 10:05:36 +0000 (19:05 +0900)]
Cygwin: console: Do not unmap shared console memory belonging to ctty.

In the condition that console setup for CTTY and close run at the
sametime, accessing shared console memory which is already unmapped
may occur. With this patch, to avoid this race issue, shared console
memory which belongs to contorolling terminal (CTTY) is kept mapped
as before.
Addresses: https://cygwin.com/pipermail/cygwin/2024-February/255561.html

Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Reported-by: Kate Deplaix <kit-ty-kate@outlook.com>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
5 months agoCygwin: set ENOSHARE and ECASECLASH _sys_errlist[] entries to empty
Christian Franke [Tue, 27 Feb 2024 16:21:45 +0000 (17:21 +0100)]
Cygwin: set ENOSHARE and ECASECLASH _sys_errlist[] entries to empty

These errno values are no longer used by Cygwin.  Change the entries
to empty strings instead of NULL to avoid crashes in existing
binaries directly accessing the table.  Enhance strerror_worker()
such that empty strings also result in "Unknown error ..." messages.
Also add a static_assert check for the _sys_errlist[] size.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: add compile warning if ENOSHARE or ECASECLASH is used
Christian Franke [Tue, 27 Feb 2024 12:03:08 +0000 (13:03 +0100)]
Cygwin: add compile warning if ENOSHARE or ECASECLASH is used

These errno values are no longer used by Cygwin.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: add release text for getgrent local SAM enumeration patch
Corinna Vinschen [Mon, 26 Feb 2024 09:15:06 +0000 (10:15 +0100)]
Cygwin: add release text for getgrent local SAM enumeration patch

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: errmap[]: update comments using current winerror.h
Christian Franke [Mon, 26 Feb 2024 14:15:18 +0000 (15:15 +0100)]
Cygwin: errmap[]: update comments using current winerror.h

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: errmap[]: add error numbers to /* ERROR_... */ comments
Christian Franke [Mon, 26 Feb 2024 13:29:45 +0000 (14:29 +0100)]
Cygwin: errmap[]: add error numbers to /* ERROR_... */ comments

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: errmap[]: reduce value size from 32 to 8 bits
Christian Franke [Mon, 26 Feb 2024 13:01:54 +0000 (14:01 +0100)]
Cygwin: errmap[]: reduce value size from 32 to 8 bits

Overflow would be detected at compile time.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: introduce constexpr errmap_size and errmap[] consistency checks
Christian Franke [Mon, 26 Feb 2024 12:37:33 +0000 (13:37 +0100)]
Cygwin: introduce constexpr errmap_size and errmap[] consistency checks

Use constexpr instead of const for errmap[] to allow static_assert
checks on its values.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV
Christian Franke [Fri, 23 Feb 2024 18:01:09 +0000 (19:01 +0100)]
Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV

If a removable (USB) device is disconnected after opening its raw
device, R/W attempts fail with ERROR_NO_SUCH_DEVICE(433).  If the
raw device of a partition is used, ERROR_MEDIA_CHANGED(1110) is
returned instead.  Both are mapped to ENODEV(19) because <errno.h>
does not offer a value which better matches ERROR_MEDIA_CHANGED.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
5 months agoCygwin: add newgrp release notes
Corinna Vinschen [Sat, 24 Feb 2024 12:12:00 +0000 (13:12 +0100)]
Cygwin: add newgrp release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: newgrp: only allow group from supplementary group list
Corinna Vinschen [Sat, 24 Feb 2024 11:59:28 +0000 (12:59 +0100)]
Cygwin: newgrp: only allow group from supplementary group list

Windows only allows to set the primary group to a group already
present in the TOKEN_GROUP list.  Cygwin OTOH fakes success at
setgid() time, to allow a subsequent call to setuid() to do
the actual account switching.  To have a sane behaviour in the
command line tool, check group membership and disallow to switch
to groups other than those already present in the user token.

Fixes: 8bd56ec873453 ("Cygwin: newgrp: first full version")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoCygwin: newgrp: fix invalid usage of argv
Corinna Vinschen [Sat, 24 Feb 2024 09:46:54 +0000 (10:46 +0100)]
Cygwin: newgrp: fix invalid usage of argv

Fix an error message accessing argv[1] even after it has been
potentially moved.  Print group name from group DB instead.

Fixes: 8bd56ec873453 ("Cygwin: newgrp: first full version")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
5 months agoRTEMS: Define ssize_t for <dirent.h>
Sebastian Huber [Mon, 12 Feb 2024 19:10:26 +0000 (20:10 +0100)]
RTEMS: Define ssize_t for <dirent.h>

This fixes the following build issue:

newlib/libc/include/dirent.h:84:1: error: unknown type name 'ssize_t'; did you mean '_ssize_t'?
   84 | ssize_t posix_getdents(int, void *, size_t, int);
      | ^~~~~~~
      | _ssize_t

6 months agoCygwin: strptime: add release note
Corinna Vinschen [Wed, 21 Feb 2024 19:00:29 +0000 (20:00 +0100)]
Cygwin: strptime: add release note

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: strptime: fix am/pm handling
Corinna Vinschen [Wed, 21 Feb 2024 18:54:20 +0000 (19:54 +0100)]
Cygwin: strptime: fix am/pm handling

The %p format specifier is handled immediately.  It requires
that tm_hour is already set.  This falls flat in case the am/pm
marker preceeds the time specification.  Locales with am/pm
marker preceeding time spec by default exist (e. g. ko_KR).

Also, the code expects that tm_hour might be set to an invalid
value because the %p specifier is used in conjunction with %H.
But this usage is invalid in itself and now catched as error
condition after commit 343a2a558153 ("Cygwin: strptime: make
sure to fail on invalid input digits").

Change the %H/%I/%p handling according to GLibC, i. e.

- fix tm_hour for pm only if the time value has been specified
  as 12 hour time %I, and

- perform the fixup only after the entire input has been scanned.
  This decouples the fixup from the %p position relativ to %I.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: strptime: make sure to fail on invalid input digits
Corinna Vinschen [Wed, 21 Feb 2024 18:39:37 +0000 (19:39 +0100)]
Cygwin: strptime: make sure to fail on invalid input digits

conv_num returns NULL if the input is invalid, e. g., the
numbers are out of range.  However, the code fails to test
this in a lot of places.

Rather than adding checks all over the place, rename conv_num
to __conv_num and create a wrapper macro conv_num to perform
the task of error checking.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agostrptime: fix am/pm converting to 24-hour system
Alexey Lapshin [Tue, 20 Feb 2024 18:51:04 +0000 (18:51 +0000)]
strptime: fix am/pm converting to 24-hour system

Fix the issue of parsing 08:00AM, which currently gives a 20:00 representation.

6 months agoCygwin: getgrent/getpwent: avoid local enumeration on DCs
Corinna Vinschen [Tue, 20 Feb 2024 22:54:25 +0000 (23:54 +0100)]
Cygwin: getgrent/getpwent: avoid local enumeration on DCs

...if we're supposed to enumerate the AD accounts anyway.  This
avoids some useless duplication.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: getgrent: fix local SAM enumeration on domain member machines
Corinna Vinschen [Tue, 20 Feb 2024 22:51:33 +0000 (23:51 +0100)]
Cygwin: getgrent: fix local SAM enumeration on domain member machines

Don't skip output of local SAM groups on domain member machines.
They can have valid, user-defined groups in their SAM.  Just
skip builtin groups if we're enumerating AD as well.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: passwd/group: drop Capability SIDs
Corinna Vinschen [Tue, 20 Feb 2024 16:25:23 +0000 (17:25 +0100)]
Cygwin: passwd/group: drop Capability SIDs

Capability SIDs (S-1-15-3-...) have been introduced with
Windows 10 1909.  They don't resolve with LookupAccountSid.
We don't need them and they don't map gracefully into out
POSIX account namespace.  Also, add code to make sure to
filter them out *iff* they become resolvable at one point.

While at it, slightly reorder code for non-resolving SIDs
by authority values.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: gettimeofday: allow tv NULL pointer
Corinna Vinschen [Tue, 20 Feb 2024 11:30:34 +0000 (12:30 +0100)]
Cygwin: gettimeofday: allow tv NULL pointer

Add a missing check for the struct timeval pointer being NULL.

Reported-by: 109224573 <109224573@qq.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: timespec_get: implement C11 function
Corinna Vinschen [Fri, 16 Feb 2024 19:44:31 +0000 (20:44 +0100)]
Cygwin: timespec_get: implement C11 function

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: pty: Re-fix the last bug regarding nat-pipe.
Takashi Yano [Fri, 16 Feb 2024 09:11:46 +0000 (18:11 +0900)]
Cygwin: pty: Re-fix the last bug regarding nat-pipe.

Fixes: f907b5f405a3 ("Cygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.
Takashi Yano [Fri, 16 Feb 2024 08:15:29 +0000 (17:15 +0900)]
Cygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.

Fixes: a9038789488e ("Cygwin: pty: Additional fix for transferring input at exit.");
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: console: Fix a bug that 64th console cannot be handled.
Takashi Yano [Thu, 15 Feb 2024 18:35:07 +0000 (03:35 +0900)]
Cygwin: console: Fix a bug that 64th console cannot be handled.

Fixes: 930e553da8e9 ("Cygwin: console: Unify EnumWindows() callback functions.");
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: console: Fix a bug that cannot handle consoles more than 32.
Takashi Yano [Thu, 15 Feb 2024 17:37:46 +0000 (02:37 +0900)]
Cygwin: console: Fix a bug that cannot handle consoles more than 32.

Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: console: Unify EnumWindows() callback functions.
Takashi Yano [Wed, 14 Feb 2024 13:57:48 +0000 (22:57 +0900)]
Cygwin: console: Unify EnumWindows() callback functions.

Previously, three similar callback fuctions were used in console
code. This patch unifies these functions to ease maintenance cost.

Fixes: 8aad3a7edeb2 ("Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.")
Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.
Takashi Yano [Wed, 14 Feb 2024 14:10:04 +0000 (23:10 +0900)]
Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.

Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: accommodate gcc -Og option
Corinna Vinschen [Wed, 14 Feb 2024 13:00:34 +0000 (14:00 +0100)]
Cygwin: accommodate gcc -Og option

All three warnings produced with -Og are false positives.
But given we're using -Werror unconditionally it's better
to be safe than sorry.

Reported-by: Kevin Ushey <kevinushey@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: find_fast_cwd: don't run assembler checking code on ARM64
Corinna Vinschen [Tue, 13 Feb 2024 15:47:51 +0000 (16:47 +0100)]
Cygwin: find_fast_cwd: don't run assembler checking code on ARM64

https://cygwin.com/pipermail/cygwin/2024-February/255397.html
reports a crash on ARM64 probably related to checking x86_64
code on the x86_64 emulator on AArch64.

At least for testing, pull the code checking the host HW
up to be called before trying to evaluate assembler code.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: console: Fix a problem that minor ID is incorrect in ConEmu.
Takashi Yano [Tue, 13 Feb 2024 02:45:36 +0000 (11:45 +0900)]
Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.

Previously, minor device number of console was not assigned correctly
in ConEmu environment. This is because console window of ConEmu is
not enumerated by EnumWindows(). This patch fixes the issue.

Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: console: Make VMIN and VTIME work.
Takashi Yano [Tue, 13 Feb 2024 02:42:42 +0000 (11:42 +0900)]
Cygwin: console: Make VMIN and VTIME work.

Previously, VMIN and VTIME did not work at all. This patch fixes that.

Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: pty: Fix potential handle leak regarding CallNamedPipe().
Takashi Yano [Tue, 13 Feb 2024 02:36:05 +0000 (11:36 +0900)]
Cygwin: pty: Fix potential handle leak regarding CallNamedPipe().

In pty master_thread, 6 handles are duplicated when CallNamedPipe()
requests that. Though some of them are not used so should be closed,
they were not. This causes handle leak potentially.

Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: pty: Fix handle leak in master process.
Takashi Yano [Tue, 13 Feb 2024 02:17:46 +0000 (11:17 +0900)]
Cygwin: pty: Fix handle leak in master process.

If non-cygwin process is started in pty, closing from_master_nat
pipe handle was missing in fhandler_pty_slave::input_transfer().
This occured because the handle was duplicated but not closed.

https://github.com/msys2/msys2-runtime/issues/198

Fixes: 29431fcb5b14 ("Cygwin: pty: Inherit typeahead data between two input pipes.")
Reported-by: Hakkin Lain
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoinclude/ansidecl.h: import from binutils-gdb
Corinna Vinschen [Mon, 12 Feb 2024 12:45:10 +0000 (13:45 +0100)]
include/ansidecl.h: import from binutils-gdb

Import include/ansidecl.h version from 2024-01-04,
binutils-gdb commit fd67aa1129fd.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: dumper: use void* in place of PTR
Corinna Vinschen [Mon, 12 Feb 2024 12:43:03 +0000 (13:43 +0100)]
Cygwin: dumper: use void* in place of PTR

The definition of PTR has been dropped from newer versions
of ansidecl.h.

Convert definition of print_section_name to use void * instead,
as required by bfd_map_over_sections.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agogetlocalename_l: fix _reent for _REENT_SMALL targets
Corinna Vinschen [Mon, 5 Feb 2024 09:38:28 +0000 (10:38 +0100)]
getlocalename_l: fix _reent for _REENT_SMALL targets

The new _MB_CAPABALE-only _misc_reent member getlocalename_l_buf was
incorrectly initialized in the _REENT_INIT_MISC macro, so the build
failed for _REENT_SMALL targets, independet of the _MB_CAPABALE setting.

Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: fix typo in winjitdebug description
Corinna Vinschen [Sat, 3 Feb 2024 19:28:46 +0000 (20:28 +0100)]
Cygwin: fix typo in winjitdebug description

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: document new winjitdebug option
Corinna Vinschen [Sat, 3 Feb 2024 18:54:31 +0000 (19:54 +0100)]
Cygwin: document new winjitdebug option

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: reorder list of CYGWIN env var options alphabetically again
Corinna Vinschen [Sat, 3 Feb 2024 18:54:04 +0000 (19:54 +0100)]
Cygwin: reorder list of CYGWIN env var options alphabetically again

This has been turned upside down for a short while.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: Do not show Error dialogs by default
Johannes Schindelin [Wed, 31 Mar 2021 09:38:41 +0000 (11:38 +0200)]
Cygwin: Do not show Error dialogs by default

...in a non-Cygwin child process.  Backported from MSYS2.
Downstream commit message follows.

In https://github.com/msys2/msys2-runtime/pull/18, we discussed a change
that would allow default Windows error handling of spawned processes to
kick in (such as registered JIT debuggers). We even agreed that it would
make sense to hide this functionality behind a flag, `winjitdebug`.

However, when this got upstreamed as 21ec498d7f (cygwin: use
CREATE_DEFAULT_ERROR_MODE in spawn, 2020-12-09), that flag was deemed
unnecessary.

But it would appear that it _is_ necessary: As reported in
https://github.com/msys2/MSYS2-packages/pull/2414#issuecomment-810841296
this new behavior is pretty disruptive e.g. in CI scenarios.

So let's introduce that `winjitdebug` flag (settable via the environment
variable `MSYS`) at long last.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: net: Make if_nametoindex, etc. consistent with if_nameindex.
Takashi Yano [Sat, 3 Feb 2024 03:45:29 +0000 (12:45 +0900)]
Cygwin: net: Make if_nametoindex, etc. consistent with if_nameindex.

Currently, if_nametoindex() and if_indextoname() handle interface names
such as "ethernet_32777", while if_nameindex() returns the names such
as "{5AF7ACD0-D52E-4DFC-A4D0-54D3E6D6B2AC}". This patch unifies the
interface names to the latter.

Fixes: c356901f0d69 ("Rename if_indextoname to cygwin_if_indextoname (analag for if_nametoindex)")
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: Document recent bug fix in release note.
Takashi Yano [Sat, 3 Feb 2024 14:37:46 +0000 (23:37 +0900)]
Cygwin: Document recent bug fix in release note.

6 months agoCygwin: console: Avoid slipping past disable_master_thread check.
Takashi Yano [Fri, 2 Feb 2024 15:54:23 +0000 (00:54 +0900)]
Cygwin: console: Avoid slipping past disable_master_thread check.

If disable_master_thread flag is set between the code checking that
flag not be set and the code acquiring input_mutex, input record is
processed once after setting disable_master_thread flag. This patch
prevents that.

Fixes: d4aacd50e6cf ("Cygwin: console: Add missing input_mutex guard.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: console: Fix exit code for non-cygwin process.
Takashi Yano [Fri, 2 Feb 2024 04:59:19 +0000 (13:59 +0900)]
Cygwin: console: Fix exit code for non-cygwin process.

If non-cygwin process is executed in console, the exit code is not
set correctly. This is because the stub process for non-cygwin app
crashes in fhandler_console::set_disable_master_thread() due to NULL
pointer dereference. This bug was introduced by the commit:
3721a756b0d8 ("Cygwin: console: Make the console accessible from
other terminals."), that the pointer cons is accessed before fixing
when it is NULL. This patch fixes the issue.

Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
6 months agoCygwin: ps: avoid long lines on tty
Corinna Vinschen [Thu, 1 Feb 2024 16:20:17 +0000 (17:20 +0100)]
Cygwin: ps: avoid long lines on tty

If stdout is a tty, restrict line output to tty width.

Also, rename a weird buffer name.

6 months agoCygwin: ps: make sure later format flags override earlier format flags
Corinna Vinschen [Thu, 1 Feb 2024 16:17:57 +0000 (17:17 +0100)]
Cygwin: ps: make sure later format flags override earlier format flags

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: CW_CMDLINE_ALLOC: fix a pontentially undefined return value
Corinna Vinschen [Thu, 1 Feb 2024 12:34:52 +0000 (13:34 +0100)]
Cygwin: CW_CMDLINE_ALLOC: fix a pontentially undefined return value

cmdline has to be initialized, otherwise the return value is
undefined in case generating the command line fails.

Fixes: 732afede9358 ("Cygwin: redefine CW_CMDLINE to CW_CMDLINE_ALLOC")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: document showing command line on ps -f
Corinna Vinschen [Thu, 1 Feb 2024 11:44:28 +0000 (12:44 +0100)]
Cygwin: document showing command line on ps -f

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: implement setproctitle topic/3.6 github/topic/3.6
Corinna Vinschen [Wed, 31 Jan 2024 18:54:13 +0000 (19:54 +0100)]
Cygwin: implement setproctitle

Make sure to create commandline according to setting of setproctitle.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: commune_process: don't use IsBadStringPtr
Corinna Vinschen [Wed, 31 Jan 2024 18:41:25 +0000 (19:41 +0100)]
Cygwin: commune_process: don't use IsBadStringPtr

IsBadStringPtr is deprecated and just gives a wrong sense
of memory safety.  Replace with check for NULL pointer.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: globals: make __progname an alias of program_invocation_short_name
Corinna Vinschen [Wed, 31 Jan 2024 14:21:31 +0000 (15:21 +0100)]
Cygwin: globals: make __progname an alias of program_invocation_short_name

On Linux, __progname and program_invocation_short_name are just
different exported names of the same string.  Do the same in Cygwin.
This requires to tweak the mkglobals_h so as not to touch the
EXPORT_ALIAS expression.  Also, use the base variable
program_invocation_short_name throughout.  __progname is just
the export for getopt.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: cygwin_GetCommandLineW/A: don't rely on __argv[0] content
Corinna Vinschen [Wed, 31 Jan 2024 12:30:05 +0000 (13:30 +0100)]
Cygwin: cygwin_GetCommandLineW/A: don't rely on __argv[0] content

Since it's possible to change the __argv array, we should not rely
on __argv[0] actually representing the windows executable path in
any way.  Use the real path stored in global_progname instead.

Fixes: 521953a83a885 ("* common.din: Export GetCommandLine{A,W}.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: ps -f: output command line
Corinna Vinschen [Tue, 30 Jan 2024 19:49:20 +0000 (20:49 +0100)]
Cygwin: ps -f: output command line

So far ps(1) always prints the full path of the executable under
the COMMAND heading.

With -f, print the command line instead.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: redefine CW_CMDLINE to CW_CMDLINE_ALLOC
Corinna Vinschen [Tue, 30 Jan 2024 19:46:09 +0000 (20:46 +0100)]
Cygwin: redefine CW_CMDLINE to CW_CMDLINE_ALLOC

Make sure to

- append a trailing \0 as with Windows multistrings, so the end of
  the string can be recognized by the caller, and

- allocate cmdline on the user heap so the caller can free the
  multistring after usage.

Fixes: 831d6fa520ed4 ("* external.cc (cygwin_internal): Implement CW_CMDLINE.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: pinfo: use stpcpy where appropriate
Corinna Vinschen [Tue, 30 Jan 2024 19:42:37 +0000 (20:42 +0100)]
Cygwin: pinfo: use stpcpy where appropriate

...rather than strcpy/strchr.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agosys/stat.h: drop __INSIDE_CYGWIN__ guards
Corinna Vinschen [Wed, 24 Jan 2024 16:15:53 +0000 (17:15 +0100)]
sys/stat.h: drop __INSIDE_CYGWIN__ guards

These were only necessary until we dropped 32 bit Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: posix_getdents: implement per SUS Base Specifications Issue 8 draft
Corinna Vinschen [Tue, 23 Jan 2024 20:49:48 +0000 (21:49 +0100)]
Cygwin: posix_getdents: implement per SUS Base Specifications Issue 8 draft

- Basically maintain a hidden DIR* inside fhandlers.

- lseek has to be tweaked to allow basic seeking on the directory
  descriptor.

- the current implementation does not keep the dir positions
  between duplicated descriptor in sync.  In fact, every descriptor
  keeps its own copy of the DIR* and after dup/fork/exec, the
  directory position is reset to 0, i. e., to the start of the
  directory, as if rewinddir() has been called on the new descriptors.

  While this behaviour isn't yet covered by the Issue 8 draft,
  a bug report along these lines exists and will probably be
  picked up for TC1.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: devices.h: drop useless mode check
Corinna Vinschen [Tue, 23 Jan 2024 19:06:33 +0000 (20:06 +0100)]
Cygwin: devices.h: drop useless mode check

use IFTODT to generate type from mode.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: dirent.h: make definition of struct __DIR opaque
Corinna Vinschen [Tue, 23 Jan 2024 15:09:02 +0000 (16:09 +0100)]
Cygwin: dirent.h: make definition of struct __DIR opaque

The content of DIR should never have been exposed into userspace.
Move struct __DIR to local dirent.h and only keep forward declaration
in exported dirent.h.

This allows to tweak the structure in future, for instance, to
add thread-safety.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: implement fdclosedir
Corinna Vinschen [Tue, 23 Jan 2024 12:41:14 +0000 (13:41 +0100)]
Cygwin: implement fdclosedir

fdclosedir is BSD-only but already present in dirent.h for a couple
of years.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: implement dirent.d_reclen
Corinna Vinschen [Sun, 21 Jan 2024 18:51:54 +0000 (19:51 +0100)]
Cygwin: implement dirent.d_reclen

This change is in preparation of adding posix_getdents() from
the upcoming POSIX Base Specification Issue 8.

- Add d_reclen
- Add GLibC compatible test macros for dirent members
- Bump dirent version
- Set d_reclen to the fixed size of the dirent struct
  We can do that because the size is a multiple of 8, so it fits
  snugly in the buffer filled by posix_getdents and keep the
  alignement.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: export getlocalename_l
Corinna Vinschen [Sun, 21 Jan 2024 12:24:52 +0000 (13:24 +0100)]
Cygwin: export getlocalename_l

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agogetlocalename_l: implement per SUS Base Specifications Issue 8 draft
Corinna Vinschen [Sun, 21 Jan 2024 12:23:09 +0000 (13:23 +0100)]
getlocalename_l: implement per SUS Base Specifications Issue 8 draft

  #include <locale.h>
  const char *getlocalename_l(int category, locale_t locobj);

Most notably, we need a per-thread space to store the string
returned if locobj is LC_GLOBAL_LOCALE.  No errors are defined
for getlocalename_l.  So we can't use buffer allocation which
might lead to an ENOMEM error.  We have to use a "static" buffer
in the per-thread state.

Note that the feature test macro in locale.h is not quite correct.
This needs to be fixed as soon as the

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: path: convert symlink_info to class
Corinna Vinschen [Wed, 17 Jan 2024 11:19:33 +0000 (12:19 +0100)]
Cygwin: path: convert symlink_info to class

encapsulate everything

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: files: slightly simplify suffix handling
Corinna Vinschen [Tue, 16 Jan 2024 14:23:06 +0000 (15:23 +0100)]
Cygwin: files: slightly simplify suffix handling

- drop appending .exe.lnk to files
- drop exe_suffixes, it's the same as stat_suffixes for a long time

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: bump DLL version to 3.6.0 cygwin-3.6.0-dev
Corinna Vinschen [Tue, 23 Jan 2024 12:42:44 +0000 (13:42 +0100)]
Cygwin: bump DLL version to 3.6.0

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoHide itoa, utoa, __itoa and __utoa in stdlib.h on Cygwin only cygwin-3.5.0
Christian Franke [Mon, 22 Jan 2024 18:11:20 +0000 (19:11 +0100)]
Hide itoa, utoa, __itoa and __utoa in stdlib.h on Cygwin only

These functions are non-standard and not exported by Cygwin.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
6 months agoCygwin: machine/_arc4random.h: Fix copy/paste bug
Corinna Vinschen [Mon, 29 Jan 2024 15:42:50 +0000 (16:42 +0100)]
Cygwin: machine/_arc4random.h: Fix copy/paste bug

Remove a stray  __END_DECLS.  It didn't hurt in the only
(plain C) file including this header, but still...

Fixes: 030a762535c1 ("Cygwin: fix arc4random after fork(2)")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agossp: add support for _FORTIFY_SOURCE=3
Christian Franke [Fri, 26 Jan 2024 16:20:37 +0000 (17:20 +0100)]
ssp: add support for _FORTIFY_SOURCE=3

If specified, use __builtin_dynamic_object_size() instead of
__builtin_object_size() if supported (GCC 12.0 or later).
This enables buffer overflow checks if the buffer size is non-const
but known during runtime.
Use new macro __ssp_bos_known() instead of the (bos(p) != (size_t)-1)
checks.  The latter is no longer a compile time constant in all cases.
This avoids the generation of unused code.

Signed-off-by: Christian Franke <christian.franke@t-online.de>
6 months agoCygwin: fix arc4random after fork(2)
Corinna Vinschen [Mon, 29 Jan 2024 12:38:14 +0000 (13:38 +0100)]
Cygwin: fix arc4random after fork(2)

After using fork(), arc4random does not reseed itself, which
causes the results to become predictable.  Activate droppingfork-recognition

Fixes: e0fc33322d50 ("Delete Cygwin's arc4random in favor of new Newlib implementation")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: redefine how to recognize forkee state
Corinna Vinschen [Mon, 29 Jan 2024 12:33:05 +0000 (13:33 +0100)]
Cygwin: redefine how to recognize forkee state

So far the global variable in_forkee only indicated if the
process is the child process during fork(2) itself.

However, we need an indicator accessible from plain C code
in newlib, allowing to check for a process being a forked
process all the time, after fork(2) succeeded.

Redefine bool in_forkee to int __in_forkee to allow exposing
it to newlib.  Redefine how it indicates fork state (not
forked, forking, forked).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 months agoCygwin: Add a timeout to ensure we don't wait forever for dumper
Jon Turney [Tue, 23 Jan 2024 16:07:34 +0000 (16:07 +0000)]
Cygwin: Add a timeout to ensure we don't wait forever for dumper

6 months agolibgloss: start a MAINTAINERS file
Mike Frysinger [Wed, 24 Jan 2024 04:32:32 +0000 (23:32 -0500)]
libgloss: start a MAINTAINERS file

7 months agoCygwin: pthread: Fix handle leak in pthread_once.
Takashi Yano [Wed, 24 Jan 2024 13:33:12 +0000 (22:33 +0900)]
Cygwin: pthread: Fix handle leak in pthread_once.

If pthread_once() is called with pthread_once_t initialized using
PTREAD_ONCE_INIT, pthread_once does not release pthread_mutex used
internally. This patch fixes that by calling pthread_mutex_destroy()
in the thread which has called init_routine.

Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
7 months agoCygwin: Don't terminate via dumper
Jon Turney [Tue, 16 Jan 2024 16:12:51 +0000 (16:12 +0000)]
Cygwin: Don't terminate via dumper

A process which is exiting due to a core dumping signal doesn't
propagate the correct exist status after dumping core, because 'dumper'
itself forcibly terminates the process.

Use 'dumper -n' to avoid killing the dumped process, so we continue to
the end of signal_exit(), to exit with the 128+signal exit status.

Busy-wait in exec_prepared_command() in an attempt to reliably notice
the dumper attaching, so we don't get stuck there.

Also: document these important facts for custom uses of error_start.

7 months agolibgloss: merge cr16 into top-level Makefile
Mike Frysinger [Sun, 21 Jan 2024 04:47:12 +0000 (23:47 -0500)]
libgloss: merge cr16 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A cr16-elf build shows installed objects & libs produce same code.

The test targets were dropped as they didn't actually work -- there
is no test.o rule in here.

This page took 0.073164 seconds and 5 git commands to generate.