aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
AgeCommit message (Collapse)AuthorFilesLines
2018-07-20Cygwin: move FP environment exports to common.dinCorinna Vinschen3-2/+5
We only have the symbols defined for i686 by accident since 2013... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-19fix duration handling in sigtimedwaitMark Geisert2-0/+5
2018-07-12Cygwin: Treat PROCESSOR_ARCHITECTURE_INTEL as running under WOW64 on ARM64Corinna Vinschen1-9/+24
Bug in current ARM64 WOW64: GetNativeSystemInfo returns PROCESSOR_ARCHITECTURE_INTEL rather than PROCESSOR_ARCHITECTURE_ARM64. Provide for this. Make code better readable. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-10Cygwin: Don't print FAST_CWD warning in WOW64 on ARM64 systemsCorinna Vinschen1-1/+15
No way to test this, yet. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-10Cygwin: fix a race in the FAST_CWD fallback codeCorinna Vinschen1-22/+17
Guard the entire operation with the FastPebLock critical section used by RtlSetCurrentDirectory_U as well, thus eliminating the race between concurrent chdir/fchdir/SetCurrentDirectory calls. Streamline comment explaining the fallback method. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-06Fix a problem that connection to syslogd fails.Takashi Yano2-19/+17
* fhandler_socket_local.cc (get_inet_addr_local): Change type from 'static int' to 'int' to be callable from syslog.cc. * syslog.cc (connect_syslogd): Use get_inet_addr_local() instead of getsockname() to retrieve name information of the syslogd socket.
2018-07-04Cygwin: Include local ntsecapi.hTakashi Yano1-1/+1
Our local ntsecapi.h wrapper corrects a bug in the definition of SystemFunction036 which otherwise leads to crashes on 32 bit when using RtlGenRandom. The fhandler_socket_local.cc file accidentally included the incorrect w32api version of that file, rather than the local wrapper. Fix it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-03Fix a bug of psiginfo() that changes the orientation of stderr.Takashi Yano1-6/+35
* strsig.cc (psiginfo): Fix the problem that psiginfo() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.
2018-06-29Cygwin: tape: Handle non-standard "no medium" error codeCorinna Vinschen2-5/+26
Certain tape drives (known example: QUANTUM_ULTRIUM-HH6) return the non-standard ERROR_NOT_READY rather than ERROR_NO_MEDIA_IN_DRIVE if no media is present. ERROR_NOT_READY is not documented as valid return code from GetTapeStatus. Without handling this error code Cygwin's tape code can't report an offline state to user space. Fix this by converting ERROR_NOT_READY to ERROR_NO_MEDIA_IN_DRIVE where appropriate. Add a debug_printf to mtinfo_drive::get_status to allow requesting user info without having to rebuild the DLL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27Cygwin: define pthread_tryjoin_np/pthread_timedjoin_np _GNU_VISIBLECorinna Vinschen1-2/+2
These functions are GNU extensions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27Cygwin: pthread_timedjoin_np: return ETIMEDOUT, not EBUSYCorinna Vinschen1-2/+2
pthread_timedjoin_np returns ETIMEDOUT if a thread is still running, not EBUSY as pthread_tryjoin_np. Also, clean up initializing timeout in pthread_tryjoin_np. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27Cygwin: Implement pthread_tryjoin_np and pthread_timedjoin_npCorinna Vinschen7-11/+42
- Move pthread_join to thread.cc to have all `join' calls in the same file (pthread_timedjoin_np needs pthread_convert_abstime which is static inline in thread.cc) - Bump API version Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26Cygwin: Allow to build without experimental AF_UNIX code by defaultCorinna Vinschen8-1/+36
Introduce __WITH_AF_UNIX preprocessor flag to enable the new code Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26Cygwin: add Unicode patch to release notesCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26Cygwin: exceptions: fix FPE exception flagsCorinna Vinschen2-1/+10
The FPE flags for divisions by zero were not implemented Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26Cygwin: signal.h: improve exception flags definitionCorinna Vinschen1-5/+39
- add numbers for readability - add a preprocessor macro for each flag Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-22Fix the handling of out-of-band (OOB) data in a socket.Takashi Yano3-9/+120
* fhandler.h (class fhandler_socket_inet): Add variable bool oobinline. * fhandler_socket_inet.cc (fhandler_socket_inet::fhandler_socket_inet): Initialize variable oobinline. (fhandler_socket_inet::recv_internal): Make the handling of OOB data as consistent with POSIX as possible. Add simulation of inline mode for OOB data as a workaround for broken winsock behavior. (fhandler_socket_inet::setsockopt): Ditto. (fhandler_socket_inet::getsockopt): Ditto. (fhandler_socket_wsock::ioctl): Fix return value of SIOCATMARK command. The return value of SIOCATMARK of winsock is almost opposite to expectation. * fhandler_socket_local.cc (fhandler_socket_local::recv_internal): Remove the handling of OOB data from AF_LOCAL domain socket. Operation related to OOB data will result in an error like Linux does. (fhandler_socket_local::sendto): Ditto. (fhandler_socket_local::sendmsg): Ditto. This fixes the issue reported in following post. https://cygwin.com/ml/cygwin/2018-06/msg00143.html
2018-06-07Bump Cygwin DLL version to 2.11.0Ken Brown1-2/+2
2018-06-07Cygwin: Document clearenv and bump API minorKen Brown2-1/+3
Also add earlier "What changed" items to new-features.xml.
2018-06-07Cygwin: Remove workaround in environ.ccKen Brown1-6/+4
Commit ebd645e on 2001-10-03 made environ.cc:_addenv() add unneeded space at the end of the environment block to "work around problems with some buggy applications." This clutters the code and is presumably no longer needed.
2018-06-07Cygwin: Implement the GNU extension clearenvKen Brown3-0/+24
2018-06-07Cygwin: Allow the environment pointer to be NULLKen Brown2-17/+30
Following glibc, interpret this as meaning the environment is empty.
2018-06-07Cygwin: Clarify some code in environ.ccKen Brown1-1/+7
2018-06-01Cygwin: Add pthread_rwlock_* fix to release notesKen Brown1-0/+3
2018-06-01Declare the pthread_rwlock_* functions if __cplusplus >= 201402LKen Brown1-1/+1
Some of these functions are used in the <shared_mutex> C++ header.
2018-05-29Cygwin: Add stack alignment crash after fork fix to release notesCorinna Vinschen1-0/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-05-29Cygwin: Fixing the math behind rounding down ch.stacklimit to page size.Sergejs Lukanihins1-1/+1
2018-05-29Cygwin: Add buffer underrun fix to release notesCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-05-29Cygwin: normalize_win32_path: Avoid buffer underrunsCorinna Vinschen1-8/+25
Thanks to Ken Harris <Ken.Harris@mathworks.com> for the diagnosis. When backing up tail to handle a "..", the code only checked that it didn't underrun the destination buffer while removing path components. It did *not* take into account that the first backslash in the path had to be kept intact. Example path to trigger the problem: "C:\A..\..\..\B' Fix this by moving the dst pointer to the first backslash so subsequent tests cannot underrun this position. Also make sure that we always *have* a backslash. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-05-29Cygwin: TEST only: Add a buffer underrun assertion to symlink_info::checkCorinna Vinschen1-1/+2
Thanks to Ken Harris <Ken.Harris@mathworks.com> for the diagnosis which led to a buffer underrun in this loop. Revert before release. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-16Cygwin: fix build with GCC 7Yaakov Selkowitz1-9/+5
GCC 7 is able to see straight through this trick, so use a more formal method to avoid the warning. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-04-12Cygwin: fix guard checking for current user's AuthZ contextCorinna Vinschen1-3/+7
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-11Cygwin: add cuinof changes to release textCorinna Vinschen1-0/+5
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-11Cygwin: cpuinfo: Use active CPU count per groupCorinna Vinschen1-20/+36
There are systems with a MaximumProcessorCount not reflecting the actually available CPUs. The ActiveProcessorCount is correct though. So we use ActiveProcessorCount rather than MaximumProcessorCount per group to set group affinity correctly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-11Cygwin: wincap: expose more SYSTEM_INFO members and use as appropriateCorinna Vinschen3-12/+10
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-11Cygwin: cpuinfo: report L3 cache on Intel CPUsCorinna Vinschen1-2/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-09Cygwin: add strtod fix to release notesCorinna Vinschen1-0/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-26Cygwin: AF_LOCAL: fix identifing abstract sockets in FS-related functionsCorinna Vinschen1-6/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-26Cygwin: fix typo in accept on inet and local socketsCorinna Vinschen2-2/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-25Cygwin: delete /dev/kmsg and thus fhandler_mailslot without substitutionCorinna Vinschen13-1042/+623
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-18Cygwin: AF_UNIX: Redesign various aspectsCorinna Vinschen2-190/+442
* Change set_socket_type/get_socket_type to virtual methods * Move various variables into af_unix_shmem_t * Change sun_name_t to match new usage pattern * Move shut_state definition and add a name for the 0 value * Allow marking packet as administrative packet. This allows filtering out info packets exchange between peers and tweak data accordingly. * Rename send_my_name to send_sock_info and send credentials if not called from bind (so the socket was already connected) * Handle SO_PASSCRED in setsockopt/getsockopt * Add input size checking to setsockopt/getsockopt * Use NT functions where appropriate Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-18Cygwin: ntdll.h: Define FSCTL_PIPE_PEEK and NtWaitForSingleObjectCorinna Vinschen1-1/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-18Cygwin: AF_UNIX: Add state_lock to guard manipulating shared state infoCorinna Vinschen2-0/+9
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-18Cygwin: AF_UNIX: Use spinlock rather than SRWLOCKsCorinna Vinschen1-17/+39
We need to share socket info between threads *and* processes. SRWLOCKs are single-process only, unfortunately. Provide a sharable low-profile spinlock instead. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-17Cygwin: tags: drop _EXFUN regexCorinna Vinschen1-2/+0
_EXFUN has been removed a while back Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-14Revert "ctype: align size of category bit fields to small targets needs"Corinna Vinschen2-212/+134
This reverts commit e98d3eb3eb9b6abd897e102031a14b7057641a65. It has accidentally included some work in progress.
2018-03-14ctype: align size of category bit fields to small targets needsCorinna Vinschen2-134/+212
E.g. arm ABI requires -fshort-enums for bare-metal toolchains. Given there are only 29 category enums, the compiler chooses an 8 bit enum type, so a size of 11 bits for the bitfield leads to a compile time error: error: width of 'cat' exceeds its type enum category cat: 11; ^~~ Fix this by aligning the size of the category members to byte borders. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-12Cygwin: mark muto object as NO_COPYCorinna Vinschen1-1/+1
muto in smallprint.cc is missing a NO_COPY. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-12Cygwin: AF_UNIX: store per-socket info in shared memoryCorinna Vinschen4-80/+238
Per-socket info in fhandler isn't correctly shared between multiple instances of th same descriptor. Implement a basic shared info which is shared between all instances of a socket. This also requires to move the fhandler_socket status bits into fhandler_socket_wsock since the data is moved to the shared region for AF_UNIX sockets. Also, drop backing file requirement for socketpair server socket. This will be handled differently in recvmsg/sendmsg. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-11Cygwin: AF_UNIX: fix up thread parameter block allocationCorinna Vinschen1-3/+4
* don't abort on failing allocation, just return with error * make sure the allocation is restricted to a single process Signed-off-by: Corinna Vinschen <corinna@vinschen.de>