summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* 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.