]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
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>
6 years agoCygwin: Introduce FH_SOCKET for generic socket file ops
Corinna Vinschen [Fri, 23 Feb 2018 18:45:59 +0000 (19:45 +0100)]
Cygwin: Introduce FH_SOCKET for generic socket file ops

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: encapsulate Winsock based fhandler_socket classes
Corinna Vinschen [Fri, 23 Feb 2018 14:24:18 +0000 (15:24 +0100)]
Cygwin: encapsulate Winsock based fhandler_socket classes

Insert another class fhandler_socket_wsock between fhandler_socket
and fhandler_socket_inet/fhandler_socket_local.

Also, add a new method fhandler::is_wsock_socket to allow asking
for sockets in general (is_socket) vs. Winsock-based sockets
(is_wsock_socket).

This allows to develop a new handler_socket_unix class as derived
class from fhandler_socket without any trace of wsock code left
in fhandler_socket.

While this is basically a temporary measure at this time, it may
prove useful for later interoperability with the upcoming Windows 10
AF_UNIX implementation at one point.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: eliminate unused fhandler method hclose
Corinna Vinschen [Fri, 23 Feb 2018 13:56:30 +0000 (14:56 +0100)]
Cygwin: eliminate unused fhandler method hclose

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix fhandler_socket_local::fchmod
Corinna Vinschen [Fri, 23 Feb 2018 12:34:08 +0000 (13:34 +0100)]
Cygwin: fix fhandler_socket_local::fchmod

Rather than just returning 0, return the result of calling
the base class fchmod.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: socket.h: Add SIOCINQ, equivalent to FIONREAD
Corinna Vinschen [Fri, 23 Feb 2018 12:33:23 +0000 (13:33 +0100)]
Cygwin: socket.h: Add SIOCINQ, equivalent to FIONREAD

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: drop unused device nodes and clean up socket devices
Corinna Vinschen [Fri, 23 Feb 2018 12:32:51 +0000 (13:32 +0100)]
Cygwin: drop unused device nodes and clean up socket devices

* Rename DEV_TCP_MAJOR to DEV_SOCK_MAJOR
* Drop FH_TCP, FH_UDP, FH_ICMP in favor of single FH_INET
* Drop FH_UNIX, FH_STREAM, FH_DGRAM in favor of single FH_LOCAL

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: Move select functions into derived classes
Corinna Vinschen [Thu, 22 Feb 2018 15:59:55 +0000 (16:59 +0100)]
Cygwin: fhandler_socket: Move select functions into derived classes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: Rearrange methods
Corinna Vinschen [Thu, 22 Feb 2018 15:54:08 +0000 (16:54 +0100)]
Cygwin: fhandler_socket: Rearrange methods

Follow the same pattern in all fhandler_socket classes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: Add derived fcntl methods
Corinna Vinschen [Thu, 22 Feb 2018 15:37:12 +0000 (16:37 +0100)]
Cygwin: fhandler_socket: Add derived fcntl methods

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: Add derived ioctl methods
Corinna Vinschen [Thu, 22 Feb 2018 15:30:08 +0000 (16:30 +0100)]
Cygwin: fhandler_socket: Add derived ioctl methods

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: Move shutdown and close methods into derived classes
Corinna Vinschen [Thu, 22 Feb 2018 15:28:14 +0000 (16:28 +0100)]
Cygwin: fhandler_socket: Move shutdown and close methods into derived classes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: make socketpair an AF_LOCAL-only method
Corinna Vinschen [Thu, 22 Feb 2018 15:25:28 +0000 (16:25 +0100)]
Cygwin: make socketpair an AF_LOCAL-only method

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agodoc/ntsec.xml: Fix typo
David Macek [Wed, 21 Feb 2018 17:09:47 +0000 (18:09 +0100)]
doc/ntsec.xml: Fix typo

