]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
6 years agoCygwin: add strtod fix to release notes
Corinna Vinschen [Mon, 9 Apr 2018 09:48:33 +0000 (11:48 +0200)]
Cygwin: add strtod fix to release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agostrtod: Convert 64 bit double to 64 bit int during computation
Corinna Vinschen [Mon, 9 Apr 2018 09:31:04 +0000 (11:31 +0200)]
strtod: Convert 64 bit double to 64 bit int during computation

The gdtoa implementation uses the type long, defined as Long, in lots
of code.  For historical reason newlib defines Long as int32_t instead.

This works fine, as long as floating point exceptions are not enabled.
The conversion to 32 bit int can lead to a FE_INVALID situation.

Example:

  const char *str = "121645100408832000.0";
  char *ptr;

  feenableexcept (FE_INVALID);
  strtod (str, &ptr);

This leads to the following situation in strtod

  double aadj;
  Long L;

  [...]
  L = (Long)aadj;

For instance, on x86_64 the code here is

  cvttsd2si %xmm0,%eax

At this point, aadj is 2529648000.0 in our example.  The conversion to
32 bit %eax results in a negative int value, thus the conversion is
invalid.  With feenableexcept (FE_INVALID), a SIGFPE is raised.

Fix this by always using 64 bit ints here if double is not a 32 bit type
to avoid this type of FP exceptions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: fix iswupper_l in !_MB_CAPABLE case
Corinna Vinschen [Tue, 27 Mar 2018 10:35:27 +0000 (12:35 +0200)]
newlib: fix iswupper_l in !_MB_CAPABLE case

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_LOCAL: fix identifing abstract sockets in FS-related functions
Corinna Vinschen [Mon, 26 Mar 2018 16:11:10 +0000 (18:11 +0200)]
Cygwin: AF_LOCAL: fix identifing abstract sockets in FS-related functions

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix typo in accept on inet and local sockets
Corinna Vinschen [Mon, 26 Mar 2018 15:21:30 +0000 (17:21 +0200)]
Cygwin: fix typo in accept on inet and local sockets

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocomments to document struct caseconv_entry
Thomas Wolff [Mon, 26 Mar 2018 09:46:40 +0000 (11:46 +0200)]
comments to document struct caseconv_entry

explain design of compact (packed) struct caseconv_entry,
in case it needs to be modified for future Unicode versions

6 years agonewlib: fix indentation in toulower
Thomas Wolff [Mon, 26 Mar 2018 08:00:16 +0000 (10:00 +0200)]
newlib: fix indentation in toulower

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: delete /dev/kmsg and thus fhandler_mailslot without substitution
Corinna Vinschen [Sun, 25 Mar 2018 10:38:14 +0000 (12:38 +0200)]
Cygwin: delete /dev/kmsg and thus fhandler_mailslot without substitution

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: Redesign various aspects
Corinna Vinschen [Sun, 18 Mar 2018 19:46:43 +0000 (20:46 +0100)]
Cygwin: AF_UNIX: Redesign various aspects

* 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>
6 years agoCygwin: ntdll.h: Define FSCTL_PIPE_PEEK and NtWaitForSingleObject
Corinna Vinschen [Sun, 18 Mar 2018 19:07:35 +0000 (20:07 +0100)]
Cygwin: ntdll.h: Define FSCTL_PIPE_PEEK and NtWaitForSingleObject

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: Add state_lock to guard manipulating shared state info
Corinna Vinschen [Sun, 18 Mar 2018 19:06:43 +0000 (20:06 +0100)]
Cygwin: AF_UNIX: Add state_lock to guard manipulating shared state info

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: Use spinlock rather than SRWLOCKs
Corinna Vinschen [Sun, 18 Mar 2018 17:46:15 +0000 (18:46 +0100)]
Cygwin: AF_UNIX: Use spinlock rather than SRWLOCKs

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>
6 years agoCygwin: tags: drop _EXFUN regex
Corinna Vinschen [Sat, 17 Mar 2018 15:55:22 +0000 (16:55 +0100)]
Cygwin: tags: drop _EXFUN regex

_EXFUN has been removed a while back

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoReduce qsort stack consumption
Hakan Lindqvist [Mon, 12 Mar 2018 13:55:01 +0000 (14:55 +0100)]
Reduce qsort stack consumption

