aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-13Cygwin: configure: Define default valus for target specific variablesCorinna Vinschen2-5/+5
Define default values for DLL_ENTRY, DIN_FILE, and TLSOFFSETS_H and drop them from the x86_64-specific branch. Keep the mechanism intact to allow other target CPUs if there ever will be. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-13Cygwin: config.h: stop including auto-generated tlsoffsets.h fileCorinna Vinschen12-64/+42
This was a hack to begin with. Clean this mess up: - Move definition of CYGTLS_PADSIZE to cygwin/config.h and drop local cygtls_padsize.h - Rename CYGTLS_PADSIZE to __CYGTLS_PADSIZE__ to keep namespace clean. Redefine as macro, rather than as const. - Move struct _reent first in struct _cygtls to allow using __CYGTLS_PADSIZE__ as offset in __getreent(). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-13Cygwin: drop i686-only filesCorinna Vinschen2-768/+0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-13Cygwin: configure: drop unused DEF_DLL_ENTRY variableCorinna Vinschen1-2/+0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-13Cygwin: configure: disable i686 buildsCorinna Vinschen2-65/+0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-13Cygwin: switch to _REENT_GLOBAL_STDIO_STREAMSCorinna Vinschen5-230/+219
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-13Make cleanup_glue() staticSebastian Huber3-3/+3
Remove cleanup_glue from the list of symbols exported by Cygwin.
2022-05-13Remove __sglue member for one configurationMatt Joyce4-5/+21
Remove __sglue member of struct reent when _REENT_GLOBAL_STDIO_STREAMS is defined.
2022-05-13Add global __sglue object for all configurationsMatt Joyce6-10/+15
Added a new global __sglue object for all configurations. Decouples the global file object list from the _GLOBAL_REENT structure by using this new object instead of the __sglue member of _GLOBAL_REENT in __sfp() and _fwalk_sglue().
2022-05-13stdio: Replace _fwalk_reent() with _fwalk_sglue()Sebastian Huber8-21/+27
Replaced _fwalk_reent() with _fwalk_sglue(). The change adds an extra __sglue object as a parameter, which will allow the passing of a global __sglue object separate from the __sglue member of struct _reent. The global __sglue object will be added in a follow-on patch.
2022-05-13Add stdio_exit_handler()Matt Joyce4-5/+18
Add a dedicated stdio exit handler to avoid using _GLOBAL_REENT in exit().
2022-05-13Add CLEANUP_FILE defineMatt Joyce1-19/+19
Define the configuration-dependent constant CLEANUP_FILE for use in cleanup_stdio(). This will reduce duplicate code during the addition of a dedicated stdio atexit handler in a follow-on patch.
2022-05-13Move __sglue initializations to __sfp()Matt Joyce1-3/+7
Moved last remaining __sglue initializations from __sinit() to __sfp(). The move better encapsulates access to __sglue and facilitates its decoupling from struct _reent in a follow-on patch.
2022-05-13Remove __sinit_locks / __sinit_recursive_mutexMatt Joyce3-22/+3
Remove __sinit_lock_acquire() and __sinit_lock_release(). Replace these with __sfp_lock_acquire() and __sfp_lock_release(), respectively. This eliminates a potential deadlock issue between __sinit() and __sfp(). Remove now unused __sinit_recursive_mutex and __lock___sinit_recursive_mutex.
2022-05-13Add two __sglue initialization macrosMatt Joyce2-7/+9
Added _REENT_INIT_SGLUE and _REENT_INIT_SGLUE_ZEROED macros to initialize __sglue member of struct _reent. This allows further simplification of __sinit() and facilitates the removal of __sglue as a member of struct _reent for certain configurations in a follow-on patch.
2022-05-13Declare global __sf[] only onceSebastian Huber1-2/+4
Reduced number of global __sf[] declarations from two to one, simplifying initializations in sys/reent.h.
2022-05-13Remove duplicate sglue initializationsMatt Joyce1-3/+0
Removed duplicate sglue initializations from __sinit(). These are already initialized in the _REENT_INIT macro in sys/reent.h. This simplification enables the reduction of _GLOBAL_REENT dependency in a follow-on patch.
2022-05-13Remove duplicate stdio initializationsMatt Joyce1-4/+0
Removed duplicate stdio initializations from __sinit(). These are already initialized in the _REENT_INIT macro in sys/reent.h. This simplification enables the reduction of _GLOBAL_REENT dependency in a follow-on patch.
2022-05-13Cygwin: Implement GSO/GRO supportCorinna Vinschen4-13/+205
- getsockopt (SOL_UDP, UDP_SEGMENT) - setsockopt (SOL_UDP, UDP_SEGMENT) - getsockopt (SOL_UDP, UDP_GRO) - setsockopt (SOL_UDP, UDP_GRO) - sendmsg with SOL_UDP/UDP_SEGMENT control message - recvmsg, convert Winsock UDP_COALESCED_INFO (DWORD) control message to Linux compatible SOL_UDP/UDP_GRO (uint16_t)
2022-05-12Cygwin: socket.h: add socket options added in recent Windows releasesCorinna Vinschen1-0/+21
Add new socket options equivalent to their Linux counterpart. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-12Cygwin: signal.cc: Include <unistd.h>Sebastian Huber1-1/+2
Include <unistd.h> for sleep() and usleep() declarations. Fix return type of usleep().
2022-05-11fhandler_process.cc(format_process_stat): fix /proc/pid/stat issuesBrian Inglis1-13/+20
fix tty_nr maj/min bits, vmmaxrss units, and x86 format mismatch: ctty maj is 31:16, min is 15:0; tty_nr s/b maj 15:8, min 31:20, 7:0; vmmaxrss s/b bytes not pages; times all 64 bit - change formats of first two instances from %lu to %U; realign sprintf formats and variables/values in more logical groups
2022-05-09Cygwin: pty: Avoid script command crash in console.Takashi Yano1-4/+2
- Previously, script command sometimes crashes by Ctrl-C in Win 7 if it is running in console, and non-cygwin app is foreground. This patch fixes the issue.
2022-05-09Cygwin: pty: Not to change code page of parent console.Takashi Yano1-1/+1
- The recent commit "Cygwin: pty: Fix timing of creating invisible console." breaks the feature added by commit 72770148, which prevents pty from changing code page of parent console. This patch restores that.
2022-05-09Cygwin: pty: Add missing attach_mutex guard.Takashi Yano1-0/+2
2022-05-09Cygwin: pty: Avoid deadlock when pcon is started on console.Takashi Yano2-19/+17
- Previously, "env SHELL=cmd script" command in console caused deadlock when starting cmd.exe. This patch fixes the issue.
2022-05-08Cygwin: pty: Change the condition to send Ctrl-C event.Takashi Yano1-6/+3
- Previously, non-cygwin app started by "script -c <non-cygwin app>" receives Ctrl-C twice. This patch fixes the issue.
2022-05-08Cygwin: pty: Fix timing of creating invisible console.Takashi Yano1-2/+2
- Previously, invisible console was created in fixup_after_exec(). However, actually this should be done in fixup_after_fork(). this patch fixes the issue.
2022-05-08Cygwin: pty: Fix acquiring attach_mutex timing.Takashi Yano1-1/+1
- When temporarily attaching a console, the timing of acquiring attach_mutex was not appropriate. This sometimes caused master forwarding thread to crash on Ctrl-C in Windows 7. This patch fixes the issue.
2022-05-05Cygwin: sigproc: Avoid segfault caused by signal just after fork().Takashi Yano1-2/+2
- The commit "Cygwin: always add sigmask to child info" also tries to fix this issue, however, did not fix enough. This patch fixes that.
2022-05-04Generate manpages for functions in chapter sys.texJon Turney1-1/+3
Also generate manpages for functions in chapter sys.tex, omitted in error.
2022-05-04Fix warning about duplicate id in docbook XMLJon Turney1-1/+1
../newlib/libc/libc.xml:22242: element refentry: validity error : ID iconv already defined <refentry id="iconv"> Use a separate namespace for chaper ids, to avoid collision between the ids for the chapter and function 'iconv', now that iconv documentation is generated unconditionally.
2022-05-04Silence xsltproc when writing manpagesJon Turney3-2/+5
Unless make is invoked with V=1, have xmlto pass the parameter 'man.output.quietly=1' to xsltproc to suppress "Note: Writing foo.N" output from the manpages stylesheet. (This doesn't quite do what it says: The output is not silenced if V has any value, including 0. You could consider that either a bug or a feature.)
2022-05-04Add build avoidance for 'make man'Jon Turney2-8/+10
This will generate multiple manpage files as an output, but we don't know what they will be called, so use a timestamp for build avoidance.
2022-05-04Simplify rules for creating man pagesJon Turney2-10/+6
Simplify rules for creating docbook XML used to create manpages: Updating the output using move-if-change and then unconditionally touching the .stamp file doesn't make much sense.
2022-05-04Fix ndbm.c build breakDimitar Dimitrov1-0/+1
The ndbm.c build broke with: Commit 357d7fcc6 In <stdio.h> provide only necessary types The above commit exposed a latent missing-header bug: newlib/newlib/libc/include/ndbm.h:83:38: error: unknown type name ‘mode_t’ Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-05-04Fix nano-malloc buildDimitar Dimitrov1-0/+1
The nano malloc build broke with: Commit 357d7fcc6 In <stdio.h> provide only necessary types The above commit exposed a latent missing-header bug: newlib/libc/stdlib/nano-mallocr.c:220:33: error: ‘uintptr_t’ undeclared (first use in this function) Fix by including <stdint.h>. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-05-04Remove _global_impure_ptr indirectionSebastian Huber7-52/+13
Remove the pointer indirection through the read-only _global_impure_ptr and directly use a externally visible _impure_data object of type struct _reent. This enables the static initialization of global data structures in a follow up patch. In addition, we get rid of a machine-specific file.
2022-05-04In <stdio.h> provide only necessary typesSebastian Huber1-1/+11
2022-05-04Revert "sys/types.h: Don't include sys/_stdint.h"Corinna Vinschen10-90/+86
This reverts commit 4232d171a620662aaed650879936eac60aefd9e0.
2022-05-03sys/types.h: Don't include sys/_stdint.hCorinna Vinschen10-86/+90
By including sys/_stdint.h, all types from stdint.h are exposed even if stdint.h isn't pulled in explicitely. Include <machine/_default_types.h instead. Fix up newlib and Cygwin files which rely on stdint.h types, too. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-03Cygwin: always add sigmask to child infoCorinna Vinschen3-7/+18
Even after fork, we might need the parent sigmask without having access to the real _main_tls. There's a short time at process startup, when _main_tls points to the system-allocated stack, but wait_sig is already running. If we can't lock _main_tls, because find_tls can't find it yet, we now access the parent's sigmask via child_info. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-03Cygwin: move x86_64 thread stack areaCorinna Vinschen2-7/+9
The x86_64 thread stack area collides with the share user data in recent versions of Windows. Let's get ourselvels get out of the way and move the thread stack area in the former slack space between DLL area and heap, from 0x6:00000000 to 0x8:00000000. That quadruplicates the stack area, so allow bigger maximum stack sizes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-05-03Cygwin: simplify create_new_main_thread_stackCorinna Vinschen3-12/+4
Originally the function was designed to be used in forked processes as well, but it has never been used this way. Drop the parameter only required for forkees. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-04-27Cygwin: Fix typo KERB_S4U_LOGON_FLAG_IDENTITY -> IDENTIFYJon Turney1-2/+2
2022-04-27Cygwin: Fix build with w32api 10.0.0Jon Turney1-2/+5
> ../../../../src/winsup/cygwin/sec_auth.cc:1240:16: error: redefinition of ‘struct _MSV1_0_S4U_LOGON’ > 1240 | typedef struct _MSV1_0_S4U_LOGON > | ^~~~~~~~~~~~~~~~~ > In file included from ../../../../src/winsup/cygwin/ntsecapi.h:10, > from ../../../../src/winsup/cygwin/sec_auth.cc:13: > /usr/include/w32api/ntsecapi.h:1425:18: note: previous definition of ‘struct _MSV1_0_S4U_LOGON’ > 1425 | typedef struct _MSV1_0_S4U_LOGON { > | ^~~~~~~~~~~~~~~~~ > ../../../../src/winsup/cygwin/sec_auth.cc:1246:3: error: conflicting declaration ‘typedef int MSV1_0_S4U_LOGON’ > 1246 | } MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON; > | ^~~~~~~~~~~~~~~~ > In file included from ../../../../src/winsup/cygwin/ntsecapi.h:10, > from ../../../../src/winsup/cygwin/sec_auth.cc:13: > /usr/include/w32api/ntsecapi.h:1430:5: note: previous declaration as ‘typedef struct _MSV1_0_S4U_LOGON MSV1_0_S4U_LOGON’ > 1430 | } MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON; > | ^~~~~~~~~~~~~~~~ > ../../../../src/winsup/cygwin/sec_auth.cc:1246:22: error: conflicting declaration ‘typedef int* PMSV1_0_S4U_LOGON’ > 1246 | } MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON; > | ^~~~~~~~~~~~~~~~~ > In file included from ../../../../src/winsup/cygwin/ntsecapi.h:10, > from ../../../../src/winsup/cygwin/sec_auth.cc:13: > /usr/include/w32api/ntsecapi.h:1430:24: note: previous declaration as ‘typedef struct _MSV1_0_S4U_LOGON* PMSV1_0_S4U_LOGON’ > 1430 | } MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON;
2022-04-27libgloss: pru: Fix _open syscal argumentsDimitar Dimitrov1-1/+17
The _open() C function is declared as having variable arguments in newlib, so second and third arguments are passed on stack. Add code to move them into registers, since that's where the PRU simulator expects them. Issue was exposed by the GCC test gcc.c-torture/execute/fprintf-2.c, which relies on tmpnam implementation to pass correct flags to _open. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-04-27Cygwin: Fix "0x0x" in gmondump and ssp man pagesMark Geisert2-3/+3
A recent patch fixed gmondump to stop printing "0x0x" as an address prefix. It turns out the Cygwin User's Guide and the gmondump and ssp man pages (all from utils.xml) have examples of the same error.
2022-04-18Cygwin: pty: Fix Ctrl-C behaviour in latest GDB.Takashi Yano1-1/+3
- In the latest GDB (11.2-1), Ctrl-C behaviour is broken a bit for non-cygwin inferior. For example, Ctrl-C on GDB prompt is not sent to GDB but to the inferior. This patch fixes the issue.
2022-04-18Cygwin: pty: Fix deadlock caused by Ctrl-C in setup_pseudoconsole().Takashi Yano1-0/+4
- If Ctrl-C is pressed just after setup_pseudoconsole() is called, mintty stops to respond a while when CPU load is high. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-April/251272.html