6 years agoCygwin: inline get_socket_flags()
Corinna Vinschen [Wed, 21 Feb 2018 21:00:04 +0000 (22:00 +0100)]
Cygwin: inline get_socket_flags()

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix whitespaces in socket code
Corinna Vinschen [Wed, 21 Feb 2018 20:43:44 +0000 (21:43 +0100)]
Cygwin: fix whitespaces in socket code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: split out fhandler_socket into inet and local classes
Corinna Vinschen [Wed, 21 Feb 2018 20:40:01 +0000 (21:40 +0100)]
Cygwin: split out fhandler_socket into inet and local classes

First cut, still incomplete

* fhandler_socket is now base class for other socket classes
* fhandler_socket_inet handles AF_INET and AF_INET6 sockets
* fhandler_socket_local handles AF_LOCAL/AF_UNIX sockets
* finally get rid of fdsock by using set_socket_handle in accept4
* align file-related calls (fstat,  fstatvfs, fchown, fchmod, facl)
  to Linux.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: net.cc: drop redundant declarations
Corinna Vinschen [Tue, 20 Feb 2018 17:14:57 +0000 (18:14 +0100)]
Cygwin: net.cc: drop redundant declarations

Replace cygwin_inet_aton call with cygwin_inet_pton

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: set/getsockopt: Move implementation into fhandler_socket class
Corinna Vinschen [Tue, 20 Feb 2018 17:01:40 +0000 (18:01 +0100)]
Cygwin: set/getsockopt: Move implementation into fhandler_socket class

This requires to export find_winsock_errno from net.cc.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: clean error mapping
Corinna Vinschen [Tue, 20 Feb 2018 16:59:45 +0000 (17:59 +0100)]
Cygwin: clean error mapping

- Move definition of windows to POSIX error mapping struct into
  cygerrno.h
- Move declaration of winsock errno functions to cygerrno.h
- Input to error mapping functions is DWORD

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Make sure fraction of seconds constants enforce 64 bit computation
Corinna Vinschen [Tue, 20 Feb 2018 14:05:23 +0000 (15:05 +0100)]
Cygwin: Make sure fraction of seconds constants enforce 64 bit computation

Dropping the 'LL' specifier leads to 32 bit truncation during timestamp
computation.  Revert it.  Exempt MSPERSEC which is used for 32 bit values.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix declaration of fhandler_socket::socketpair
Corinna Vinschen [Fri, 16 Feb 2018 16:34:57 +0000 (17:34 +0100)]
Cygwin: fix declaration of fhandler_socket::socketpair

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix utils path handling in case cygdrive path is just '/'
Corinna Vinschen [Fri, 16 Feb 2018 16:21:48 +0000 (17:21 +0100)]
Cygwin: fix utils path handling in case cygdrive path is just '/'

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: net: Improve standars conformance comments
Corinna Vinschen [Fri, 16 Feb 2018 15:57:24 +0000 (16:57 +0100)]
Cygwin: net: Improve standars conformance comments

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fhandler_socket: Add :: to potentially colliding WinSock calls
Corinna Vinschen [Fri, 16 Feb 2018 15:41:42 +0000 (16:41 +0100)]
Cygwin: fhandler_socket: Add :: to potentially colliding WinSock calls

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: socketpair: Move socketpair creation inside fhandler_socket class
Corinna Vinschen [Fri, 16 Feb 2018 15:36:19 +0000 (16:36 +0100)]
Cygwin: socketpair: Move socketpair creation inside fhandler_socket class

Add fhandler_socket::socketpair method

Deliberately disable AF_INET socketpairs for now

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: sockets: move common settings into set_socket_handle()
Corinna Vinschen [Fri, 16 Feb 2018 15:23:32 +0000 (16:23 +0100)]
Cygwin: sockets: move common settings into set_socket_handle()

Move setting address family, socket type and descriptor flags
into fhandler_socket::set_socket_handle method.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoadd forward declaration to main() to prevent warnings
Jaap de Wolff [Mon, 12 Feb 2018 11:23:45 +0000 (12:23 +0100)]
add forward declaration to main() to prevent warnings

6 years agoadapt prototypes arm/syscalls.c to usual prototypes, and do not rely on implicit...
Jaap de Wolff [Mon, 12 Feb 2018 11:23:44 +0000 (12:23 +0100)]
adapt prototypes arm/syscalls.c to usual prototypes, and do not rely on implicit conversions