Classical function call recursion wastes a lot of stack space.
Each recursion level requires a full stack frame comprising all
local variables and additional space as dictated by the
processor calling convention.

This implementation instead stores the variables that are unique
for each recursion level in a parameter stack array, and uses
iteration to emulate recursion. Function call recursion is not
used until the array is full.

To ensure the stack consumption isn't worsened by this design, the
size of the parameter stack array is chosen to be similar to the
stack frame excluding the array. Each function call recursion level
can handle 8 iterative recursion levels.

Stack consumption will worsen when sorting tiny arrays that do not
need recursion (of 6 elements or less). It will be about equal for
up to 15 elements, and be an improvement for larger arrays. The best
case improvement is a stack size reduction down to about one quarter
of the stack consumption before the change.

A design where the parameter stack array is large enough for the
worst case recursion level was rejected because it would worsen
the stack consumption when sorting arrays smaller than about 1500
elements. The worst case is 31 levels on a 32-bit system.

A design with a dynamic parameter array size was rejected because
of limitations in some compilers.

6 years agoEnsure qsort recursion depth is bounded
Hakan Lindqvist [Mon, 12 Mar 2018 12:51:07 +0000 (13:51 +0100)]
Ensure qsort recursion depth is bounded

The qsort algorithm splits the input array in three parts. The
left and right parts may need further sorting. One of them is
sorted by recursion, the other by iteration. This update ensures
that it is the smaller part that is chosen for recursion.

By choosing the smaller part, each recursion level will handle
less than half the array of the previous recursion level. Hence
the recursion depth is bounded to be less than log2(n) i.e. 1
level per significant bit in the array size n.

The update also includes code comments explaining the algorithm.

6 years agoCorrect prototypes of pthread_mutex_getprioceiling() and pthread_setschedparam()
Joel Sherrill [Wed, 14 Mar 2018 22:49:29 +0000 (17:49 -0500)]
Correct prototypes of pthread_mutex_getprioceiling() and pthread_setschedparam()

6 years ago[arm] Fix syscalls.c for newlib embedded syscalls builds
Richard Earnshaw [Thu, 15 Mar 2018 09:55:11 +0000 (09:55 +0000)]
[arm] Fix syscalls.c for newlib embedded syscalls builds

Newlib has a build configuration where syscalls can be directly
embedded in the newlib library rather than relying on libgloss.

This configuration was broken recently by an update to the libgloss
support for Arm that was not propagated to the syscalls interface in
newlib itself.  This patch restores the build.  It's essentially a
copy of https://sourceware.org/ml/newlib/2018/msg00128.html but there
are some other minor cleanups and changes that I've made at the same
time.  None of those cleanups affect functionality.

The prototypes of the following functions have been updated: _link,
_sbrk, _getpid, _write, _swiwrite, _lseek, _swilseek, _read and
_swiread.

Signed-off-by: Richard Earnshaw <Richard.Earnshaw@arm.com>
6 years agossp: fix wchar.h with -std=c99
Yaakov Selkowitz [Wed, 14 Mar 2018 15:40:27 +0000 (10:40 -0500)]
ssp: fix wchar.h with -std=c99

https://sourceware.org/ml/newlib/2018/msg00261.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoFix alloc_align and alloc_size macros for multiple arguments
Yaakov Selkowitz [Wed, 14 Mar 2018 15:17:51 +0000 (10:17 -0500)]
Fix alloc_align and alloc_size macros for multiple arguments

https://sourceware.org/ml/newlib/2018/msg00263.html

This is a follow-up to commit 4564b30f331a067e71b25308ac7c8a85ceb4b122.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoctype: align size of category bit fields to small targets needs
Corinna Vinschen [Wed, 14 Mar 2018 09:36:34 +0000 (10:36 +0100)]
ctype: align size of category bit fields to small targets needs

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>
6 years agoRevert "ctype: align size of category bit fields to small targets needs"
Corinna Vinschen [Wed, 14 Mar 2018 10:36:06 +0000 (11:36 +0100)]
Revert "ctype: align size of category bit fields to small targets needs"

This reverts commit e98d3eb3eb9b6abd897e102031a14b7057641a65.

It has accidentally included some work in progress.

