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
2018-03-13Cygwin: mark muto object as NO_COPYCorinna Vinschen
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 Vinschen
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 Vinschen
* 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>
2018-03-11Cygwin: AF_UNIX: use get_unique_id to create pipe nameCorinna Vinschen
It's the same as get_plain_ino in this case, but it's cleaner and easier to understand. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-10Cygwin: AF_UNIX: fix dupCorinna Vinschen
Reorder so fhandler_socket::dup is called first. Add missing duplication of backing_file_handle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-10Cygwin: AF_UNIX: Add fixup_after_exec methodCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-10Cygwin: AF_UNIX: fix creating abstract socket symlink nameCorinna Vinschen
Add missing NUL termination when creating symlink representing abstract socket. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-09Cygwin: don't skip O_TMPFILE files in readdirCorinna Vinschen
Bad idea. A file hidden from directory listings is not seen by rm either, so it never calls unlink for the file and a recursive removal of the parent directory fails with "directory not empty". Fix comments accordingly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-09Cygwin: AF_UNIX: Implemant socketpairCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-09Cygwin: fix socketpair prototypeCorinna Vinschen
Last parameter is a vector of 2 ints, not a pointer to int Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-08describe new locale modifier @cjkwide for user guideThomas Wolff
2018-03-07Cygwin: AF_UNIX: implement getsockopt SO_RCVBUF/SO_SNDBUFCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: define AF_UNIX_CONNECT_TIMEOUTCorinna Vinschen
Use macro AF_UNIX_CONNECT_TIMEOUT instead of numerical constant for connect timeout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: Define FSCTL_PIPE_FLUSHCorinna Vinschen
This fsctl might come in handy at one point... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: Implement read, readv, recvfrom, write, writev, sendtoCorinna Vinschen
All of these functions just call recvfrom/sendmsg which are still TODO Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: reorder read/write calls in fhandler_socket_unixCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: fix accept behaviourCorinna Vinschen
* Use correct cygwait/WFSO invocation to not die on cancel and signals uncontrolled. * Manage io handles under io_lock. * Copy peer address to user space under SEH to avoid a resource leak. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: make sure connect wait thread is cleanly interruptibleCorinna Vinschen
Using TerminateThread potentially leaks resources. In our case, the connect wait thread may be forcefully terminated after having successfully opened a client side pipe handle. If this occurs, we have a stale pipe server instance, so the pipe will never be closed as long as the process lives. Avoid this by changing the npfs handle to non-blocking, so we can wait on a termination event object from inside the thread itself and cleanly exit from the thread instead of terminating. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: some pipe errors may have multiple status codesCorinna Vinschen
Depending on the exact circumstances, some erros are indicated by different status codes. Add helper macros to handle them together. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: fix SEGV when sending an empty socket name from connectCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: fix creation of npfs handleCorinna Vinschen
The handle to the device is never needed. As the name impies, FSCTL_PIPE_WAIT works on the file system, not on the device level. Drop opening the device and make sure to open only one handle to NPFS. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: Add create_event helper and use throughoutCorinna Vinschen
Minimize overhead in creating a nameless event object. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-07Cygwin: AF_UNIX: fix comments and move a macroCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: AF_UNIX: Implement listen, accept4, connect, and othersCorinna Vinschen
* Implement helper functions * Improve bind * Implement setting blocking, ioctl(FIONBIO), fcntl(F_SETFL) * Implement close_on_exec and fixup_after_fork * Allow overriding sun_path and peer_sun_path * Improve comments Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: AF_UNIX: fix a couple of thinkos and typosCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: AF_UNIX: create/open pipes relativ to NPFS rootdir handleCorinna Vinschen
Only store and manipulate pipe basename. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: AF_UNIX: initialize rmem/wmem to 256K and use in pipe creationCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: ntdll.h: Add some missing pipe-related definitionsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: sys/socket.h: define MSG_CMSG_CLOEXECCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-06Cygwin: export hires counter ntodCorinna Vinschen
Needed it new AF_UNIX socket code Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-05Cygwin: move sun_name_t constructors into fhandler_socket_unix.ccCorinna Vinschen
They are only used there anyway and it allows to use the AF_UNIX macro without tweaking header files. While at it, improve both constructors. The default constructor now creates the name of an unnamed socket, the constructor taking parameters carefully checks its input. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-05Cygwin: sockets: add bind state, and split out connect state to allow atomic ↵Corinna Vinschen
operation The connect state was stored in a bitfield which is not safe to do atomic operations on. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-05Cygwin: drop debug_printf statement from start_transactionCorinna Vinschen
start_transaction is now defined in ntdll.h and we can't rely on debug_printf being available Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-05Cygwin: cygwait.cc: fix formatting of debug statementCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-03Cygwin: AF_UNIX: drop try/except block in bind methodCorinna Vinschen
The caller already does it anyway. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-03Cygwin: AF_UNIX: create pipes with file attribute R/W accessCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-03Cygwin: accept4: Fix resource leakCorinna Vinschen
The new implementation neglected to release the file descriptor in case of error. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-02Cygwin: remove outdated commentCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-02Cygwin: fhandler_socket_unix: implement socket, bind, and closeCorinna Vinschen
...plus lots of helper functions. Add comment to explain how everything works. This comment will be improved while implementing the yet missing parts. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-02Cygwin: add transform_chars_af_unix helperCorinna Vinschen
This function is going to be used for transposing sun_path of abstract sockets. This also adds a transposition of the NUL character to tfx_chars since NUL-bytes in abstract socket names are perfectly valid. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-02Cygwin: small_s[w]printf: add '_' modifier to print lower case hex digitsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-02Cygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointerCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-02Cygwin: ntdll.h: add definitions required for pipe-based AF_UNIXCorinna Vinschen
Also remove redundant declaration of RtlInitEmptyUnicodeString Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-01Cygwin: convert sun_name_t into classCorinna Vinschen
Add constructors and new/delete operators to make sure sun_name_t objects are allocated on the cygheap. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-01Cygwin: add AF_UNIX reparse points to path handlingCorinna Vinschen
* check_reparse_point_target returns a path flag mask, rather than just 1. Return PATH_SYMLINK | PATH_REP for symlinks and directory mount points, PATH_SOCKET | PATH_REP for AF_UNIX sockets. * Define Cygwin AF_UNIX socket reparse tag and GUID in ntdll.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-01Cygwin: move transaction helpers into ntdll.hCorinna Vinschen
We'll need them elsewhere in future. Signed-off-by: Corinna Vinschen <corinna@vinschen.de
2018-03-01Cygwin: ntdll.h: drop macros available in mingw-w64 headersCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-01Cygwin: path.cc: clean up includesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-01Cygwin: path_conv: rename is_rep_symlink to is_known_reparse_pointCorinna Vinschen
...in preparation of reusing this flag for other types of reparse points, not only symlinks. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-02-28Cygwin: improve storage and handling of AF_UNIX socket pathCorinna Vinschen
Define new struct sun_name_t and use throughout internally. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>