6 years agoadd forward declaration to __cxa_atexit to aeabi_atexit, to prevent warnings
Jaap de Wolff [Mon, 12 Feb 2018 11:23:43 +0000 (12:23 +0100)]
add forward declaration to __cxa_atexit to aeabi_atexit, to prevent warnings

6 years agoAdd prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano...
Jaap de Wolff [Mon, 12 Feb 2018 11:23:42 +0000 (12:23 +0100)]
Add prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano-mallocr.c

6 years agoAdd define _COMPILING_NEWLIB for arm to configure.host, as it is obviously needed
Jaap de Wolff [Mon, 12 Feb 2018 11:23:41 +0000 (12:23 +0100)]
Add define _COMPILING_NEWLIB for arm to configure.host, as it is obviously needed

Signed-off-by: Jaap de Wolff <jaap@stretch.de-wolff.org>
6 years agoCygwin: socket: move socket creation inside fhandler_socket class
Corinna Vinschen [Wed, 14 Feb 2018 21:21:58 +0000 (22:21 +0100)]
Cygwin: socket: move socket creation inside fhandler_socket class

Add fhandler_socket::socket method
Add fhandler_socket::set_socket_handle method, basically duplicating
what fdsock is doing.  This is the first step in getting rid of fdsock.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: improve O_TMPFILE handling
Corinna Vinschen [Wed, 14 Feb 2018 11:55:24 +0000 (12:55 +0100)]
Cygwin: improve O_TMPFILE handling

Windows does not remove FILE_ATTRIBUTE_TEMPORARY by itself after a
file has been closed.  It's just some attribute which can be set or
removed at will, despite its purpose.

Apparently there are tools out there which use FILE_ATTRIBUTE_TEMPORARY
accidentally or wrongly, even Microsoft's own tools are affected.  In
the end, the filesystem is potentially full of files with this attribute
set.

Implement O_TMPFILE files with FILE_ATTRIBUTE_TEMPORARY and
FILE_ATTRIBUTE_HIDDEN set.  This combination is pretty unlikely.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fix file-related functions on unix sockets
Corinna Vinschen [Wed, 14 Feb 2018 09:20:42 +0000 (10:20 +0100)]
Cygwin: fix file-related functions on unix sockets

* Fix an incorrect condition to recognize AF_LOCAL sockets in
  file-related functions (fchmod, fchown, fstat, fsttavfs, facl, link).

* Return successfully when called on unnamed or abstract AF_LOCAL sockets,
  except link, just as on Linux.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: improve a comment in fhandler_socket::getsockname
Corinna Vinschen [Wed, 14 Feb 2018 09:31:02 +0000 (10:31 +0100)]
Cygwin: improve a comment in fhandler_socket::getsockname

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: /proc/<pid>/stat: Fix time handling
Corinna Vinschen [Mon, 12 Feb 2018 21:10:08 +0000 (22:10 +0100)]
Cygwin: /proc/<pid>/stat: Fix time handling

* Use 64 bit timestamps
* Use System boot and process start time to compute starttime value per
  Linux proc.5 description.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Drop HZ usage in favor of MSPERSEC and CLOCKS_PER_SEC
Corinna Vinschen [Mon, 12 Feb 2018 21:08:42 +0000 (22:08 +0100)]
Cygwin: Drop HZ usage in favor of MSPERSEC and CLOCKS_PER_SEC

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Define MSPERSEC and fix USPERSEC comment
Corinna Vinschen [Mon, 12 Feb 2018 20:21:58 +0000 (21:21 +0100)]
Cygwin: Define MSPERSEC and fix USPERSEC comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Fix x86 compiler warning
Corinna Vinschen [Wed, 7 Feb 2018 16:34:59 +0000 (17:34 +0100)]
Cygwin: Fix x86 compiler warning

The previous patch introduced a compiler warning on x86.