6 years agofix/enhance Unicode table generation scripts
Thomas Wolff [Tue, 13 Mar 2018 17:26:19 +0000 (18:26 +0100)]
fix/enhance Unicode table generation scripts

Scripts do not try to acquire Unicode data by best-effort magic anymore.
Options supported:
-h for help
-i to copy Unicode data from /usr/share/unicode/ucd first
-u to download Unicode data from unicode.org first
If (despite of -i or -u if given) the necessary Unicode files are not
available locally, table generation is skipped, but no error code is
returned, so not to obstruct the build process if called from a Makefile.

6 years agoctype: align size of category bit fields to small targets needs
Corinna Vinschen [Wed, 14 Mar 2018 09:36:34 +0000 (10:36 +0100)]
ctype: align size of category bit fields to small targets needs

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>
6 years agotowctrans_l: Always return a value from helper functions
Corinna Vinschen [Tue, 13 Mar 2018 21:09:30 +0000 (22:09 +0100)]
towctrans_l: Always return a value from helper functions

touupper and toulower didn't return a value in all cases.  Worse,
this only broke Cygwin when building without optimization for debug
purposes.

Why GCC neglects to notice this is a mystery.

While at it, fix formatting.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agortems/.../dirent.h: Add alphasort() prototype
Joel Sherrill [Mon, 12 Mar 2018 16:54:06 +0000 (11:54 -0500)]
rtems/.../dirent.h: Add alphasort() prototype

6 years agoCorrect alloc_size annotation on reallocarray()
Jon Turney [Mon, 12 Mar 2018 19:54:11 +0000 (19:54 +0000)]
Correct alloc_size annotation on reallocarray()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
6 years agoCygwin: mark muto object as NO_COPY
Corinna Vinschen [Mon, 12 Mar 2018 21:13:20 +0000 (22:13 +0100)]
Cygwin: mark muto object as NO_COPY

muto in smallprint.cc is missing a NO_COPY.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: store per-socket info in shared memory
Corinna Vinschen [Mon, 12 Mar 2018 14:26:12 +0000 (15:26 +0100)]
Cygwin: AF_UNIX: store per-socket info in shared memory

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>
6 years agomake target for explicit Unicode data tables generation
Thomas Wolff [Wed, 7 Mar 2018 23:08:29 +0000 (00:08 +0100)]
make target for explicit Unicode data tables generation

Run 'make unidata' in newlib target directory to generate Unicode
data tables for libc functions wcwidth, tow* and isw*.

6 years agocharacter data generation
Thomas Wolff [Wed, 7 Mar 2018 23:02:35 +0000 (00:02 +0100)]
character data generation

6 years agouse generated character data
Thomas Wolff [Fri, 9 Mar 2018 12:30:33 +0000 (13:30 +0100)]
use generated character data

The tow* functions use an included case conversion table which can be
generated from Unicode data.
The isw* functions use a character categories table (provided by
categories.c) which can be generated from Unicode data.
Delegation between current-locale and specific-locale-dependent functions
was reverted towards the generic locale-dependent functions (*_l.c);
this is however only relevant on systems with non-Unicode wide character
locales, thus not on Cygwin.

6 years agogenerated character category data, Unicode 10.0
Thomas Wolff [Sun, 25 Feb 2018 15:30:27 +0000 (16:30 +0100)]
generated character category data, Unicode 10.0

Table categories.t and tag enumeration categories.cat provide
character class data for most of the isw* functions.
These data are generated from Unicode data.

6 years agogenerated case conversion data, Unicode 10.0
Thomas Wolff [Sun, 25 Feb 2018 15:29:33 +0000 (16:29 +0100)]
generated case conversion data, Unicode 10.0

Table caseconv.t provides case conversion data for the tow* functions,
especially towupper and towlower.
These data are generated from Unicode data.

6 years agowidth data generation
Thomas Wolff [Wed, 7 Mar 2018 22:55:52 +0000 (23:55 +0100)]
width data generation

6 years agouse generated width data
Thomas Wolff [Sun, 25 Feb 2018 15:25:49 +0000 (16:25 +0100)]
use generated width data

6 years agogenerated width data, Unicode 10.0
Thomas Wolff [Sun, 25 Feb 2018 15:25:25 +0000 (16:25 +0100)]
generated width data, Unicode 10.0

These tables provide character width properties for use by the
wcwidth/wcswidth functions. They are generated from Unicode.

