summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: fix socketpair prototypeCorinna Vinschen2018-03-092-4/+4
| | | | | | Last parameter is a vector of 2 ints, not a pointer to int Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* describe new locale modifier @cjkwide for user guideThomas Wolff2018-03-081-0/+13
|
* Cygwin: AF_UNIX: implement getsockopt SO_RCVBUF/SO_SNDBUFCorinna Vinschen2018-03-071-0/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: define AF_UNIX_CONNECT_TIMEOUTCorinna Vinschen2018-03-071-2/+5
| | | | | | | Use macro AF_UNIX_CONNECT_TIMEOUT instead of numerical constant for connect timeout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Define FSCTL_PIPE_FLUSHCorinna Vinschen2018-03-071-0/+3
| | | | | | This fsctl might come in handy at one point... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: Implement read, readv, recvfrom, write, writev, sendtoCorinna Vinschen2018-03-071-20/+88
| | | | | | All of these functions just call recvfrom/sendmsg which are still TODO Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: reorder read/write calls in fhandler_socket_unixCorinna Vinschen2018-03-071-4/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: fix accept behaviourCorinna Vinschen2018-03-071-15/+37
| | | | | | | | | * 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>
* Cygwin: AF_UNIX: make sure connect wait thread is cleanly interruptibleCorinna Vinschen2018-03-072-8/+49
| | | | | | | | | | | | | | 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>
* Cygwin: AF_UNIX: some pipe errors may have multiple status codesCorinna Vinschen2018-03-071-3/+26
| | | | | | | | 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>
* Cygwin: AF_UNIX: fix SEGV when sending an empty socket name from connectCorinna Vinschen2018-03-071-2/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: fix creation of npfs handleCorinna Vinschen2018-03-073-25/+23
| | | | | | | | | 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>
* Cygwin: AF_UNIX: Add create_event helper and use throughoutCorinna Vinschen2018-03-071-15/+25
| | | | | | Minimize overhead in creating a nameless event object. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: fix comments and move a macroCorinna Vinschen2018-03-071-6/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: Implement listen, accept4, connect, and othersCorinna Vinschen2018-03-063-65/+774
| | | | | | | | | | | * 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>
* Cygwin: AF_UNIX: fix a couple of thinkos and typosCorinna Vinschen2018-03-061-26/+18
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: create/open pipes relativ to NPFS rootdir handleCorinna Vinschen2018-03-062-22/+68
| | | | | | Only store and manipulate pipe basename. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: initialize rmem/wmem to 256K and use in pipe creationCorinna Vinschen2018-03-061-4/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ntdll.h: Add some missing pipe-related definitionsCorinna Vinschen2018-03-061-2/+25
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sys/socket.h: define MSG_CMSG_CLOEXECCorinna Vinschen2018-03-061-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: export hires counter ntodCorinna Vinschen2018-03-061-0/+1
| | | | | | Needed it new AF_UNIX socket code Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* RTEMS: Use int for _CLOCKID_T_Sebastian Huber2018-03-061-0/+3
| | | | | | | | | Linux and FreeBSD use int as well. In addition, this fixes an Ada incompatiblity problem on 64-bit targets. See also GCC: gcc/ada/libgnarl/s-osinte__rtems.ads Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Make _CLOCKID_T_ system configurableSebastian Huber2018-03-061-0/+3
| | | | | | | Let systems optionally provide the _CLOCKID_T_ type via <machine/_types.h>. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Cygwin: move sun_name_t constructors into fhandler_socket_unix.ccCorinna Vinschen2018-03-052-12/+19
| | | | | | | | | | 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>
* Cygwin: sockets: add bind state, and split out connect state to allow atomic ↵Corinna Vinschen2018-03-051-4/+19
| | | | | | | | | 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>
* Cygwin: drop debug_printf statement from start_transactionCorinna Vinschen2018-03-051-4/+1
| | | | | | | 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>
* Cygwin: cygwait.cc: fix formatting of debug statementCorinna Vinschen2018-03-051-1/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Locale modifier @cjkwide to adjust ambiguous-width in non-CJK localesThomas Wolff2018-03-051-16/+23
| | | | | | | | | | Locale modifier @cjkwide makes Unicode "ambiguous width" characters wide. So ambiguous width characters can be enforced to have width 2 even in non-CJK locales. This gives e.g. users of "Powerline symbols" the opportunity to adjust their width to the desired behaviour (and the behaviour apparently expected by some tools) without having to set a CJK locale and without losing consistence of terminal character width with wcwidth/wcswidth locale width.
* Cygwin: AF_UNIX: drop try/except block in bind methodCorinna Vinschen2018-03-021-27/+21
| | | | | | The caller already does it anyway. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: AF_UNIX: create pipes with file attribute R/W accessCorinna Vinschen2018-03-021-2/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: accept4: Fix resource leakCorinna Vinschen2018-03-022-0/+4
| | | | | | | The new implementation neglected to release the file descriptor in case of error. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: remove outdated commentCorinna Vinschen2018-03-021-1/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fhandler_socket_unix: implement socket, bind, and closeCorinna Vinschen2018-03-022-88/+493
| | | | | | | | ...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>
* Cygwin: add transform_chars_af_unix helperCorinna Vinschen2018-03-022-2/+13
| | | | | | | | | 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>
* Cygwin: small_s[w]printf: add '_' modifier to print lower case hex digitsCorinna Vinschen2018-03-021-46/+74
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointerCorinna Vinschen2018-03-023-6/+12
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ntdll.h: add definitions required for pipe-based AF_UNIXCorinna Vinschen2018-03-021-1/+47
| | | | | | Also remove redundant declaration of RtlInitEmptyUnicodeString Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add global stdio streams support for reent small.Our Air Quality2018-03-013-11/+56
|
* Cygwin: convert sun_name_t into classCorinna Vinschen2018-03-012-13/+22
| | | | | | | 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>
* Cygwin: add AF_UNIX reparse points to path handlingCorinna Vinschen2018-03-013-8/+23
| | | | | | | | | | * 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>
* Cygwin: move transaction helpers into ntdll.hCorinna Vinschen2018-03-012-36/+35
| | | | | | We'll need them elsewhere in future. Signed-off-by: Corinna Vinschen <corinna@vinschen.de
* Cygwin: ntdll.h: drop macros available in mingw-w64 headersCorinna Vinschen2018-03-011-8/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: path.cc: clean up includesCorinna Vinschen2018-03-011-12/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: path_conv: rename is_rep_symlink to is_known_reparse_pointCorinna Vinschen2018-03-015-13/+14
| | | | | | | ...in preparation of reusing this flag for other types of reparse points, not only symlinks. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: improve storage and handling of AF_UNIX socket pathCorinna Vinschen2018-02-282-29/+77
| | | | | | Define new struct sun_name_t and use throughout internally. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fhandler_socket_unix: store peer credentials in ucred memberCorinna Vinschen2018-02-284-22/+30
| | | | | | | * Split out cygwin/_ucred.h file * drop local credentials Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: cleanup header including within network-releated filesCorinna Vinschen2018-02-288-116/+43
| | | | | | | | | | | * Rearrange includes and drop unneccessary ones. * Don't pull in cygwin/socket.h into sys/un.h just to get sa_family_t. Include sys/types.h and use __sa_family_t instead. * start including Windows headers using the w32api/ path prefix Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sockets: Fix fstat on unnamed socketsCorinna Vinschen2018-02-271-1/+1
| | | | | | | Calling fhandler_socket::fstat from fhandler_socket::fstat recursively is not a good idea... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: reduce size of fhandler_cygdrivenewlib-snapshot-20180226Corinna Vinschen2018-02-262-27/+26
| | | | | | | | | | | fhandler_cygdrive has a size of 696 bytes on x86_64, while the next biggest fhandler type, fhandler_pty_master, is 584 bytes. The members responsible for the size are private to opendir/readdir/closedir usage. fhandler_disk_file stores private readdir data in DIR->__d_internal instead. Use equivalent method with fhandler_cygdrive. This drops the size to 464 bytes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sockets: Add missing cleanup if socket/socketpair creation failsCorinna Vinschen2018-02-261-1/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>