Given time_t is only 4 bytes on x86 we get a long vs. unsigned long
comparison in timeval_to_ms.  Fix it by careful casting.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: sockets: Handle SO_RCVTIMEO and SO_SNDTIMEO
Corinna Vinschen [Wed, 7 Feb 2018 15:16:51 +0000 (16:16 +0100)]
Cygwin: sockets: Handle SO_RCVTIMEO and SO_SNDTIMEO

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: setsockopt/getsockopt: Add missing optlen checks
Corinna Vinschen [Wed, 7 Feb 2018 14:37:48 +0000 (15:37 +0100)]
Cygwin: setsockopt/getsockopt: Add missing optlen checks

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Cleanup time handling
Corinna Vinschen [Wed, 7 Feb 2018 12:07:44 +0000 (13:07 +0100)]
Cygwin: Cleanup time handling

* Redefine NSPERSEC to NS100PERSEC
* Define NSPERSEC as nanosecs per second
* Define USPERSEC as microsecs per second
* Use above constants throughout where appropriate
* Rename to_us to timespec_to_us and inline
* Rename it_bad to timespec_bad and inline

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: setsockopt/getsockopt: Clean up code
Corinna Vinschen [Tue, 6 Feb 2018 17:42:00 +0000 (18:42 +0100)]
Cygwin: setsockopt/getsockopt: Clean up code

Rearrange setsockopt/getsockopt into per level/per optname
preprocessing switch, actual call,  per level/per optname
postprocessing switch for better readability as well as
extensibility.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: bindresvport: Guard prototypes with __MISC_VISIBLE
Corinna Vinschen [Mon, 5 Feb 2018 20:06:29 +0000 (21:06 +0100)]
Cygwin: bindresvport: Guard prototypes with __MISC_VISIBLE

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: bindresvport: Try hard to find unused port
Corinna Vinschen [Mon, 5 Feb 2018 20:05:09 +0000 (21:05 +0100)]
Cygwin: bindresvport: Try hard to find unused port

Workaround the problem that bind doesn't fail with EADDRINUSE
if a socket with the same local address is still in TIME_WAIT.

Use IP Helper functions to check if such a socket exist and don't
even try this port, if so.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: bindresvport: check correctness of address family
Corinna Vinschen [Mon, 5 Feb 2018 20:00:15 +0000 (21:00 +0100)]
Cygwin: bindresvport: check correctness of address family

Assuming the address parameter is non-NULL, the test in
cygwin_bindresvport_sa only tests if the address family is
supported at all, which is insufficient.

Check if the incoming address family matches the socket
address family and for being AF_INET in cygwin_bindresvport
since the latter doesn't support any other family.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: bindresvport_sa: Ignore incoming port number
Corinna Vinschen [Mon, 5 Feb 2018 18:27:55 +0000 (19:27 +0100)]
Cygwin: bindresvport_sa: Ignore incoming port number

Ignore port number just like glibc, otherwise suffer EADDRINUSE
in subsequent connect calls.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Use SO_EXCLUSIVEADDRUSE
Corinna Vinschen [Mon, 5 Feb 2018 18:22:47 +0000 (19:22 +0100)]
Cygwin: Use SO_EXCLUSIVEADDRUSE

We're still using ~SO_REUSEADDR because SO_EXCLUSIVEADDRUSE wasn't
defined in Mingw.  But it is in Mingw-w64, so fix it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: bump version to 2.10.1
Corinna Vinschen [Fri, 2 Feb 2018 14:32:28 +0000 (15:32 +0100)]
Cygwin: bump version to 2.10.1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: drop Cygwin license from sys/select.h cygwin-2_10_0-release
Corinna Vinschen [Fri, 2 Feb 2018 10:27:58 +0000 (11:27 +0100)]
newlib: drop Cygwin license from sys/select.h

This license was accidentally retained when moving the file from Cygwin to newlib.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoFix vprintf and vfscanf for GCC PR 14577
Jon Beniston [Thu, 1 Feb 2018 09:06:00 +0000 (09:06 +0000)]
Fix vprintf and vfscanf for GCC PR 14577

6 years agoepiphany: Additional setjmp() and longjmp() syms
Sebastian Huber [Wed, 31 Jan 2018 07:14:44 +0000 (08:14 +0100)]
epiphany: Additional setjmp() and longjmp() syms