6 years agoCygwin: AF_UNIX: fix up thread parameter block allocation
Corinna Vinschen [Sun, 11 Mar 2018 13:56:02 +0000 (14:56 +0100)]
Cygwin: AF_UNIX: fix up thread parameter block allocation

* 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>
6 years agoCygwin: AF_UNIX: use get_unique_id to create pipe name
Corinna Vinschen [Sun, 11 Mar 2018 13:54:20 +0000 (14:54 +0100)]
Cygwin: AF_UNIX: use get_unique_id to create pipe name

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>
6 years agoCygwin: AF_UNIX: fix dup
Corinna Vinschen [Sat, 10 Mar 2018 20:12:27 +0000 (21:12 +0100)]
Cygwin: AF_UNIX: fix dup

Reorder so fhandler_socket::dup is called first.  Add missing
duplication of backing_file_handle.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: Add fixup_after_exec method
Corinna Vinschen [Sat, 10 Mar 2018 20:09:28 +0000 (21:09 +0100)]
Cygwin: AF_UNIX: Add fixup_after_exec method

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: fix creating abstract socket symlink name
Corinna Vinschen [Sat, 10 Mar 2018 20:07:46 +0000 (21:07 +0100)]
Cygwin: AF_UNIX: fix creating abstract socket symlink name

Add missing NUL termination when creating symlink representing
abstract socket.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: don't skip O_TMPFILE files in readdir
Corinna Vinschen [Fri, 9 Mar 2018 20:13:28 +0000 (21:13 +0100)]
Cygwin: don't skip O_TMPFILE files in readdir

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>
6 years agoCygwin: AF_UNIX: Implemant socketpair
Corinna Vinschen [Fri, 9 Mar 2018 13:19:36 +0000 (14:19 +0100)]
Cygwin: AF_UNIX: Implemant socketpair

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix socketpair prototype
Corinna Vinschen [Fri, 9 Mar 2018 13:17:39 +0000 (14:17 +0100)]
Cygwin: fix socketpair prototype

Last parameter is a vector of 2 ints, not a pointer to int

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agodescribe new locale modifier @cjkwide for user guide
Thomas Wolff [Wed, 7 Mar 2018 23:29:25 +0000 (00:29 +0100)]
describe new locale modifier @cjkwide for user guide

6 years agoCygwin: AF_UNIX: implement getsockopt SO_RCVBUF/SO_SNDBUF
Corinna Vinschen [Wed, 7 Mar 2018 20:56:42 +0000 (21:56 +0100)]
Cygwin: AF_UNIX: implement getsockopt SO_RCVBUF/SO_SNDBUF

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: define AF_UNIX_CONNECT_TIMEOUT
Corinna Vinschen [Wed, 7 Mar 2018 20:55:34 +0000 (21:55 +0100)]
Cygwin: AF_UNIX: define AF_UNIX_CONNECT_TIMEOUT

Use macro AF_UNIX_CONNECT_TIMEOUT instead of numerical constant
for connect timeout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Define FSCTL_PIPE_FLUSH
Corinna Vinschen [Wed, 7 Mar 2018 20:54:46 +0000 (21:54 +0100)]
Cygwin: Define FSCTL_PIPE_FLUSH

This fsctl might come in handy at one point...

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: Implement read, readv, recvfrom, write, writev, sendto
Corinna Vinschen [Wed, 7 Mar 2018 20:53:56 +0000 (21:53 +0100)]
Cygwin: AF_UNIX: Implement read, readv, recvfrom, write, writev, sendto

All of these functions just call recvfrom/sendmsg which are still TODO

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: reorder read/write calls in fhandler_socket_unix
Corinna Vinschen [Wed, 7 Mar 2018 20:52:29 +0000 (21:52 +0100)]
Cygwin: reorder read/write calls in fhandler_socket_unix

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: fix accept behaviour
Corinna Vinschen [Wed, 7 Mar 2018 15:23:44 +0000 (16:23 +0100)]
Cygwin: AF_UNIX: fix accept behaviour

