]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
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>
6 years agoansification: remove _CONST
Yaakov Selkowitz [Mon, 4 Dec 2017 02:25:16 +0000 (20:25 -0600)]
ansification: remove _CONST

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

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: add asm/bitsperlong.h, dummy asm/posix_types.h headers
Yaakov Selkowitz [Wed, 17 Jan 2018 09:03:23 +0000 (03:03 -0600)]
cygwin: add asm/bitsperlong.h, dummy asm/posix_types.h headers

These changes are necessary for cross-compiling the Linux kernel.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoMake __always_inline macro compatible with glibc
Yaakov Selkowitz [Tue, 16 Jan 2018 19:24:42 +0000 (13:24 -0600)]
Make __always_inline macro compatible with glibc

For example, this is used when cross-compiling the Linux kernel on Cygwin.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: add LFS_CFLAGS etc. to confstr/getconf
Yaakov Selkowitz [Tue, 16 Jan 2018 03:15:28 +0000 (21:15 -0600)]
cygwin: add LFS_CFLAGS etc. to confstr/getconf

These are used, for instance, when cross-compiling the Linux kernel.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agonewlib: fvprintf: fix get_arg for !_MB_CAPABLE
Ivan Grokhotkov [Tue, 9 Jan 2018 06:07:25 +0000 (14:07 +0800)]
newlib: fvprintf: fix get_arg for !_MB_CAPABLE

Code path for _MB_CAPABLE scans for the '%' character and advances
'fmt' pointer past '%'. Code path for !_MB_CAPABLE leaved fmt pointing
to '%', which caused the state machine to go from START to DONE state
immediately.

6 years agofix incompatible pointer type for va_list in nano versions of printf and scanf for...
Alexander Fedotov [Mon, 25 Dec 2017 13:28:22 +0000 (16:28 +0300)]
fix incompatible pointer type for va_list in nano versions of printf and scanf for target like PowerPC

6 years agoRISC-V: Add gdb sim and newlib nano support. Fix a few misc minor bugs.
Jim Wilson [Tue, 26 Dec 2017 20:30:27 +0000 (12:30 -0800)]
RISC-V: Add gdb sim and newlib nano support.  Fix a few misc minor bugs.

6 years agoRISC-V: Moved syscalls to separate files to fix aliasing problems.
Jim Wilson [Tue, 26 Dec 2017 20:27:52 +0000 (12:27 -0800)]
RISC-V: Moved syscalls to separate files to fix aliasing problems.

6 years agoRISC-V: Updated syscall to take 6 arguments
Jim Wilson [Tue, 26 Dec 2017 20:26:19 +0000 (12:26 -0800)]
RISC-V: Updated syscall to take 6 arguments

6 years agoRISC-V: Add nanosleep functionality
Jim Wilson [Tue, 26 Dec 2017 20:24:45 +0000 (12:24 -0800)]
RISC-V: Add nanosleep functionality

6 years agoRISC-V: Fix libnosys build.
Jim Wilson [Tue, 26 Dec 2017 20:18:42 +0000 (12:18 -0800)]
RISC-V: Fix libnosys build.

6 years agocleanup winsup/doc/etc.{postinstall,preremove}.cygwin-doc.sh quote test variables...
Brian Inglis [Fri, 22 Dec 2017 18:35:56 +0000 (11:35 -0700)]
cleanup winsup/doc/etc.{postinstall,preremove}.cygwin-doc.sh quote test variables, correct utility paths, define site in preremove

6 years agowinsup/doc/etc.postinstall.cygwin-doc.sh fix shell variable typo
Brian Inglis [Fri, 22 Dec 2017 18:32:57 +0000 (11:32 -0700)]
winsup/doc/etc.postinstall.cygwin-doc.sh fix shell variable typo

6 years agocygwin: block devices: fix file offset after short writes newlib-snapshot-20171222
Corinna Vinschen [Tue, 19 Dec 2017 17:58:06 +0000 (18:58 +0100)]
cygwin: block devices: fix file offset after short writes

When reading/writing block devices, Cygwin emulates Linux, providing
a byte-exact file position, albeit the underlying device drivers don't.

Unfortunately this only worked correctly for reading.  The raw_write
method failed to revalidate the buffer after the read-modify-write
cycle in case len is not a multiple of the sector length.  This in
turn resulted in lseek reporting a wrong file pointer.

Also, fix a condition for invalidating the buffer after writing from
a remaining read buffer.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: document sigtimedwait and ftell{o} patch
Corinna Vinschen [Mon, 18 Dec 2017 19:21:15 +0000 (20:21 +0100)]
Cygwin: document sigtimedwait and ftell{o} patch

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: ftello{64}: Handle appending stream without fflushing
Corinna Vinschen [Mon, 18 Dec 2017 19:17:51 +0000 (20:17 +0100)]
newlib: ftello{64}: Handle appending stream without fflushing

