summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: pty: Transfer input only if the stdin is a pty.Takashi Yano via Cygwin-patches2021-03-092-4/+15
| | | | | - The commit 12325677f73a did not fix enough. With this patch, more transfer_input() calls are skipped if stdin is redirected or piped.
* Cygwin: update release notes for 3.2.0, part 5Corinna Vinschen2021-03-091-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: update release notes for 3.2.0, part 4Corinna Vinschen2021-03-092-2/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pty: Transfer input for native app only if the stdin is pcon.Takashi Yano via Cygwin-patches2021-03-081-8/+10
| | | | | | - Currently, transfer input is triggered even if the stdin of native app is not a pseudo console. With this patch it is triggered only if the stdin is a pseudo console.
* Cygwin: update release notes for 3.2.0Ken Brown2021-03-082-0/+40
|
* Cygwin: pty: Attach to stub process when non-cygwin app inherits pcon.Takashi Yano via Cygwin-patches2021-03-081-1/+1
| | | | | | | | - If two non-cygwin apps are started simultaneously, attaching to pseudo console sometimes fails. This is because the second app trys to attach to the process not started yet. This patch avoids the issue by attaching to the stub process rather than the other non-cygwin app.
* Cygwin: update release notes for 3.2.0, part 2Corinna Vinschen2021-03-082-0/+23
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: update release notes for 3.2.0Corinna Vinschen2021-03-081-0/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console, pty: Stop ignoring Ctrl-C by IGNBRK.Takashi Yano via Cygwin-patches2021-03-082-4/+4
| | | | | | | - Perhaps current code misunderstand meaning of the IGNBRK. As far as I investigated, IGNBRK is concerned with break signal in serial port but there is no evidence that it has effect to ignore Ctrl-C. This patch stops ignoring Ctrl-C by IGNBRK for non-cygwin apps.
* Cygwin: pty: Discard input already accepted on interrupt.Takashi Yano via Cygwin-patches2021-03-085-1/+31
| | | | | - Currently, input already accepted is not discarded on interrupt by VINTR, VQUIT and VSUSP keys. This patch fixes the issue.
* Revert "Cygwin: Make sure newer apps get uname_x even when loading uname ↵Corinna Vinschen2021-03-082-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | dynamically" This reverts commit 532b91d24e9496c7988b2b1dda7fc0e8b161f782. It turned out that this patch has undesired side effects. To wit, if a newer, post-uname_x executable was linked against or loading an older, pre-uname_x DLL, and this DLL called uname. This call would jump into the old uname with the old struct utsname as parameter, but given the newer executable it would get redirected to uname_x. uname_x in turn would overwrite stack memory it should leave well alone, given it expects the newer, larger struct utsname. For the entire discussion see the thread starting at https://cygwin.com/pipermail/cygwin/2021-February/247870.html and continuing in March at https://cygwin.com/pipermail/cygwin/2021-March/247930.html For a description where we're coming from, see https://cygwin.com/pipermail/cygwin/2021-March/247959.html While we *could* make the scenario in question work by patching dlsym, the problem would actually be the same, just for dynamic loading. In the end, we're missing the information, which Cygwin version has been used when building DLLs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate lib/posix/Makefile.inJeff Johnston2021-03-051-3/+16
|
* Cygwin: console: Fix restoring console mode failure.Takashi Yano via Cygwin-patches2021-03-052-4/+11
| | | | | | | - Restoring console mode fails in the following scenario. 1) Start cygwin shell in command prompt. 2) Run 'exec chcp.com'. This patch fixes the issue.
* Cygwin: pty: Fix a race issue in startup of pseudo console.Takashi Yano via Cygwin-patches2021-03-051-4/+12
| | | | | | | | - If two non-cygwin apps are started simultaneously and this is the first execution of non-cygwin apps in the pty, these occasionally hang up. The cause is the race issue between term_has_pcon_cap(), reset_switch_to_pcon() and setup_pseudoconsole(). This patch fixes the issue.
* Cygwin: simplify linkat with AT_EMPTY_PATHKen Brown2021-02-251-8/+16
| | | | | | | | | | | | | | linkat(olddirfd, oldpath, oldname, newdirfd, newname, AT_EMPTY_PATH) is supposed to create a link to the file referenced by olddirfd if oldname is the empty string. Currently this is done via the /proc filesystem by converting the call to linkat(AT_FDCWD, "/proc/self/fd/<olddirfd>", newdirfd, newname, AT_SYMLINK_FOLLOW), which ultimately leads to a call to the appropriate fhandler's link method. Simplify this by using cygheap_fdget to obtain the fhandler directly.
* Cygwin: fix linkat(2) on sockets that are not socket filesKen Brown2021-02-252-4/+12
| | | | | | | | | | | | | | | If linkat(2) is called with AT_EMPTY_PATH on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::link in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fhandler_disk_file::link only if the fhandler_socket object is a file (determined by testing dev().isfs()). Also fix the case of a socket file opened with O_PATH by setting the fhandler_disk_file's io_handle.
* Cygwin: fix facl on sockets that are not socket filesKen Brown2021-02-252-4/+10
| | | | | | | | | | If facl(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::facl in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fhandler_disk_file::facl only if the fhandler_socket object is a file (determined by testing dev().isfs()).
* Cygwin: fix fchown on sockets that are not socket filesKen Brown2021-02-252-4/+10
| | | | | | | | | | If fchown(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::fchown in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fhandler_disk_file::fchown only if the fhandler_socket object is a file (determined by testing dev().isfs()).
* Cygwin: fix fchmod on sockets that are not socket filesKen Brown2021-02-252-4/+10
| | | | | | | | | | If fchmod(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::fchmod in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fhandler_disk_file::fchmod only if the fhandler_socket object is a file (determined by testing dev().isfs()).
* Cygwin: fix fstatvfs on sockets that are not socket filesKen Brown2021-02-252-4/+15
| | | | | | | | | | | If fstatvfs(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fhandler_disk_file::fstatvfs in most cases. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fhandler_disk_file::fstatvfs only if the fhandler_socket object is a socket file (determined by testing dev().isfs()).
* Cygwin: fix fstat on sockets that are not socket filesKen Brown2021-02-252-10/+10
| | | | | | | | | | If fstat(2) is called on an AF_LOCAL or AF_UNIX socket that is not a socket file, the current code calls fstat_fs. The latter expects to be operating on a disk file and uses the socket's io_handle, which is not a file handle. Fix this by calling fstat_fs only if the fhandler_socket object is a file (determined by testing dev().isfs()).
* RISC-V: Fix optimized strcmp on big endianMarcus Comstedt2021-02-251-4/+36
|
* Set __IEEE_BIG_ENDIAN for big endian RISC-VMarcus Comstedt2021-02-251-0/+4
|
* Cygwin: facl: fail with EBADF on files opened with O_PATHKen Brown2021-02-241-0/+5
| | | | | | This is in the spirit of the Linux requirement that file operations like fchmod(2), fchown(2), and fgetxattr(2) fail with EBADF on files opened with O_PATH.
* Cygwin: AF_UNIX: allow opening with the O_PATH flagKen Brown2021-02-242-0/+25
| | | | | | This was done for the fhandler_socket_local class in commits 3a2191653a, 141437d374, and 477121317d, but the fhandler_socket_unix class was overlooked.
* Bump config.guess and config.subKito Cheng2021-02-242-478/+739
| | | | | | | | | | | Hi: RISC-V has added big-endian support recently, which require config.* stuff update, and we'll send further patch for fix big-endian build, so I believe this fundamental change should upstream first. Import upstream 2021-01-25. Upstream sha1 6faca61810d335c7837f320733fe8e15a1431fc2
* Cygwin: console: Prevent NULL pointer access in close().Takashi Yano via Cygwin-patches2021-02-221-1/+1
| | | | | - There seems to be a case that shared_console_info is not set yet when close() is called. This patch adds guard for such case.
* Cygwin: pty: Fix segfault caused when tcflush() is called.Takashi Yano via Cygwin-patches2021-02-221-2/+5
| | | | | | | | - After commit 253352e796ff9ec9a447e5375f5bc3e2b92b5293, mc (midnight commander) crashes with segfault if the shell is bash. This is due to NULL pointer access in read(). This patch fixes the issue. Addresses:: https://cygwin.com/pipermail/cygwin/2021-February/247870.html
* Cygwin: FIFO: temporarily keep a conv_handle in syscalls.cc:openKen Brown2021-02-191-3/+19
| | | | | | | | | | | When a FIFO is opened, syscalls.cc:open always calls fstat on the newly-created fhandler_fifo. This results from a call to device_access_denied. To speed-up this fstat call, and therefore the open(2) call, use PC_KEEP_HANDLE when the fhandler is created. The resulting conv_handle is retained until after the fstat call if the fhandler is a FIFO; otherwise, it is closed immediately.
* Cygwin: fstat_helper: always use handle in call to get_file_attributeKen Brown2021-02-191-2/+1
| | | | | | | | | | | | Previously, the call to get_file_attribute for FIFOs set the first argument to NULL instead of the handle h returned by get_stat_handle, thereby forcing the file to be opened for fetching the security descriptor in get_file_sd(). This was done because h might have been a pipe handle rather than a file handle, and its permissions would not necessarily reflect those of the file. That situation can no longer occur with the new fhandler_fifo::fstat introduced in the previous commit.
* Cygwin: define fhandler_fifo::fstatKen Brown2021-02-192-0/+24
| | | | | | | | | | | | | | | | | | Previously fstat on a FIFO would call fhandler_base::fstat. The latter is not appropriate if fhandler_fifo::open has already been called (and O_PATH is not set), for the following reason. If a FIFO has been opened as a writer or duplexer, then it has an io_handle that is a pipe handle rather than a file handle. fhandler_base::fstat will use this handle and potentially return incorrect results. If the FIFO has been opened as a reader, then it has no io_handle, and a call to fhandler_base::fstat will lead to a call to fhandler_base::open. Opening the fhandler a second time can change it in undesired ways; for example, it can modify the flags and status_flags. The new fhandler_fifo::fstat avoids these problems by creating an fhandler_disk_file and calling its fstat method in case fhandler_fifo::open has already been called and O_PATH is not set.
* Cygwin: realpath: fix cygwin installation dir being access via junctionCorinna Vinschen2021-02-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this case: - Cygwin installed in C:\cygwin64 - mklink /j D:\cygwin64 C:\cygwin64 - create testcase calling realpath("/", result); printf ("%s\n", result); - start cmd >C:\cygwin64\bin\bash -lc <path-to-testcase> / >D\cygwin64\bin\bash -lc <path-to-testcase> /cygdrive/c/cygwin64 This scenario circumventing the mount point handling which is automated in terms of /, depending on the path returned from GetModuleFileNameW for the Cygwin DLL. When calling D:\cygwin64\bin\bash the dir returned from GetModuleFileNameW is D:\cygwin64\bin, thus root is D:\cygwin64. However, junctions are treated as symlinks in Cygwin which explains why the path gets converted to a cygdrive path. Fix this by calling GetFinalPathNameByHandleW on the result from GetModuleFileNameW to get the correct root path, even if accessed via a junction point. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: default to O_BINARY in fhandler_base::reset_to_open_binmode()Corinna Vinschen2021-02-191-1/+2
| | | | | | | | | | This only affects the very seldom bordercase of apps calling setmode(fd, 0) on fhandlers not calling fhandler_base::set_open_status(). All fhandlers not calling set_open_status() are binary mode only, but the way reset_to_open_binmode worked, calling setmode(fd, 0) would have "reset" their open flags to O_TEXT accidentally. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: Add support for FLUSHO and Ctrl-O.Takashi Yano via Cygwin-patches2021-02-191-0/+11
| | | | - With this patch, FLUSHO and Ctrl-O (VDISCARD) get working.
* Cygwin: pty: Make FLUSHO and Ctrl-O work.Takashi Yano via Cygwin-patches2021-02-195-6/+19
| | | | | - Previously, FLUSHO feature was implemented incompletely. With this patch, FLUSHO and Ctrl-O (VDISCARD) get working.
* Cygwin: pty: Make tty setting NOFLSH work.Takashi Yano via Cygwin-patches2021-02-191-1/+2
| | | | - With this patch, "stty noflsh" gets working in pty.
* Cygwin: pty: Reflect tty settings to pseudo console mode.Takashi Yano via Cygwin-patches2021-02-191-0/+27
| | | | | - With this patch, tty setting such as echo, icanon, isig and onlcr are reflected to pseudo console mode.
* Cygwin: Add console fix regarding Ctrl-Z etc. to release notes.Takashi Yano via Cygwin-patches2021-02-192-0/+13
|
* Cygwin: console: Fix handling of Ctrl-S in Win7.Takashi Yano via Cygwin-patches2021-02-195-246/+98
| | | | | | | - If ENABLE_LINE_INPUT is set, Ctrl-S is handled by Windows if the OS is Windows 7. This conflicts with Ctrl-S handling in cygwin console code. This patch unsets ENABLE_LINE_INPUT flag in cygwin and set it when native app is executed.
* Cygwin: console: Fix SIGWINCH handling in Win7.Takashi Yano via Cygwin-patches2021-02-191-0/+15
| | | | | | | | - If ENABLE_VIRTUAL_TERMINAL_INPUT is not set, changing window height does not generate WINDOW_BUFFER_SIZE_EVENT. This happens if console is in the legacy mode. Therefore, with this patch, the windows size is checked every time in cons_master_thread() if the cosole is in the legacy mode.
* cpuinfo: add AVX features; move SME, SEV/_ES featuresBrian Inglis2021-02-181-21/+23
| | | | | | | Linux 5.11 💕 Valentine's Day Edition 💕 added features and changes: add Intel 0x00000007 EDX:23 avx512_fp16 and 0x00000007:1 EAX:4 avx_vnni; group scattered AMD 0x8000001f EAX Secure Mem/Encrypted Virt features at end: 0 sme, 1 sev, 3 sev_es (more to come not yet displayed)
* cpuinfo: fix check for cpuid 0x80000007 supportBrian Inglis2021-02-181-1/+1
|
* Include malloc.h in libc/stdlib/aligned_alloc.cHans-Peter Nilsson2021-02-181-0/+1
| | | | | | | | | | | | | Without this, for a bare-iron/simulator target such as cris-elf, you'll see, at newlib build time: /x/gccobj/./gcc/xgcc -B/x/gccobj/./gcc/ <many options elided> -c -o lib_a-aligned_alloc.o \ `test -f 'aligned_alloc.c' || echo '/y/newlib/libc/stdlib/'`aligned_alloc.c /y/newlib/libc/stdlib/aligned_alloc.c: In function 'aligned_alloc': /y/newlib/libc/stdlib/aligned_alloc.c:35:10: warning: implicit declaration of function \ '_memalign_r' [-Wimplicit-function-declaration] 35 | return _memalign_r (_REENT, align, size); | ^~~~~~~~~~~
* Cygwin: console: Introduce new thread which handles input signal.Takashi Yano via Cygwin-patches2021-02-173-2/+181
| | | | | | | | | | | | | | - Currently, Ctrl-Z, Ctrl-\ and SIGWINCH does not work in console if the process does not call read() or select(). This is because these are processed in process_input_message() which is called from read() or select(). This is a long standing issue of console. Addresses: https://cygwin.com/pipermail/cygwin/2020-May/244898.html https://cygwin.com/pipermail/cygwin/2021-February/247779.html With this patch, new thread which handles only input signals is introduced so that Crtl-Z, etc. work without calling read() or select(). Ctrl-S and Ctrl-Q are also handled in this thread.
* Complete revert of 2019-08-19, st_atime in libc/include/sys/stat.hHans-Peter Nilsson2021-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The revert-part of the revert-and-fix commit, b99887c4283f a.k.a. "Revert previous change to sys/stat.h and fix cris libgloss", apparently intending to revert f75aa6785151 a.k.a. "Fix regression in cris-elf caused by sys/stat.h change" and fix it in another way, wasn't complete. Although the fix-part added the prerequisite "#undef st_atime" (et al) to gensyscalls, the revert-part didn't revert the "&& !defined(__cris__)" in sys/stat.h, stopping st_atime (et al) from being defined. The effect of the unreverted change is that accessing the struct stat compatibility member names "st_atime" (et al) as in "struct stat mystat; mystat.st_atime;" yields errors, observable for example when building libgfortran in gcc: /x/gcc/libgfortran/intrinsics/stat.c:114:42: error: 'struct stat' has \ no member named 'st_atime'; did you mean 'st_atim'? 114 | sarray->base_addr[8 * stride] = sb.st_atime; | ^~~~~~~~ | st_atim (etc.) Trivially fixed by completing the reversion, removing the "&& !defined(__cris__)" in sys/stat.h. Beware: the net effect of the earlier related change to struct stat in sys/stat.h, leading up to the fix, *does* change its definition as a type. Thankfully, replacing members like "time_t st_atime; long st_spare1;" by "struct timespec st_atim;", ditto st_mtim and st_ctim, is layout-compatible. To wit, that change is "binary compatible". Incidentally, related to the simulator / Linux ABI, there's a transitional stage (see gensyscalls), reloading between "struct stat" (sys/stat.h) and "struct new_stat" (kernel/simulator) as necessary. Tested by a cris-elf gcc build (including libgfortran).
* winsup/doc/posix.xml: add note for getrlimit, setrlimit, xrefs to notesBrian Inglis2021-02-161-44/+57
| | | | | | change notes to see "Implementation Notes" to xref to std-notes; add xref to std-notes to getrlimit, setrlimit; add note to document limitations of getrlimit, setrlimit resources support
* Cygwin: console: Abort read() on signal if SA_RESTART is not set.Takashi Yano via Cygwin-patches2021-02-154-4/+6
| | | | | | | - Currently, console read() keeps reading after SIGWINCH is sent even if SA_RESTART flag is not set. With this patch, read() returns EINTR on SIGWINCH if SA_RESTART flag is not set. The same problem for SIGQUIT and SIGTSTP has also been fixed.
* Cygwin: pty: Fix a bug in input transfer for GDB.Takashi Yano via Cygwin-patches2021-02-151-2/+3
| | | | | - With this patch, not only NL but also CR is treated as a line end in the code checking if input transfer is necessary.
* Cygwin: pty: Reduce unecessary input transfer.Takashi Yano via Cygwin-patches2021-02-125-199/+376
| | | | | | | - Currently, input transfer is performed every time one line is read(), if the non-cygwin app is running in the background. With this patch, transfer is triggered by setpgid() rather than read() so that the unnecessary input transfer can be reduced much in that situation.
* Cygwin: only export tmpfile64 on 32 bitCorinna Vinschen2021-02-121-0/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>