* 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>
6 years agoCygwin: AF_UNIX: make sure connect wait thread is cleanly interruptible
Corinna Vinschen [Wed, 7 Mar 2018 15:19:32 +0000 (16:19 +0100)]
Cygwin: AF_UNIX: make sure connect wait thread is cleanly interruptible

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>
6 years agoCygwin: AF_UNIX: some pipe errors may have multiple status codes
Corinna Vinschen [Wed, 7 Mar 2018 15:12:55 +0000 (16:12 +0100)]
Cygwin: AF_UNIX: some pipe errors may have multiple status codes

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>
6 years agoCygwin: AF_UNIX: fix SEGV when sending an empty socket name from connect
Corinna Vinschen [Wed, 7 Mar 2018 15:08:15 +0000 (16:08 +0100)]
Cygwin: AF_UNIX: fix SEGV when sending an empty socket name from connect

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: fix creation of npfs handle
Corinna Vinschen [Wed, 7 Mar 2018 14:48:21 +0000 (15:48 +0100)]
Cygwin: AF_UNIX: fix creation of npfs handle

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>
6 years agoCygwin: AF_UNIX: Add create_event helper and use throughout
Corinna Vinschen [Wed, 7 Mar 2018 15:00:36 +0000 (16:00 +0100)]
Cygwin: AF_UNIX:  Add create_event helper and use throughout

Minimize overhead in creating a nameless event object.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: fix comments and move a macro
Corinna Vinschen [Wed, 7 Mar 2018 14:43:26 +0000 (15:43 +0100)]
Cygwin: AF_UNIX: fix comments and move a macro

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: Implement listen, accept4, connect, and others
Corinna Vinschen [Tue, 6 Mar 2018 17:55:03 +0000 (18:55 +0100)]
Cygwin: AF_UNIX: Implement listen, accept4, connect, and others

* 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>
6 years agoCygwin: AF_UNIX: fix a couple of thinkos and typos
Corinna Vinschen [Tue, 6 Mar 2018 17:42:12 +0000 (18:42 +0100)]
Cygwin: AF_UNIX: fix a couple of thinkos and typos

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: create/open pipes relativ to NPFS rootdir handle
Corinna Vinschen [Tue, 6 Mar 2018 17:37:09 +0000 (18:37 +0100)]
Cygwin: AF_UNIX: create/open pipes relativ to NPFS rootdir handle

Only store and manipulate pipe basename.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: initialize rmem/wmem to 256K and use in pipe creation
Corinna Vinschen [Tue, 6 Mar 2018 17:28:15 +0000 (18:28 +0100)]
Cygwin: AF_UNIX: initialize rmem/wmem to 256K and use in pipe creation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: ntdll.h: Add some missing pipe-related definitions
Corinna Vinschen [Tue, 6 Mar 2018 17:24:13 +0000 (18:24 +0100)]
Cygwin: ntdll.h: Add some missing pipe-related definitions

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: sys/socket.h: define MSG_CMSG_CLOEXEC
Corinna Vinschen [Tue, 6 Mar 2018 17:23:48 +0000 (18:23 +0100)]
Cygwin: sys/socket.h: define MSG_CMSG_CLOEXEC

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: export hires counter ntod
Corinna Vinschen [Tue, 6 Mar 2018 17:23:23 +0000 (18:23 +0100)]
Cygwin: export hires counter ntod

Needed it new AF_UNIX socket code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoRTEMS: Use int for _CLOCKID_T_
Sebastian Huber [Thu, 8 Feb 2018 12:02:41 +0000 (13:02 +0100)]
RTEMS: Use int for _CLOCKID_T_

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>
6 years agoMake _CLOCKID_T_ system configurable
Sebastian Huber [Thu, 8 Feb 2018 12:00:42 +0000 (13:00 +0100)]
Make _CLOCKID_T_ system configurable