Neither upstream FreeBSD nor glibc ever call fflush from ftell
and friends.  In border cases it has the tendency to return
wrong or unexpected values, for instance on block devices.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: ftello{64}: Fix type of returned value
Corinna Vinschen [Mon, 18 Dec 2017 19:15:27 +0000 (20:15 +0100)]
newlib: ftello{64}: Fix type of returned value

Especially don't just use -1L since _off_t/_off64_t are not
guaranteed to be of type long.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: Availability of _kill() in sys/signal.h
Martin Aberg [Sun, 17 Dec 2017 18:23:51 +0000 (19:23 +0100)]
newlib: Availability of _kill() in sys/signal.h

Make prototype of _kill() always visible when _COMPILING_NEWLIB is
defined. This makes <sys/signal.h> consistent with the use of
_COMPILING_NEWLIB in <sys/unistd.h>, <sys/times.h>, etc.

6 years agoCygwin: rearrange sigwait functions, convert sigwait_common to inline
Corinna Vinschen [Mon, 18 Dec 2017 18:44:30 +0000 (19:44 +0100)]
Cygwin: rearrange sigwait functions, convert sigwait_common to inline

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: Implement sigtimedwait
Mark Geisert [Fri, 15 Dec 2017 01:05:55 +0000 (17:05 -0800)]
Cygwin: Implement sigtimedwait

Abstract out common code from sigwait/sigwaitinfo/sigtimedwait to
implement the latter.

6 years agowinsup: Belatedly add Mark Geisert to CONTRIBUTORS
Corinna Vinschen [Mon, 18 Dec 2017 18:42:42 +0000 (19:42 +0100)]
winsup: Belatedly add Mark Geisert to CONTRIBUTORS

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: Don't do double divide in powf.
Jim Wilson [Tue, 12 Dec 2017 19:39:13 +0000 (11:39 -0800)]
newlib: Don't do double divide in powf.

* Use 0.0f instead of 0.0 in divide.

6 years agoDon't call double rint from float powf.
Jim Wilson [Tue, 12 Dec 2017 19:38:01 +0000 (11:38 -0800)]
Don't call double rint from float powf.

Updated patch to use 0.0f in addition to calling rintf.

Tested same way as before, with a testcase that triggers the code and
make check.

OK?

newlib/
* libm/math/wf_pow.c (powf): Call rintf instead of rint.  Use 0.0f
for compare.

6 years agoUpdate MAINTAINERS file email address.
Jim Wilson [Tue, 12 Dec 2017 00:14:18 +0000 (16:14 -0800)]
Update MAINTAINERS file email address.

To update my email address to my current employer.  Specifix died quite a while
ago, and I've had two jobs in the interim.

newlib/
* MAINTAINERS: Update my email address.

6 years agocygwin: add mmap fork fix to 2.10.0 release test
Corinna Vinschen [Sun, 10 Dec 2017 13:32:34 +0000 (14:32 +0100)]
cygwin: add mmap fork fix to 2.10.0 release test

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: mmap: fix comment and formatting, drop unused code
Corinna Vinschen [Sun, 10 Dec 2017 13:11:41 +0000 (14:11 +0100)]
cygwin: mmap: fix comment and formatting, drop unused code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: mmap: fix a fork failure with private, anonymous mappings
Corinna Vinschen [Sun, 10 Dec 2017 13:11:03 +0000 (14:11 +0100)]
cygwin: mmap: fix a fork failure with private, anonymous mappings

Rounddown incoming addr on a page boundary. Without this, we may end
up with a fork error for private, anonymous maps.  The reason is, we
use VirtualAlloc in this case which will potentially overcommit if
addr is not on a page boundary.  This isn't taken into account in
bookkeeping, but fixup_mmaps_after_fork will eventually stumble over
this when trying to reproduce the copy-on-write pages: VirtualQuery
returns a region reaching beyond the supposedly allocated address
range and from there it goes downhill.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: Improve discussion of linker library ordering in faq-programming
Jon Turney [Mon, 6 Mar 2017 17:45:40 +0000 (17:45 +0000)]
cygwin: Improve discussion of linker library ordering in faq-programming

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
6 years agomakedoc: warn about some obsolete and deprecated commands
Jon Turney [Tue, 5 Dec 2017 18:40:44 +0000 (18:40 +0000)]
makedoc: warn about some obsolete and deprecated commands

To follow up the thread starting at [1], since all uses of TRAD_SYNOPSIS
have been removed, and all uses of ANSI_SYNOPSIS have been renamed to
SYNOPSIS, we can now warn about the use of these.

