Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
AgeCommit message (Collapse)Author
2017-01-20Add release message for commit ca3e3bcCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Cleanup fhandler_console::read for readabilityCorinna Vinschen
- Drop virtual_key_code (only used once) - Convert macros wch and control_key_state to const vars unicode_char and ctrl_key_state. - Fix formatting Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19miscfuncs.cc: Revert exclusion of inclusion of exception.hCorinna Vinschen
x86 still needs it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Simplify check for Alt-NumpadCorinna Vinschen
Create two new inline functions is_alt_numpad_key(PINPUT_RECORD) and is_alt_numpad_event(PINPUT_RECORD) which contain the actual checks. Call these functions from fhandler_console::read and peek_console for better readability. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19miscfuncs.h: Drop now unneeded getentropy declarationCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19miscfuncs.cc: Drop unneeded includes and unused global variableCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19check_iovec: Change test to be more robust against invalid iovcnt valuesCorinna Vinschen
Stop running wild if iovcnt is < 0 to begin with. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Don't assert on sum of iov_len overflowing an ssize_tCorinna Vinschen
Rather return EINVAL per POSIX. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Move string functions from miscfunc.cc to strfuncs.ccCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Move getentropy/getrandom into own fileCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Fix copy/paste buglet in commentCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Add release message for commit 4652cc4Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-19Handle Alt+Numpad key sequences in console input and selectCorinna Vinschen
{p}select/{p}poll completely ignored Alt+Numpad key sequences in console input which results in newer readline using pselect to fail handling such sequences correctly. See https://cygwin.com/ml/cygwin/2017-01/msg00135.html During debugging and testing it turned out that while reading console input, single key presses during an Alt+Numpad sequences where not ignored, so ultimately a sequence like Alt-down Numpad-1 Numpad-2 Numpad-3 whihc is supposed to result in a single character in the input stream will actually result in 4 chars in the input stream, three control sequences and the actual character. Both problems should be fixed by this patch. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-14Add release message for commit 688d943Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-14Always try to write complete incoming buffer on pipes and fifosCorinna Vinschen
This patch fixes the following problem: Commit 9636c426 refactored the pipe code especially to make sure to call WriteFile only with chunks matching the maximum atomic write count. This accidentally introduced a small change in behaviour on blocking pipes due to the success case falling through into the error case. Rather then writing atomic chunks until all bytes are written, the code immediately broke from the loop after writing the first chunk, basically the same as in case of non-blocking writes. This behaviour is not compliant to POSIX which requires "Write requests to a pipe or FIFO [...] * If the O_NONBLOCK flag is clear, a write request may cause the thread to block, but on normal completion it shall return nbyte." Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-13Add release message for commit 6ed4753Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-13rename: Refactor "new file already exists and rename fails" caseCorinna Vinschen
If newfile already exists and is in use, trying to overwrite it with NtSetInformationFile(FileRenameInformation) fails exactly as if we don't have the permissions to delete it. Unfortunately the return code is the same STATUS_ACCESS_DENIED, so we have no way to distinguish these cases. What we do here so far is to start a transaction to delete newfile. If this open fails with a transactional error we stop the transaction and retry opening the file without transaction. But, here's the problem: If newfile is in use, NtOpenFile(oldfile) naturally does NOT fail with a transactional error. Rather, the subsequent call to unlink_nt(newfile) does, because there's another handle open to newfile outside a transaction. However, the code does not check if unlink_nt fails with a transactional error and so fails to retry without transaction. This patch recifies the problem and checks unlink_nt's status as well. Refactor code to get rid of goto into another code block. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-12FAST_CWD: adjust the initial search scopeJohannes Schindelin
A *very* recent Windows build adds more code to the preamble of RtlGetCurrentDirectory_U() so that the previous heuristic failed to find the call to the locking routine. This only affects the 64-bit version of ntdll, where the 0xe8 byte is now found at offset 40, not the 32-bit version. However, let's just double the area we search for said byte for good measure. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-10Fix formatting in pinfo.ccCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-10Document latest Cygwin changesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-10Add Erik Bray to Cygwin CONTRIBUTORSCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-10Add a /proc/<pid>/environ proc file handler, analogous to /proc/<pid>/cmdline.Erik M. Bray
2017-01-10Add a _pinfo.environ() method analogous to _pinfo.cmdline(), and others.Erik M. Bray
Returns the process's environment concatenated into a single block of null-terminated strings, along with the length of the environment block. Adds an associated PICOM_ENVIRON commune_process handler.
2017-01-10Move the core environment parsing of environ_init into a new ↵Erik M. Bray
win32env_to_cygenv function. win32env_to_cygwenv handles converting wchar to char and some other minor taks. Optionally it handles converting any paths in variables to posix paths. This will be useful for implementing /proc/<pid>/environ
2017-01-09Return the correct value for getsockopt(SO_REUSEADDR) after setting ↵Erik M. Bray
setsockopt(SO_REUSEADDR, 1).
2017-01-09Don't free statically allocated sys_privsCorinna Vinschen
commit 67fd2101 introduced a bad bug. Changing sys_privs to a static area and just returning a pointer is nice... *if* the calling code doesn't call free() on it. Make sure callers check pointer for sys_privs and refrain from calling free, if so. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-12-17Export getentropy and getrandom callsCorinna Vinschen
getentropy per OpenBSD http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2 getrandom per Linux http://man7.org/linux/man-pages/man2/getrandom.2.html Note that GRND_NONBLOCK is not handled
2016-12-15Fix some broken links in Cygwin FAQJon Turney
GNU no longer encourages the use of documentation mirrors, to avoid referring to obsolete documentation. Also www.fsf.org/manual/ is just a redirect to www.gnu.org/manual/ Links to using-utils.html #fragments are no longer correct as each utility is now a separate page, since 646745cb. indiana.edu seems to have moved XLiveCD information, without a redirect. Linking to clean_setup.pl on cygwin.com doesn't work, as direct downloads aren't allowed, so instead state where it can be found on a mirror. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-12-14Define RtlGenRandom correctly in ntsecapi.h wrapperCorinna Vinschen
Include ntsecapi.h where required and just redefine RtlGenRandom correctly in the ntsecapi.h wrapper. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-12-14Rearrange RNG code slightlyCorinna Vinschen
In preparation of exporting getentropy/getrandom to userspace, rearrange code a bit: - Define RtlGenRandom in ntdll.h. - Drop calls to getentropy in favor of RtlGenRandom (fhandler_socket, fhandler_dev_random). - Add try/except blocks in fhandler_dev_random to return EFAULT rather than crashing if buffer pointer is invalid. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-12-13Cygwin: Add release messages for last two checkinsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-12-13Fix incorrect path conversion on non-existent files on network sharesCorinna Vinschen
NtOpenFile/NtCreateFile on non-existent paths on network drives has a bug. Assuming a path Z:\dir\file. Further assuming that Z:\dir does not exist. The first NtOpenFile("Z:\dir\file") correctly returns STATUS_OBJECT_PATH_NOT_FOUND. Subsequent calls incorrectly return STATUS_OBJECT_NAME_NOT_FOUND. This appears to be some kind of caching behaviour. Waiting a while before repeating the call correctly returns STATUS_OBJECT_PATH_NOT_FOUND again. This patch works around the observed misbehaviour. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-12-13Check for .exe file in cygwin_conv_pathCorinna Vinschen
So far, when converting from POSIX to Windows notation, cygwin_conv_path fails to check for .exe suffix, so /path/foo did not return /path/foo.exe even if this file exists. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-12-06Cygwin 2.6.1: Add missing release textCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-28path_conv: When encountering a ".(/)+" sequence, skip *all* slashesCorinna Vinschen
The original code only skipped the "./", but missed to test if more trailing slashes are present. This in turn leads to invalid conversion. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24regex: Fix typo in CHaddrangeCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24cygutils: Fix resource leak in get_short_pathsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Fix typo in kill(1)Corinna Vinschen
buf is just a local buffer, sig is ultimately pointing to the signal string. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24_pinfo::set_ctty: Check potential NULL pointer in debug_printf statementCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Eliminate unused parameter from path_conv::eq_workerCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Remove redundant check for NULL pointer in cygwin_exception::dump_exceptionCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Fix copy/paste typo in fhandler_console::scroll_buffer_screenCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Don't allow sending invalid signals from user spaceCorinna Vinschen
Don't allow signal 0 in signal(2), sigaction(2), siginterrupt(3). Don't allow any signal in sigqueue(3) but explicitely handle signal 0 as in kill(2). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24raise: Add missing extern "C"Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24login_tty: Rewrite following FreeBSD's tracesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24fcwd_access_t: Add missing breaks in f_cwd pointer computationCorinna Vinschen
Fixes Coverity CIDs 59893/59894 Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Add comments to intentional switch fallthroughsCorinna Vinschen
Clarify Coverity "Missing break in switch" messages. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-24Add length check creating domain\group stringsCorinna Vinschen
Fix Coverity CID 153932 Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-11-22Provide <memory.h>Sebastian Huber
Provide <memory.h> for all standard Newlib targets and remove Cygwin-specific header. Most POSIX like systems provide this historic header. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-11-17Move pthread types to <sys/_pthreadtypes.h>Sebastian Huber
This makes it possible provide operating system specific types for <pthread.h>. It is in line with the FreeBSD header file structure and allows a future cleanup of <pthread.h> to not expose unrelated things via <sys/types.h> and <unistd.h>. Glibc uses the similar <bits/pthreadtypes.h> for this purpose. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>