Let systems optionally provide the _CLOCKID_T_ type via
<machine/_types.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoCygwin: move sun_name_t constructors into fhandler_socket_unix.cc
Corinna Vinschen [Mon, 5 Mar 2018 17:08:47 +0000 (18:08 +0100)]
Cygwin: move sun_name_t constructors into fhandler_socket_unix.cc

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>
6 years agoCygwin: sockets: add bind state, and split out connect state to allow atomic operation
Corinna Vinschen [Mon, 5 Mar 2018 16:59:04 +0000 (17:59 +0100)]
Cygwin: sockets: add bind state, and split out connect state to allow atomic 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>
6 years agoCygwin: drop debug_printf statement from start_transaction
Corinna Vinschen [Mon, 5 Mar 2018 16:50:52 +0000 (17:50 +0100)]
Cygwin: drop debug_printf statement from start_transaction

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>
6 years agoCygwin: cygwait.cc: fix formatting of debug statement
Corinna Vinschen [Mon, 5 Mar 2018 16:49:50 +0000 (17:49 +0100)]
Cygwin: cygwait.cc: fix formatting of debug statement

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoLocale modifier @cjkwide to adjust ambiguous-width in non-CJK locales
Thomas Wolff [Fri, 2 Mar 2018 19:21:09 +0000 (20:21 +0100)]
Locale modifier @cjkwide to adjust ambiguous-width in non-CJK locales

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.

6 years agoCygwin: AF_UNIX: drop try/except block in bind method
Corinna Vinschen [Fri, 2 Mar 2018 22:40:36 +0000 (23:40 +0100)]
Cygwin: AF_UNIX: drop try/except block in bind method

The caller already does it anyway.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: AF_UNIX: create pipes with file attribute R/W access
Corinna Vinschen [Fri, 2 Mar 2018 22:39:15 +0000 (23:39 +0100)]
Cygwin: AF_UNIX: create pipes with file attribute R/W access

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: accept4: Fix resource leak
Corinna Vinschen [Fri, 2 Mar 2018 22:33:05 +0000 (23:33 +0100)]
Cygwin: accept4: Fix resource leak

The new implementation neglected to release the file descriptor
in case of error.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: remove outdated comment
Corinna Vinschen [Fri, 2 Mar 2018 17:22:45 +0000 (18:22 +0100)]
Cygwin: remove outdated comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket_unix: implement socket, bind, and close
Corinna Vinschen [Fri, 2 Mar 2018 17:14:11 +0000 (18:14 +0100)]
Cygwin: fhandler_socket_unix: implement socket, bind, and close

...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>
6 years agoCygwin: add transform_chars_af_unix helper
Corinna Vinschen [Fri, 2 Mar 2018 17:11:57 +0000 (18:11 +0100)]
Cygwin: add transform_chars_af_unix helper

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>
6 years agoCygwin: small_s[w]printf: add '_' modifier to print lower case hex digits
Corinna Vinschen [Fri, 2 Mar 2018 17:09:35 +0000 (18:09 +0100)]
Cygwin: small_s[w]printf: add '_' modifier to print lower case hex digits

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointer
Corinna Vinschen [Fri, 2 Mar 2018 17:07:39 +0000 (18:07 +0100)]
Cygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointer

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: ntdll.h: add definitions required for pipe-based AF_UNIX
Corinna Vinschen [Fri, 2 Mar 2018 17:03:11 +0000 (18:03 +0100)]
Cygwin: ntdll.h: add definitions required for pipe-based AF_UNIX

Also remove redundant declaration of RtlInitEmptyUnicodeString

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoAdd global stdio streams support for reent small.
Our Air Quality [Wed, 28 Feb 2018 12:31:48 +0000 (23:31 +1100)]
Add global stdio streams support for reent small.

6 years agoCygwin: convert sun_name_t into class
Corinna Vinschen [Thu, 1 Mar 2018 17:14:23 +0000 (18:14 +0100)]
Cygwin: convert sun_name_t into class

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>
6 years agoCygwin: add AF_UNIX reparse points to path handling
Corinna Vinschen [Thu, 1 Mar 2018 15:54:57 +0000 (16:54 +0100)]
Cygwin: add AF_UNIX reparse points to path handling

* 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>
6 years agoCygwin: move transaction helpers into ntdll.h
Corinna Vinschen [Thu, 1 Mar 2018 15:51:12 +0000 (16:51 +0100)]
Cygwin: move transaction helpers into ntdll.h

We'll need them elsewhere in future.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de
6 years agoCygwin: ntdll.h: drop macros available in mingw-w64 headers
Corinna Vinschen [Thu, 1 Mar 2018 15:50:41 +0000 (16:50 +0100)]
Cygwin: ntdll.h: drop macros available in mingw-w64 headers

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: path.cc: clean up includes
Corinna Vinschen [Thu, 1 Mar 2018 15:44:09 +0000 (16:44 +0100)]
Cygwin: path.cc: clean up includes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: path_conv: rename is_rep_symlink to is_known_reparse_point
Corinna Vinschen [Thu, 1 Mar 2018 15:41:45 +0000 (16:41 +0100)]
Cygwin: path_conv: rename is_rep_symlink to is_known_reparse_point