[1] https://sourceware.org/ml/newlib/2017/msg01182.html

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
6 years agomakedoc: exit with non-zero status on error
Jon Turney [Mon, 4 Dec 2017 18:24:55 +0000 (18:24 +0000)]
makedoc: exit with non-zero status on error

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
6 years agomakedoc: make errors visible
Jon Turney [Mon, 4 Dec 2017 18:08:28 +0000 (18:08 +0000)]
makedoc: make errors visible

Discard QUICKREF sections, rather than writing them to stderr
Discard MATHREF sections, rather than discarding as an error
Pass NOTES sections through to texinfo, rather than discarding as an error
Don't redirect makedoc stderr to .ref file
Remove makedoc output on error
Remove .ref files from CLEANFILES
Regenerate Makefile.ins

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
6 years agocygwin: doc: cleanup cygutils info
Corinna Vinschen [Tue, 5 Dec 2017 16:58:02 +0000 (17:58 +0100)]
cygwin: doc: cleanup cygutils info

Especially don't keep on about d2u and u2d.  Dos2unix exists.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: vfwscanf: fix negation bug in %[ conversion
Corinna Vinschen [Mon, 4 Dec 2017 16:05:11 +0000 (17:05 +0100)]
newlib: vfwscanf: fix negation bug in %[ conversion

Old BSD bug:  While ^ is recognized and the set of matching characters
is negated, the code neglects to increment the pointer pointing to the
matching characters.  Thus, on a negation expression like %[^xyz], the
matching doesn't only stop at x, y, or z, but incorrectly also on ^.

Fix this by setting the start pointer after recognizing the ^.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agossp: add Object Size Checking for wchar.h, part 1
Yaakov Selkowitz [Fri, 1 Dec 2017 18:45:14 +0000 (12:45 -0600)]
ssp: add Object Size Checking for wchar.h, part 1

The following functions are also guarded in glibc:
fwprintf, swprintf, wprintf, vfwprintf, vswprintf, vwprintf.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocygwin: document %l[ and bump API minor
Corinna Vinschen [Fri, 1 Dec 2017 17:21:59 +0000 (18:21 +0100)]
cygwin: document %l[ and bump API minor

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: vfscanf: Implement %l[
Corinna Vinschen [Fri, 1 Dec 2017 16:53:59 +0000 (17:53 +0100)]
newlib: vfscanf: Implement %l[

Just as %lc and %ls, this is only enabled on ELIX_LEVEL >= 2.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: vf[w]scanf: Fix conversion multibyte <-> wchar_t
Corinna Vinschen [Fri, 1 Dec 2017 16:18:26 +0000 (17:18 +0100)]
newlib: vf[w]scanf: Fix conversion multibyte <-> wchar_t

* vfscanf: per POSIX, if the target type is wchar_t, the width is
  counted in (multibyte) characters, not in bytes.

* vfscanf: Handle UTF-8 multibyte sequences converted to surrogate
  pairs on UTF-16 systems.

* vfwscanf: Don't count high surrogates in input against field width
  counting.  Per POSIX, input is

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: vf[w]scanf: Drop width computation mixup
Corinna Vinschen [Fri, 1 Dec 2017 12:47:26 +0000 (13:47 +0100)]
newlib: vf[w]scanf: Drop width computation mixup

The width value keeps the maximum field width.  This is the maximum
field width of the *input*.  It's *never* to be used in conjunction
with the number of bytes or characters written to the output argument.

However, especially in vfwscanf, the code is partially taken from
NetBSD which erroneously subtracts the number of multibyte chars
written to the argument from the width variable, thus potentially
subtracting up to MB_CUR_MAX from width for a single character in
the input stream.

To make matters worse, the previous patch adding %m added basically
the same mistake for 'c' type input.

Fix it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoHOWTO: remove reference to TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:52:35 +0000 (02:52 -0600)]
HOWTO: remove reference to TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agomathfp: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:51:13 +0000 (02:51 -0600)]
mathfp: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agomath: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:45:57 +0000 (02:45 -0600)]
math: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agolibm/machine: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:37:42 +0000 (02:37 -0600)]
libm/machine: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agocomplex: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:37:04 +0000 (02:37 -0600)]
complex: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agolibm/common: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:36:17 +0000 (02:36 -0600)]
libm/common: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agounix: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:23:19 +0000 (02:23 -0600)]
unix: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agotime: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:22:31 +0000 (02:22 -0600)]
time: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agosys: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:21:24 +0000 (02:21 -0600)]
sys: remove TRAD_SYNOPSIS

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agostring: remove TRAD_SYNOPSIS
Yaakov Selkowitz [Thu, 30 Nov 2017 08:20:06 +0000 (02:20 -0600)]
string: remove TRAD_SYNOPSIS

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