aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-03-04Cygwin: pty: Fix a possible race issue in initialization of pcon.Takashi Yano1-1/+2
- Currently, tty::pcon_start flag is cleared before transfer_input() in master::write(), however, the code in setup_pseudoconsole() waits for transfer_input() using tty::pcon_start. This possibly causes the race issue. The patch fixes this potential issue.
2022-03-04Cygwin: pty: Update some comments in pty code.Takashi Yano1-8/+21
2022-03-04Cygwin: pty: Omit transfer_input() call where it is no longer needed.Takashi Yano1-47/+0
- This patch removes the old code which calls transfer_input() but is no longer needed. These code was necessary indeed in the past, however, as a result of recent frequent code changes, it is no longer needed.
2022-03-04Cygwin: pty: Rearrange reset_switch_to_nat_pipe() calls.Takashi Yano3-14/+11
- Previously, reset_switch_to_nat_pipe() is called from many places in pty code. This patch reorganizes that. With this patch, it is called only from bg_check() and setpgid_aux(). The calls which does not have enough reason have been omitted.
2022-03-04Cygwin: pty: Treat both CR and NL as line feed in transfer_inpup().Takashi Yano1-2/+4
- To make read() work properly in canonical mode, writing to the pty pipe should be done line by line. However, only CR was treated as line separator previously in transfer_input(). This patch fixes the issue.
2022-03-04libgloss: add new Build System Internals node to the menuMike Frysinger1-1/+2
Seems that some versions of texinfo require the @menu to have all entries at the top level, so add the new build one to it.
2022-03-04Cygwin: pty: Stop to use PID_NEW_PG flag as a marker for GDB.Takashi Yano3-13/+16
- Previously, the PID_NEW_PG flag was also used as a marker for GDB with non-cygwin inferior, unlike its original meaning. With this patch, the condition exec_dwProcessId == dwProcessId is used as a marker for that instead.
2022-03-04Cygwin: pty: Simplify the setup code for GDB a bit.Takashi Yano1-13/+14
- This patch omits the unnecessary code path for setup for GDB.
2022-03-04Cygwin: pty: Rename nat_pipe_owner_alive() to process_alive().Takashi Yano1-6/+9
- The function nat_pipe_owner_alive() is used even for the process which is not a nat pipe owner, so, it is renamed to process_alive().
2022-03-02Cygwin: getconf: align -a output to glibc getconfCorinna Vinschen1-2/+2
glibc getconf doesn't print "undefined" for undefined values in -a output. It just prints the empty string. Do it the same way. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-02Cygwin: sysconf: don't set errno for unsupported optionsCorinna Vinschen1-9/+7
We return -1 with errno set to EINVAL for sysconf options for values required by POSIX, but not implemented on Cygwin. This is incorrect. Return -1, but don't set errno for these options. Drop the "nsup" enum to indicate unsupported values, it's not required anymore. Fixes: 59e3b6ca7dc10 (CVS import) Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-02Cygwin: sysconf: belatedly add correct return value for _SC_DELAYTIMER_MAXCorinna Vinschen1-1/+1
When adding the timer_getoverrun function, DELAYTIMER_MAX was added to limits.h, but the return value of sysconf(_SC_DELAYTIMER_MAX) wasn't changed accordingly. Fix that now. Fixes: 9e295a8d193e ("Cygwin: posix timers: implement timer_getoverrun") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-03Cygwin: pty: Add still missing acquire/release_attach_mutex.Takashi Yano1-8/+40
- transfer_input() function uses console api, so it should be guarded by attach_mutex. However, in most cases, it is missing. This patch fixes the issue.
2022-03-02Cygwin: pty: Communalize the code for temporary attach to console.Takashi Yano3-91/+66
- This patch communalizes the code for attaching another console temporarily and resuming to the original attach state, because there were a plurality of similar codes throughout.
2022-03-02Cygwin: console, pty: Revamp the acquire/release_attach_mutex timing.Takashi Yano5-44/+155
- This patch revises the acquiring/releasing timing for attach_mutex to make the period in which it is being acquired shorter. Further, acquiring/releasing are added to where they are missing but needed.
2022-03-02Cygwin: _pinfo::siginfo: fix sig_send callCorinna Vinschen1-1/+1
Request __SIGPENDINGALL, not __SIGPENDING, when fetching signal info for the calling process. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-02Cygwin: console: Fix a bug from comparison between int and DWORD.Takashi Yano1-1/+1
2022-03-01newlib: convert INTERNAL_NEWLIB to _LIBCMike Frysinger4-41/+38
Since we already set up _LIBC to indicate source files are building for newlib, we don't need this malloc-specific symbol. Convert it over to simplify the build a bit.
2022-03-01newlib: drop redundant AM_MAINTAINER_MODE callMike Frysinger2-31/+1
This is already called earlier in this file, so no need to do it again.
2022-03-01libgloss: merge lm32 into top-level MakefileMike Frysinger6-126/+82
Avoid a recursive make to speed things up a bit. This drops the header install logic because the lm32/ subdir doesn't actually have any header files to install.
2022-03-01libgloss: use m4_foreach_w to simplify the logic a bitMike Frysinger2-22/+24
It's functionally the same, but the configure.ac code is simpler and less boiler plate duplicated.
2022-03-02Cygwin: console: Prevent special keys processing from drop.Takashi Yano2-9/+15
- There was a potential risk to drop special key processing when process_input_messsage() is called intermittently. This patch fixes the issue.
2022-03-02Cygwin: console: Stop to create struct instance which is not needed.Takashi Yano1-9/+9
- In fhandler_console::cons_master_thread(), a struct which has only a static function is used. In this case, struct instance is not necessary. So with this patch, the static function is invoked without creating instance.
2022-03-01Cygwin: update 3.4 release textCorinna Vinschen2-0/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: /proc/<PID>/status: Fill SigPnd, SigBlk and SigIgn values with lifeCorinna Vinschen4-12/+70
So far the values of SigPnd and SigBlk were always 0 and SigIgn was incorrectly set to the block mask of the current thread of the calling process. Fix that by adding a _pinfo::siginfo method and a PICOM_SIGINFO message to allow to request actual signal info of any running process. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: wait_sig: allow to compute process-wide mask of pending signalsCorinna Vinschen2-1/+22
Add a signal __SIGPENDINGALL to allow computing the mask of all currently pending signals. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: add init_cygheap::compute_sigblkmask methodCorinna Vinschen2-0/+19
Add method to compute process-wide signal block mask Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: Makefile: fix ctags --extras optionCorinna Vinschen1-1/+1
--extra is deprectated, use --extras Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how"Corinna Vinschen1-3/+3
The "how" value only makes sense if a new set is given. If we only read the current signal set, ignore the value of "how" per POSIX: "If set is a null pointer, the value of the argument how is not significant" Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: /proc/<PID>/status: fix format specifierCorinna Vinschen1-3/+3
The format specifier used for the signal masks is incorrectly assuming 32 bit values. Fix it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: pty: Rename some functions/variables with the name *pcon*.Takashi Yano5-179/+203
- With this patch, some pty functions/variables have been renamed so that the name *pcon* is not used for those that are called even when the pseudo console is not active.
2022-03-01Cygwin: sysconf: _SC_TZNAME_MAX: return -1 as valid valueCorinna Vinschen1-1/+1
sysconf incorrectly sets errno to EINVAL for _SC_TZNAME_MAX. Don't do that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: pty: Reorganize the code path of setting up and closing pcon.Takashi Yano3-142/+153
- This patch reorganizes the code path of setting-up and cleaning-up of the pseudo console to improve readability and maintainability of pty code.
2022-03-01Cygwin: pty: Avoid cutting the branch the pty master is sitting on.Takashi Yano5-50/+65
- When Ctrl-C terminates a non-cygwin process on a pseudo console, pty master attaches to the pseudo console first, and send CTRL_C_EVENT. If the non-cygwin process closes the pseudo console before the pty master calls FreeConsole(), the pty master process will crash. With this patch, pty master process takes over the ownership of the pseudo console, and closes it by myself.
2022-03-01newlib: xstormy16: add missing string.h includeMike Frysinger1-0/+5
Some of these functions are using memcpy & memset from string.h but not including the header leading to implicit declaration warnings.
2022-02-28newlib: speed up targ-include setup & add error checkingMike Frysinger2-130/+47
The current targ-include setup runs `cp` every header file it installs, in serial. This can be a little noticeable on systems, so cleanup the logic to rely on cp's ability to copy multiple files to a directory in a single call. We still need a check for empty directories with no headers (i.e. the glob doesn't match anything), so add a helper variable to contain that logic to reduce the boiler plate a little.
2022-02-28libgloss: add a little build system generation documentationMike Frysinger1-1/+49
This is a bit of an abbreviated form of what's in the Newlib subdir, but with emphasis on Libgloss-specific parts, and anything unique to it. I haven't put too much effort in.
2022-02-28newlib: libc: move stdio multiplex logic from build to source filesMike Frysinger16-502/+249
Rather than define per-object rules in the Makefile, have small files that define & include the right content. This simplifies the build rules, and makes understanding the source a little easier (imo) as it makes all the subdirs behave the same: you have 1 source file and it produces 1 object. It's also about the same amount of boiler plate, without having to define custom build rules that can fall out of sync. Some of these rules were already unnecessary as they were compiling a single source file into the same named object w/out custom flags, and Automake handles that for us completely. This will also be important as we merge the libc.a build into the top dir since it relies on a single flat list of objects for overrides. Also take the opportunity to clean up the unnecessary header deps in here. Automake provides dependency generation for free now.
2022-02-28newlib: simplify header setup rulesMike Frysinger2-42/+30
Since POSIX cp requires copying a file to a directory without having to specify the name explicitly, rely on that to avoid calling basename on every source file. We can also drop the stub `true` call if the -f test failed. The use of `if` already takes care of that in POSIX shell.
2022-02-28Cygwin: pty: Isolate CTRL_C_EVENTs between ptys.Takashi Yano2-4/+21
- With this patch, unique invisible consoles are created for each pty to isolate CTRL_C_EVENTs between ptys. This is necessary by Ctrl-C handling in fhandler_termios::process_sigs() for non-cygwin apps started in pty if the pseudo console is disabled.
2022-02-28Cygwin: console: Improve the code to avoid typeahead key swapping.Takashi Yano1-33/+42
- The commit "Cygwin: console: Prevent the order of typeahead input from swapped." did not fully resolve the issue. If keys are typed during input buffer fix, the order of key event may be swapped. This patch fixes the issue again.
2022-02-28Cygwin: pinfo: Fix exit code for non-cygwin apps which reads console.Takashi Yano3-3/+20
- The recent commit "Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C." did not fix enough the issue. If a non-cygwin app is reading the console, it will not return STATUS_CONTROL_C_EXIT even if it is terminated by Ctrl-C. As a result, the previous patch does not take effect. This patch solves this issue by setting sigExeced to SIGINT in ctrl_c_handler(). In addition, sigExeced will be cleared if the app does not terminated within predetermined time period. The reason is that the app does not seem to be terminated by the signal sigExeced.
2022-02-28Cygwin: termios: Ensure detection of GDB inferior in process_sigs().Takashi Yano3-6/+9
- In some situations, some cygwin processes might wrongly identified as GDB inferior. This patch ensures the detection of GDB inferior.
2022-02-27Cygwin: termios: Add comments to the code refactored recently.Takashi Yano2-21/+52
- This patch adds some comments to the source code whose intent may not be clear enough from the code which is refactored recently.
2022-02-27Cygwin: console: Correct the past fix for apps which open pty.Takashi Yano1-2/+2
- The commit "Cygwin: console: Fix issues of apps which open pty." did not fix the second problem correctly. That commit looked to fix the issue, but the actual problem was that ctrl_c_handler() should be reregistered *AFTER* FreeConsole()/AttachConsole(). This patch correct that.
2022-02-27Cygwin: console: Revert experimental code mixed accidentally.Takashi Yano1-1/+7
- The commit "Cygwin: console: Restore CTRL_BREAK_EVENT handling." was accidentally mixed with experimental code in exceptions.cc. Due to this, non-cygwin app receives CTRL_C_EVENT twice in the following scenario. 1) Run 'sleep 10 | <non-cygwin app>' 2) Hit Ctrl-C. 3) The non-cygwin app receives CTRL_C_EVENT twice. This patch reverts the code with the problem.
2022-02-26Cygwin: console: Prevent the order of typeahead input from swapped.Takashi Yano1-2/+51
- If a lot of keys are typed very quickly in the app which does not read console, the order of input keys in console input buffer occasionally swapped. Although this extremely rarely happens, is obviously a bug of cons_master_thread. This patch fixes the issue.
2022-02-26Cygwin: pty: Stop to send CTRL_C_EVENT if pcon activated.Takashi Yano3-7/+17
- The commit "Cygwin: console: Redesign handling of special keys." removes special treatment for pty in with pseudo console activated, however, it is necessary on second thought. This is because sending CTRL_C_EVENT to non-cygwin apps will be done in pseudo console, therefore, sending it in fhandler_pty_master::write() duplicates that event for non-cygwin apps.
2022-02-26Cygwin: console: Fix issues of apps which open pty.Takashi Yano4-17/+21
- After some recent changes for special keys handling break the apps which open pty (such as script command). If the app which opens pty is executed in console, the following issues occur. 1) If the script command was started from non-cygwin shell (such as cmd.exe), another cygwin app started in pty slave cannot receive Ctrl-C. 2) If non-cygwin app is executed in pty slave, the app which opened the pty (e.g. script command) crashes by Ctrl-C. This patch fixes these issues.
2022-02-25libgloss: iq2000: fix prototypeMike Frysinger1-1/+1