At least with Binutils 2.30 and GCC 7.3 we need symbol definitions
without the leading underscore.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agossp: do not use __ssp_protected_ symbol prefixes
Yaakov Selkowitz [Wed, 24 Jan 2018 03:53:04 +0000 (21:53 -0600)]
ssp: do not use __ssp_protected_ symbol prefixes

This is a NetBSD-specific detail which does not apply to Newlib, causing
linking issues in certain scenarios:

https://cygwin.com/ml/cygwin/2018-01/msg00189.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoDisable powf/log2?f/exp2?f optimization for single-precision Arm FPU
Thomas Preudhomme [Tue, 23 Jan 2018 10:43:54 +0000 (10:43 +0000)]
Disable powf/log2?f/exp2?f optimization for single-precision Arm FPU

New optimized powf, logf, log2f, expf and exp2f yield worse performance
on Arm targets with only single precision instructions because the
double precision arithmetic is then implemented via softfloat routines.
This patch uses the old implementation when double precision
instructions are not available on Arm targets.

Testing: Built newlib with GCC's rmprofile Arm multilibs and compared
before/after -> only the above functions are changed and calls to them
(name change from logf to __ieee754_logf and similar). Testing the
changed function on a panel of values yields the same result before the
original patches to improve them and after this one. Double checking the
performance by looping the same panel of values being tested on Arm
Cortex-M4 does show the performance regression is fixed.

6 years agoDefine internal function mythreadname() -- revised
Mark Geisert [Wed, 24 Jan 2018 08:34:23 +0000 (00:34 -0800)]
Define internal function mythreadname() -- revised

 This new function returns the name of the calling thread; works for both
 cygthreads and pthreads.  All calls to cygthread::name(/*void*/) replaced
 by calls to mythreadname(/*void*/).

6 years agocygwin: 2.10.0 release text: fix formatting
Corinna Vinschen [Mon, 22 Jan 2018 14:32:29 +0000 (15:32 +0100)]
cygwin: 2.10.0 release text: fix formatting

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: Declare pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock
Yaakov Selkowitz [Mon, 22 Jan 2018 05:51:51 +0000 (23:51 -0600)]
cygwin: Declare pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock

These were added in commit 8128f5482f2b1889e2336488e9d45a33c9972d11 but
without their public declarations.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: update docs for 2.10.0
Yaakov Selkowitz [Fri, 19 Jan 2018 06:36:15 +0000 (00:36 -0600)]
cygwin: update docs for 2.10.0

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: add gencat tool
Yaakov Selkowitz [Fri, 19 Jan 2018 05:28:27 +0000 (23:28 -0600)]
cygwin: add gencat tool

This is needed for compiling catalog files used in catgets(3) calls.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: add catopen, catgets, catclose
Yaakov Selkowitz [Fri, 19 Jan 2018 05:26:41 +0000 (23:26 -0600)]
cygwin: add catopen, catgets, catclose

The implementation is taken from FreeBSD with #ifdef __CYGWIN__ modifications.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoGuard langinfo.h nl_item from multiple typedefs
Yaakov Selkowitz [Fri, 19 Jan 2018 05:53:18 +0000 (23:53 -0600)]
Guard langinfo.h nl_item from multiple typedefs

This is a prerequisite of adding nl_types.h support to Cygwin.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoFix syntax error in exit.c
Orlando Arias [Fri, 19 Jan 2018 16:45:01 +0000 (11:45 -0500)]
Fix syntax error in exit.c

This patch fixes a syntax error in exit.c that was introduced during the
ANSI-fication of newlib. The patch fixes a compile-time issue that arises when
newlib is configured with the --enable-lite-exit feature.

6 years agocygwin: make <sys/socket.h> completely visible from <netinet/in.h>
Yaakov Selkowitz [Tue, 16 Jan 2018 03:19:59 +0000 (21:19 -0600)]
cygwin: make <sys/socket.h> completely visible from <netinet/in.h>