...in preparation of reusing this flag for other types of
reparse points, not only symlinks.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: improve storage and handling of AF_UNIX socket path
Corinna Vinschen [Wed, 28 Feb 2018 18:06:41 +0000 (19:06 +0100)]
Cygwin: improve storage and handling of AF_UNIX socket path

Define new struct sun_name_t and use throughout internally.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket_unix: store peer credentials in ucred member
Corinna Vinschen [Wed, 28 Feb 2018 18:01:29 +0000 (19:01 +0100)]
Cygwin: fhandler_socket_unix: store peer credentials in ucred member

* Split out cygwin/_ucred.h file
* drop local credentials

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: cleanup header including within network-releated files
Corinna Vinschen [Wed, 28 Feb 2018 17:56:13 +0000 (18:56 +0100)]
Cygwin: cleanup header including within network-releated files

* 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>
6 years agoCygwin: sockets: Fix fstat on unnamed sockets
Corinna Vinschen [Tue, 27 Feb 2018 14:30:00 +0000 (15:30 +0100)]
Cygwin: sockets: Fix fstat on unnamed sockets

Calling fhandler_socket::fstat from fhandler_socket::fstat recursively
is not a good idea...

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: reduce size of fhandler_cygdrive newlib-snapshot-20180226
Corinna Vinschen [Mon, 26 Feb 2018 19:39:48 +0000 (20:39 +0100)]
Cygwin: reduce size of fhandler_cygdrive

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>
6 years agoCygwin: sockets: Add missing cleanup if socket/socketpair creation fails
Corinna Vinschen [Mon, 26 Feb 2018 17:02:36 +0000 (18:02 +0100)]
Cygwin: sockets: Add missing cleanup if socket/socketpair creation fails

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket_unix: Tiny cleanup
Corinna Vinschen [Mon, 26 Feb 2018 16:58:46 +0000 (17:58 +0100)]
Cygwin: fhandler_socket_unix: Tiny cleanup

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: sockets: move type and proto checks into fhandler_socket classes
Corinna Vinschen [Mon, 26 Feb 2018 16:56:47 +0000 (17:56 +0100)]
Cygwin: sockets: move type and proto checks into fhandler_socket classes

Encapsulation required

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: define socketpair as virtual function
Corinna Vinschen [Mon, 26 Feb 2018 16:53:50 +0000 (17:53 +0100)]
Cygwin: fhandler_socket: define socketpair as virtual function

...in preparation of moving the type and protocol test into the
actual classes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agodoc/faq-using.xml: Add BeyondTrust and Cylance to BLODA
David Macek [Fri, 23 Feb 2018 13:22:44 +0000 (14:22 +0100)]
doc/faq-using.xml: Add BeyondTrust and Cylance to BLODA

Cylance:
- https://github.com/git-for-windows/git/issues/1244
- https://cygwin.com/ml/cygwin/2017-04/msg00238.html

BeyondTrust:
- https://cygwin.com/ml/cygwin/2017-04/msg00092.html
- https://cygwin.com/ml/cygwin/2017-05/msg00422.html

6 years agoCygwin: Define SO_PASSCRED and SCM_CREDENTIALS
Corinna Vinschen [Fri, 23 Feb 2018 20:00:17 +0000 (21:00 +0100)]
Cygwin: Define SO_PASSCRED and SCM_CREDENTIALS

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Create empty fhandler_socket_unix
Corinna Vinschen [Fri, 23 Feb 2018 19:59:21 +0000 (20:59 +0100)]
Cygwin: Create empty fhandler_socket_unix

* Make distinct from AF_LOCAL for testing purposes.  This will have
  to be reverted as soon as fhandler_socket_unix goes life.

* Move saw_reuseaddr flag back to fhandler_socket status

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix upcalls in some fhandler_socket_local methods
Corinna Vinschen [Fri, 23 Feb 2018 19:59:55 +0000 (20:59 +0100)]
Cygwin: fix upcalls in some fhandler_socket_local methods

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This page took 0.070291 seconds and 5 git commands to generate.