summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Cygwin: Have tmpfile(3) use O_TMPFILEMark Geisert2021-02-122-0/+23
| | | | | | | | | | Per discussion on cygwin-developers, a Cygwin tmpfile(3) implementation has been added to syscalls.cc. This overrides the one supplied by newlib. Then the open(2) flag O_TMPFILE was added to the open call that tmpfile internally makes. This v2 patch removes O_CREAT from open() call as O_TMPFILE obviates it. Note that open() takes a directory's path but returns an fd to a file.
* Cygwin: fhandler: clean up 'copyto' logicCorinna Vinschen2021-02-103-197/+197
| | | | | | | | | | | | | | | | | Analyzing the fhandler::copyto logic shows that the fhandler_base::reset method was only called from copyto anyway. Trying to convert reset to a protected method uncovered that the copyto method is actually thought upside down from an object oriented POV. Rather than calling copyto, manipulating the object given as parameter, rename the method to copy_from, which manipulates the calling object itself with data from the object given as parameter. Eventually make reset a protected method and rename it to _copy_from_reset_helper to clarify it's only called from copy_from. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: check path_conv_handle for NULL before trying to dup itCorinna Vinschen2021-02-101-3/+4
| | | | | | | | path_conv_handle::dup calls DuplicateHandle unconditionally, but we only have a handle in some cases. Check handle for being non-NULL before calling DuplicateHandle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: drop path_conv::reset_conv_handleCorinna Vinschen2021-02-103-3/+2
| | | | | | | | | | path_conv::reset_conv_handle is only called after fhandler::copyto has been called. This duplicated the path_conv_handle if there was one, so just setting the conv handle to NULL potentially produces a handle leak. Replace reset_conv_handle calls with calls to close_conv_handle and drop the reset_conv_handle method. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: don't copy path_conv in fhandler_base::resetCorinna Vinschen2021-02-101-1/+0
| | | | | | | | | | | | There's a slim chance that duplicating fhandlers may end up duplicating path_conv_handle handles twice ending up with a handle leak, due to fhandler_base::reset calling path_conv::operator<< after the only caller, fhandler::copyto, already called path_conv::operator=. Just drop the call which basically duplicates what path_conv::operator= already did. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Revert "Cygwin: fstat_helper: always use handle in call to get_file_attribute"Ken Brown2021-02-091-4/+3
| | | | | | | | | | | | This reverts commit 76dca77f049271e2529c25de8a396e65dbce615d. That commit was based on the incorrect assumption that get_stat_handle, when called on a FIFO in fstat_helper, would always return a handle that is safe to use for getting the file information. That assumption is true in many cases but not all. For example, if the call to fstat_helper arises from a call to fstat(2) on a FIFO that has been opened for writing, then get_stat_handle will return a pipe handle instead of a file handle.
* Cygwin: drop ftw.h in favor of new newlib ftw.hCorinna Vinschen2021-02-091-63/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* FTW Port for NewlibEshan dhawan2021-02-094-1/+254
| | | | Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
* Removed Soft float from MIPSEshan dhawan2021-02-052-41/+18
| | | | | | | | | | | This Patch removes Soft Float code from MIPS. Instead It adds the soft float code from RISCV The code came from FreeBSD and assumes the FreeBSD softfp implementation not the one with GCC. That was an overlooked and fixed in the other fenv code already. Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
* RISC-V: Use __bss_start for the starting point of .bss.Yeting Kuo2021-02-051-1/+1
| | | | It's more flexible for the positions of .bss and .data.
* fhandler_serial.cc: MARK and SPACE parity for serial portMarek Smetana2021-02-022-1/+11
|
* Cygwin: recognize native Windows AF_UNIX sockets as reparse pointsKen Brown2021-02-011-0/+4
| | | | | | | | | | | | | Allow check_reparse_point_target to recognize reparse points with reparse tag IO_REPARSE_TAG_AF_UNIX. These are used in recent versions of Windows 10 to represent AF_UNIX sockets. check_reparse_point_target now returns PATH_REP on files of this type, so that they are treated as known reparse points (but not as sockets). This allows tools like 'rm', 'ls', etc. to operate on these files. Addresses: https://cygwin.com/pipermail/cygwin/2020-September/246362.html https://cygwin.com/pipermail/cygwin/2021-January/247666.html
* Cygwin: include/cygwin/limits.h: new headerKen Brown2021-02-012-47/+98
| | | | | | | | | | | | | | | | The new header defines some Cygwin-specific limits, using private names. It is included by include/limits.h. For example, we now have #define __OPEN_MAX 3200 in include/cygwin/limits.h and #define OPEN_MAX __OPEN_MAX in include/limits.h. The purpose is to hide implementation details from users who view <limits.h>.
* Cygwin: remove the OPEN_MAX_MAX macroKen Brown2021-02-017-17/+14
| | | | | | | Replace all occurrences of OPEN_MAX_MAX by OPEN_MAX, and define the latter to be 3200, which was the value of the former. In view of the recent change to getdtablesize, there is no longer a need to distinguish between these two macros.
* Cygwin: sysconf, getrlimit: don't call getdtablesizeKen Brown2021-02-012-14/+2
| | | | | | Now that getdtablesize always returns OPEN_MAX_MAX, we can simplify sysconf(_SC_OPEN_MAX) and getrlimit(RLIMIT_NOFILE) to just use that same constant instead of calling getdtablesize.
* Cygwin: getdtablesize: always return OPEN_MAX_MAXKen Brown2021-02-011-1/+1
| | | | | | | | | | | | | | | | | | According to the Linux man page for getdtablesize(3), the latter is supposed to return "the maximum number of files a process can have open, one more than the largest possible value for a file descriptor." The constant OPEN_MAX_MAX is the only limit enforced by Cygwin, so we now return that. Previously getdtablesize returned the current size of cygheap->fdtab, Cygwin's internal file descriptor table. But this is a dynamically growing table, and its current size does not reflect an actual limit on the number of open files. With this change, gnulib now reports that getdtablesize and fcntl(F_DUPFD) work on Cygwin. Packages like GNU tar that use the corresponding gnulib modules will no longer use gnulib replacements on Cygwin.
* Cygwin: exceptions.cc: Suspend all threads in sig_handle_tty_stop().Takashi Yano via Cygwin-patches2021-02-011-0/+2
| | | | | | | - Currently, thread created by pthread_create() is not suspended by the signal SIGTSTP. For example, even if a process with a thread is suspended by Ctrl-Z, the thread continues running. This patch fixes the issue.
* Cygwin: console: Align the behaviour against signal with pty.Takashi Yano via Cygwin-patches2021-02-011-1/+2
| | | | | | | | - Currently, read() returns -1 with EINTR if the process is suspended by Ctrl-Z and resumed by fg command, while pty continues to read. For example, xxd command stops with error "Interrupted system call" after Ctrl-Z and fg. This patch aligns the behaviour with pty (and Linux).
* Cygwin: pty: Make slave read() thread-safe.Takashi Yano via Cygwin-patches2021-02-011-0/+6
| | | | | - Currently slave read() is somehow not thread-safe. This patch fixes the issue.
* Cygwin: console: Make read() thread-safe.Takashi Yano via Cygwin-patches2021-02-013-5/+18
| | | | | - Currently read() is somehow not thread-safe. This patch fixes the issue.
* Cygwin: fchmodat: add limited support for AT_SYMLINK_NOFOLLOWKen Brown2021-01-291-5/+15
| | | | | | | | | | | | Allow fchmodat with the AT_SYMLINK_NOFOLLOW flag to succeed on non-symlinks. Previously it always failed, as it does on Linux. But POSIX permits it to succeed on non-symlinks even if it fails on symlinks. The reason for following POSIX rather than Linux is to make gnulib report that fchmodat works on Cygwin. This improves the efficiency of packages like GNU tar that use gnulib's fchmodat module. Previously such packages would use a gnulib replacement for fchmodat on Cygwin.
* Cygwin: pty: Allow multiple apps to enable pseudo console simultaneously.Takashi Yano via Cygwin-patches2021-01-286-93/+314
| | | | | | | - After commit bb428520, there has been the disadvantage: 7) Pseudo console cannot be activated if it is already activated for another process on same pty. This patch clears this disadvantage.
* Cygwin: pty: Make apps using console APIs be able to debug with gdb.Takashi Yano via Cygwin-patches2021-01-286-42/+279
| | | | | | | | | | - After commit bb428520, there has been the disadvantage: 2) The apps which use console API cannot be debugged with gdb. This is because pseudo console is not activated since gdb uses CreateProcess() rather than exec(). Even with this limitation, attaching gdb to native app, in which pseudo console is already activated, works. This patch clears this disadvantage.
* Cygwin: pty: Keep code page between non-cygwin apps.Takashi Yano via Cygwin-patches2021-01-283-0/+11
| | | | | | | | | - After commit bb428520, there has been the disadvantage: 4) Code page cannot be changed by chcp.com. Acctually, chcp works itself and changes code page of its own pseudo console. However, since pseudo console is recreated for another process, it cannot inherit the code page. This patch clears this disadvantage.
* Cygwin: pty: Inherit typeahead data between two input pipes.Takashi Yano via Cygwin-patches2021-01-285-147/+504
| | | | | | | | | | | | | | | - PTY has a problem that the key input, which is typed during windows native app is running, disappears when it returns to shell. This is beacuse pty has two input pipes, one is for cygwin apps and the other one is for native windows apps. The key input during windows native program is running is sent to the second input pipe while cygwin shell reads input from the first input pipe. This issue had been fixed once by commit 29431fcb, however, the new implementation of pseudo console support by commit bb428520 could not inherit this feature. This patch realize transfering input data between these two pipes bidirectionally by utilizing cygwin-console-helper process. The helper process is launched prior to starting the non-cygwin app, however, exits immediately unlike previous implementation.
* Cygwin: Align *utime*() with POSIX/glibcCorinna Vinschen2021-01-262-5/+5
| | | | | | Followup to previous patch, this time matching definitions in Cygwin Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Align *utime*() with POSIX/glibcSebastian Huber2021-01-263-6/+6
| | | | | | | Change the prototypes to be in line with POSIX/glibc. This may fix issues with new warnings produced by GCC 11. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Cygwin: chown: make sure ctime gets updated when necessaryKen Brown2021-01-251-5/+8
| | | | | | | | | | | | Following POSIX, ensure that ctime is updated if chown succeeds, unless the new owner is specified as (uid_t)-1 and the new group is specified as (gid_t)-1. Previously, ctime was unchanged whenever the owner and group were both unchanged. Aside from POSIX compliance, this fix makes gnulib report that chown works on Cygwin. This improves the efficiency of packages like GNU tar that use gnulib's chown module. Previously such packages would use a gnulib replacement for chown on Cygwin.
* syscalls.cc: Deduplicate removeBen Wijen2021-01-251-13/+4
| | | | | The remove code is already in the _remove_r function. So, just call the _remove_r function.
* Cygwin: console: Add missing guard regarding attach_mutex.Takashi Yano via Cygwin-patches2021-01-251-0/+27
| | | | | - The commit a5333345 did not fix the problem enough. This patch provides additional guard for the issue.
* syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTEBen Wijen2021-01-254-39/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think we don't need an extra flag as we can utilize: access & FILE_WRITE_ATTRIBUTES What do you think? Ben Wijen (1): syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE winsup/cygwin/ntdll.h | 3 ++- winsup/cygwin/syscalls.cc | 22 +++++++-------- winsup/cygwin/wincap.cc | 11 ++++++++ winsup/cygwin/wincap.h | 56 ++++++++++++++++++++------------------- 4 files changed, 53 insertions(+), 39 deletions(-) -- 2.30.0 >From 2d0ff6fec10d03c24d11c747852018b7bc1136ac Mon Sep 17 00:00:00 2001 In-Reply-To: <20210122105201.GD810271@calimero.vinschen.de> References: <20210122105201.GD810271@calimero.vinschen.de> From: Ben Wijen <ben@wijen.net> Date: Tue, 17 Dec 2019 15:15:25 +0100 Subject: [PATCH v3 1/8] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE Implement wincap.has_posix_unlink_semantics_with_ignore_readonly and when set skip setting/clearing of READONLY attribute and instead use FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
* Cygwin: ptsname_r: always return an error number on failureKen Brown2021-01-222-1/+4
| | | | | | | | | | | | Return EBADF on a bad file descriptor. Previously 0 was returned, in violation of the requirement in https://man7.org/linux/man-pages/man3/ptsname_r.3.html that an error number should be returned on failure. We are intentionally deviating from Linux, on which ENOTTY is returned. Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00245.html
* Cygwin: normalize_posix_path: fix error handling when .. is encounteredKen Brown2021-01-222-1/+7
| | | | | | | | | | When .. is in the source path and the path prefix exists but is not a directory, return ENOTDIR instead of ENOENT. This fixes a POSIX compliance issue for realpath(3): https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00214.html
* Cygwin: Move post-dir unlink checkBen Wijen2021-01-222-20/+28
| | | | | | | | Move post-dir unlink check from fhandler_disk_file::rmdir to _unlink_nt_post_dir_check If a directory is not removed through fhandler_disk_file::rmdir we can now make sure the post dir check is performed.
* Cygwin: console: Fix "Bad file descriptor" error in script command.Takashi Yano via Cygwin-patches2021-01-203-7/+105
| | | | | | - After the commit 72770148, script command exits occasionally with the error "Bad file descriptor" if it is started in console on Win7 and non-cygwin process is executed. This patch fixes the issue.
* Cygwin: pty: Reduce buffer size in get_console_process_id().Takashi Yano via Cygwin-patches2021-01-201-2/+2
| | | | | | - The buffer used in get_console_process_id(), introduced by commit 72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7. Therefore, the buffer size has been reduced.
* Cygwin: pty: Lessen the side effect of workaround for rlwarp.Takashi Yano via Cygwin-patches2021-01-191-4/+12
| | | | | - This patch lessens the side effect of the workaround for rlwrap introduced by commit 4e16b033.
* Cygwin: spawn.cc: Fix typo in comment by commit 974e6d76.Takashi Yano via Cygwin-patches2021-01-191-1/+1
|
* Cygwin: rmdir: handle /dev in fhandler_dev::rmdirCorinna Vinschen2021-01-193-2/+8
| | | | | | | The isdev_dev check in rmdir is unclean. Create a virtual method fhandler_dev::rmdir to handle this transparently. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: document a recent bug fixKen Brown2021-01-181-0/+3
| | | | | This documents commit aec64798, "Cygwin: add flag to indicate reparse points unknown to WinAPI".