While POSIX mandates that certain socket types shall be defined by the
inclusing of <netinet/in.h>, it also says that this header may also make
visible all <sys/socket.h> symbols.  Glibc does this, and without out it,
some packages end up requiring an additional #include <sys/socket.h>.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: remove inclusion of <sys/time.h> from <sys/socket.h>
Yaakov Selkowitz [Fri, 19 Jan 2018 18:06:00 +0000 (12:06 -0600)]
cygwin: remove inclusion of <sys/time.h> from <sys/socket.h>

POSIX does not mention the inclusion of <sys/time.h> in <sys/socket.h>
or <netinet/in.h>, nor is there anything in the latter two that would
require the former.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoBump release to 3.0.0 for yearly snapshot newlib-3.0.0 newlib-snapshot-20180118
Jeff Johnston [Thu, 18 Jan 2018 18:07:45 +0000 (13:07 -0500)]
Bump release to 3.0.0 for yearly snapshot

- major release required due to removal of K&R support

6 years agoRISC-V: isatty: return 0 on error
Chih-Mao Chen [Thu, 16 Nov 2017 08:08:16 +0000 (16:08 +0800)]
RISC-V: isatty: return 0 on error

6 years agoRISC-V: Fix alignment issue in sigjmp_buf
Kito Cheng [Fri, 17 Nov 2017 06:50:52 +0000 (14:50 +0800)]
RISC-V: Fix alignment issue in sigjmp_buf

6 years agoansification: remove ansidecl.h from makedoc
Yaakov Selkowitz [Mon, 4 Dec 2017 09:59:06 +0000 (03:59 -0600)]
ansification: remove ansidecl.h from makedoc

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: fix makedoc for ANSI C
Yaakov Selkowitz [Mon, 4 Dec 2017 09:25:26 +0000 (03:25 -0600)]
ansification: fix makedoc for ANSI C

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _HAVE_STDC
Yaakov Selkowitz [Mon, 4 Dec 2017 05:58:31 +0000 (23:58 -0600)]
ansification: remove _HAVE_STDC

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _EXFUN, _EXFUN_NOTHROW
Yaakov Selkowitz [Mon, 4 Dec 2017 05:54:48 +0000 (23:54 -0600)]
ansification: remove _EXFUN, _EXFUN_NOTHROW

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _EXFNPTR, _EXPARM
Yaakov Selkowitz [Mon, 4 Dec 2017 04:52:13 +0000 (22:52 -0600)]
ansification: remove _EXFNPTR, _EXPARM

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _DEFUN
Yaakov Selkowitz [Mon, 4 Dec 2017 03:43:30 +0000 (21:43 -0600)]
ansification: remove _DEFUN

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _VOLATILE, _SIGNED
Yaakov Selkowitz [Mon, 4 Dec 2017 03:48:55 +0000 (21:48 -0600)]
ansification: remove _VOLATILE, _SIGNED

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _VOID
Yaakov Selkowitz [Mon, 4 Dec 2017 03:12:33 +0000 (21:12 -0600)]
ansification: remove _VOID

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _DEFUN_VOID
Yaakov Selkowitz [Mon, 4 Dec 2017 03:00:43 +0000 (21:00 -0600)]
ansification: remove _DEFUN_VOID

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _CAST_VOID
Yaakov Selkowitz [Mon, 4 Dec 2017 02:56:37 +0000 (20:56 -0600)]
ansification: remove _CAST_VOID

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _PTR
Yaakov Selkowitz [Mon, 4 Dec 2017 02:53:22 +0000 (20:53 -0600)]
ansification: remove _PTR

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _VOID_PTR
Yaakov Selkowitz [Mon, 4 Dec 2017 02:45:02 +0000 (20:45 -0600)]
ansification: remove _VOID_PTR

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _PARAMS
Yaakov Selkowitz [Mon, 4 Dec 2017 02:41:16 +0000 (20:41 -0600)]
ansification: remove _PARAMS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _NOARGS
Yaakov Selkowitz [Mon, 4 Dec 2017 02:32:27 +0000 (20:32 -0600)]
ansification: remove _NOARGS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoansification: remove _DOTS
Yaakov Selkowitz [Mon, 4 Dec 2017 02:28:42 +0000 (20:28 -0600)]
ansification: remove _DOTS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This page took 0.066485 seconds and 5 git commands to generate.