]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
7 years agoFix sys/reent.h to remove use of DEBUG flag.
Jeff Johnston [Mon, 9 Jan 2017 23:21:19 +0000 (18:21 -0500)]
Fix sys/reent.h to remove use of DEBUG flag.

- use of DEBUG flag is non-standard and interferes with other
  project's using same flag
- change to be _REENT_CHECK_DEBUG which means the flag is
  allowing debugging of _REENT_CHECK macros
- use #ifdef instead of #if

7 years agoFix formatting in pinfo.cc
Corinna Vinschen [Tue, 10 Jan 2017 15:38:01 +0000 (16:38 +0100)]
Fix formatting in pinfo.cc

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoDocument latest Cygwin changes
Corinna Vinschen [Tue, 10 Jan 2017 15:33:21 +0000 (16:33 +0100)]
Document latest Cygwin changes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd Erik Bray to Cygwin CONTRIBUTORS
Corinna Vinschen [Tue, 10 Jan 2017 15:32:45 +0000 (16:32 +0100)]
Add Erik Bray to Cygwin CONTRIBUTORS

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd a /proc/<pid>/environ proc file handler, analogous to /proc/<pid>/cmdline.
Erik M. Bray [Tue, 10 Jan 2017 15:03:10 +0000 (16:03 +0100)]
Add a /proc/<pid>/environ proc file handler, analogous to /proc/<pid>/cmdline.

7 years agoAdd a _pinfo.environ() method analogous to _pinfo.cmdline(), and others.
Erik M. Bray [Tue, 10 Jan 2017 15:03:09 +0000 (16:03 +0100)]
Add a _pinfo.environ() method analogous to _pinfo.cmdline(), and others.

Returns the process's environment concatenated into a single block of
null-terminated strings, along with the length of the environment block.

Adds an associated PICOM_ENVIRON commune_process handler.

7 years agoMove the core environment parsing of environ_init into a new win32env_to_cygenv function.
Erik M. Bray [Tue, 10 Jan 2017 15:03:08 +0000 (16:03 +0100)]
Move the core environment parsing of environ_init into a new win32env_to_cygenv function.

win32env_to_cygwenv handles converting wchar to char and some other
minor taks.  Optionally it handles converting any paths in variables to
posix paths.

This will be useful for implementing /proc/<pid>/environ

7 years agoReturn the correct value for getsockopt(SO_REUSEADDR) after setting setsockopt(SO_REU...
Erik M. Bray [Mon, 9 Jan 2017 16:36:47 +0000 (17:36 +0100)]
Return the correct value for getsockopt(SO_REUSEADDR) after setting setsockopt(SO_REUSEADDR, 1).

7 years agoFix versions in documentation (manually for now)
Corinna Vinschen [Mon, 9 Jan 2017 15:22:02 +0000 (16:22 +0100)]
Fix versions in documentation (manually for now)

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd pthread_setname_np() and pthread_getname_np()
Sebastian Huber [Mon, 9 Jan 2017 14:14:42 +0000 (15:14 +0100)]
Add pthread_setname_np() and pthread_getname_np()

The pthread_setname_np() and pthread_getname_np() are GNU extensions and
provided by glibc.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFix incorrect cast in nano malloc
Joe Seymour [Tue, 3 Jan 2017 14:50:53 +0000 (14:50 +0000)]
Fix incorrect cast in nano malloc

As described in nano-mallocr.c, chunks of heap are represented in memory
as a size (of type long), followed by some optional padding containing a
negative offset to size, followed by the data area.

get_chunk_from_ptr is responsible for taking a pointer to the data area
(as returned by malloc) and finding the start of the chunk. It does this
by assuming there is no padding and trying to read the size, if the size
is negative then it uses that as an offset to find the true size.
Crucially, it reads the padding area as a long.

nano_malloc is responsible for populating the optional padding area. It
does so by casting a pointer to an (int *) and writing the negative
offset into it.

This means that padding is being written as an int but read as a long.

On msp430 an int is 2 bytes, while a long is 4 bytes. This means that 2
bytes are written to the padding, but 4 bytes are read from it: it has
only been partially initialised.

nano_malloc is the default malloc implementation for msp430.

This patch changes the cast from (int *) to (long *). The change to
nano_malloc has has been observed to fix a TI Energia project that
had been malfunctioning because malloc was returning invalid addresses.
The change to nano_memalign is based entirely on code inspection.

I've built and tested as follows:
  Configured (gcc+newlib) with: --target=msp430-elf --enable-languages=c
  gcc testsuite variations:
    msp430-sim/-mcpu=msp430
    msp430-sim/-mcpu=msp430x
    msp430-sim/-mcpu=msp430x/-mlarge/-mdata-region=either/-mcode-region=either
    msp430-sim/-mhwmult=none
    msp430-sim/-mhwmult=f5series
My testing has shown no regressions, however I don't know if the gcc
testsuite provides sufficient coverage for this patch?

I don't have write access, so if this patch is acceptable after review,
I would appreciate it if someone would commit it for me.

Thanks,

2017-01-XX  Joe Seymour  <joe.s@somniumtech.com>

newlib/
* libc/stdlib/nano-mallocr.c (nano_malloc): Fix incorrect cast.
(nano_memalign): Likewise.

7 years agoRTEMS: Add user-defined name to thread queues
Sebastian Huber [Wed, 21 Dec 2016 07:56:41 +0000 (08:56 +0100)]
RTEMS: Add user-defined name to thread queues

Add a user-defined name to the self-contained synchronization objects in
order to make system diagnostics, tracing and debugging more user
friendly.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoDon't free statically allocated sys_privs
Corinna Vinschen [Mon, 9 Jan 2017 13:02:19 +0000 (14:02 +0100)]
Don't free statically allocated sys_privs

commit 67fd2101 introduced a bad bug.  Changing sys_privs to a static
area and just returning a pointer is nice... *if* the calling code doesn't
call free() on it.  Make sure callers check pointer for sys_privs and
refrain from calling free, if so.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoBump release to 2.5.0 for yearly snapshot. newlib-2_5_0
Jeff Johnston [Fri, 23 Dec 2016 02:33:54 +0000 (21:33 -0500)]
Bump release to 2.5.0 for yearly snapshot.

7 years agoThis is an attempt to fix the problem described here:
Jeff Johnston [Thu, 22 Dec 2016 19:50:00 +0000 (14:50 -0500)]
This is an attempt to fix the problem described here:

https://sourceware.org/ml/newlib/2016/msg01139.html
https://gcc.gnu.org/ml/gcc/2016-12/msg00010.html

There is no change if libtool is used.

Some run-time support libraries provided by GCC (e.g. libgomp) use
configure checks to detect certain features, e.g. availability of
thread-local storage.  The configure script generates a test program and
tries to compile and link it.  It should use target libraries and
startfiles of the build tree if available and not random ones from the
installation prefix for this procedure.  The search directories
specified by -B are a bit special, see for_each_path() in gcc.c of the
GCC sources.  First a search is performed on all search paths with the
multilib directory appended (if desired), then a second search is
performed on demand with the base directory only.  For each multilib
there is a "newlib" subdirectory.  This directory is specified by a -B
option for the support libraries.  In order to find the newlib artifacts
(ctr0.o, libc.a, libg.a and libm.a) they must be located in a proper
multilib subdirectory withing the build directory.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoRTEMS: Increase SEM_VALUE_MAX
Sebastian Huber [Mon, 19 Dec 2016 14:19:47 +0000 (15:19 +0100)]
RTEMS: Increase SEM_VALUE_MAX

RTEMS defined SEM_VALUE_MAX to 32767 unlike other systems like FreeBSD
and glibc.  A common value is INT_MAX.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoExport getentropy and getrandom calls
Corinna Vinschen [Fri, 16 Dec 2016 22:10:19 +0000 (23:10 +0100)]
Export getentropy and getrandom calls

getentropy per OpenBSD

  http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2

getrandom per Linux

  http://man7.org/linux/man-pages/man2/getrandom.2.html

  Note that GRND_NONBLOCK is not handled

7 years agoRemove extraneous float casts in wcstod.c.
Corinna Vinschen [Fri, 16 Dec 2016 18:25:30 +0000 (19:25 +0100)]
Remove extraneous float casts in wcstod.c.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRemove extraneous float casts in strtod.c.
Jeff Johnston [Fri, 16 Dec 2016 16:32:25 +0000 (11:32 -0500)]
Remove extraneous float casts in strtod.c.

7 years ago2016-12-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com> cygwin-2_6_1-release
Jeff Johnston [Thu, 15 Dec 2016 17:23:27 +0000 (12:23 -0500)]
2016-12-15  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * libc/stdlib/strtod.c (strtof_l): Set errno to ERANGE when double to
     float conversion results in infinity.
     (strtof): Likewise.
     * libc/stdlib/wcstod.c (wcstof_l): Likewise.
     (wcstof): Likewise.

7 years ago2016-12-15 Giuseppe Musumeci <giuseppe.musumeci@broadcom.com>
Jeff Johnston [Thu, 15 Dec 2016 17:06:04 +0000 (12:06 -0500)]
2016-12-15 Giuseppe Musumeci <giuseppe.musumeci@broadcom.com>

__sinit initialises some common file descriptors as line buffered and
relies on the first users of such FDs to call __smakebuf_r. If
__smakebuf_r realises there's no space for a buffer (malloc returns
NULL), it makes them unbuffered. However, while setting the __SNBF
bit, it doesn't clear the __SLBF bit in the flags. Depending on the
order in which functions check buffering flags in the FD, sometime
they assume it's line buffered (e.g. __sfvwrite_r), trashing
application memory that's not really been allocated to them.

This patch solves the problem by clearing the unbuffered/line buffered
flag when setting the line buffered/unbuffered flag.

7 years agoFix some broken links in Cygwin FAQ
Jon Turney [Mon, 12 Dec 2016 18:29:48 +0000 (18:29 +0000)]
Fix some broken links in Cygwin FAQ

GNU no longer encourages the use of documentation mirrors, to avoid
referring to obsolete documentation.  Also www.fsf.org/manual/ is
just a redirect to www.gnu.org/manual/

Links to using-utils.html #fragments are no longer correct as each utility
is now a separate page, since 646745cb.

indiana.edu seems to have moved XLiveCD information, without a redirect.

Linking to clean_setup.pl on cygwin.com doesn't work, as direct downloads
aren't allowed, so instead state where it can be found on a mirror.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoDefine RtlGenRandom correctly in ntsecapi.h wrapper
Corinna Vinschen [Wed, 14 Dec 2016 13:14:28 +0000 (14:14 +0100)]
Define RtlGenRandom correctly in ntsecapi.h wrapper

Include ntsecapi.h where required and just redefine RtlGenRandom
correctly in the ntsecapi.h wrapper.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRearrange RNG code slightly
Corinna Vinschen [Tue, 13 Dec 2016 21:59:31 +0000 (22:59 +0100)]
Rearrange RNG code slightly

In preparation of exporting getentropy/getrandom to userspace, rearrange
code a bit:

- Define RtlGenRandom in ntdll.h.

- Drop calls to getentropy in favor of RtlGenRandom (fhandler_socket,
  fhandler_dev_random).

- Add try/except blocks in fhandler_dev_random to return EFAULT rather
  than crashing if buffer pointer is invalid.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoCygwin: Add release messages for last two checkins
Corinna Vinschen [Tue, 13 Dec 2016 11:49:02 +0000 (12:49 +0100)]
Cygwin: Add release messages for last two checkins

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix incorrect path conversion on non-existent files on network shares
Corinna Vinschen [Tue, 13 Dec 2016 11:48:05 +0000 (12:48 +0100)]
Fix incorrect path conversion on non-existent files on network shares

NtOpenFile/NtCreateFile on non-existent paths on network drives has a
bug.  Assuming a path Z:\dir\file.  Further assuming that Z:\dir does
not exist.

The first NtOpenFile("Z:\dir\file") correctly returns
STATUS_OBJECT_PATH_NOT_FOUND.  Subsequent calls incorrectly
return STATUS_OBJECT_NAME_NOT_FOUND.

This appears to be some kind of caching behaviour.  Waiting a while
before repeating the call correctly returns STATUS_OBJECT_PATH_NOT_FOUND
again.

This patch works around the observed misbehaviour.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoCheck for .exe file in cygwin_conv_path
Corinna Vinschen [Tue, 13 Dec 2016 11:21:27 +0000 (12:21 +0100)]
Check for .exe file in cygwin_conv_path

So far, when converting from POSIX to Windows notation, cygwin_conv_path
fails to check for .exe suffix, so /path/foo did not return /path/foo.exe
even if this file exists.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoBig-endian fix for memcpy-armv7m.S
Julian Brown [Fri, 9 Dec 2016 13:54:17 +0000 (13:54 +0000)]
Big-endian fix for memcpy-armv7m.S

In the case of memcpy-armv7m.S being built for a big-endian multilib
(including armv7 without a specific profile), realignment code made
assumptions about the byte ordering being little-endian.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix 'make man' for parallel make
Jon Turney [Tue, 6 Dec 2016 15:06:26 +0000 (15:06 +0000)]
Fix 'make man' for parallel make

Ensure the Python Lex/Yacc (PLY) cache used by makedocbook is initialized
before it is used by parallelizable rules to make the DocBook XML, as it
appears that these can collide in cache generation, leading to errors.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoCygwin 2.6.1: Add missing release text
Corinna Vinschen [Tue, 6 Dec 2016 15:11:04 +0000 (16:11 +0100)]
Cygwin 2.6.1: Add missing release text

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd <devctl.h> per POSIX 1003.26-2003
Joel Sherrill [Thu, 1 Dec 2016 15:46:32 +0000 (09:46 -0600)]
Add <devctl.h> per POSIX 1003.26-2003

7 years agoAdd missing crt0 symbols for RTEMS
Sebastian Huber [Mon, 5 Dec 2016 07:22:51 +0000 (08:22 +0100)]
Add missing crt0 symbols for RTEMS

In order to enable proper detection of thread-local storage availability
we have to provide some symbols on ARM.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agopath_conv: When encountering a ".(/)+" sequence, skip *all* slashes
Corinna Vinschen [Mon, 28 Nov 2016 11:33:40 +0000 (12:33 +0100)]
path_conv: When encountering a ".(/)+" sequence, skip *all* slashes

The original code only skipped the "./", but missed to test if more
trailing slashes are present.  This in turn leads to invalid conversion.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoEnforce no arguments for __get_current_locale/__get_C_locale
Corinna Vinschen [Mon, 28 Nov 2016 09:18:49 +0000 (10:18 +0100)]
Enforce no arguments for __get_current_locale/__get_C_locale

Remember: foo() != foo(void)

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoCorrect argument to __get_current_locale.
Douglas [Sun, 27 Nov 2016 01:13:31 +0000 (12:13 +1100)]
Correct argument to __get_current_locale.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoSelf-contained pthread_spinlock_t for RTEMS
Sebastian Huber [Thu, 24 Nov 2016 09:58:35 +0000 (10:58 +0100)]
Self-contained pthread_spinlock_t for RTEMS

Turn pthread_spinlock_t into a self-contained object.  On uni-processor
configurations, interrupts are disabled in the lock/trylock operations
and the previous interrupt status is restored in the corresponding
unlock operations.  On SMP configurations, a ticket lock is a acquired
and released in addition.

See also:

https://devel.rtems.org/ticket/2674

This implementation is simple and efficient.  However, this test case of
the Linux Test Project would fail due to call of printf() and sleep()
during spin lock ownership:

https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoregex: Fix typo in CHaddrange
Corinna Vinschen [Thu, 24 Nov 2016 15:09:31 +0000 (16:09 +0100)]
regex: Fix typo in CHaddrange

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygutils: Fix resource leak in get_short_paths
Corinna Vinschen [Thu, 24 Nov 2016 15:04:42 +0000 (16:04 +0100)]
cygutils: Fix resource leak in get_short_paths

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix typo in kill(1)
Corinna Vinschen [Thu, 24 Nov 2016 15:00:28 +0000 (16:00 +0100)]
Fix typo in kill(1)

buf is just a local buffer, sig is ultimately pointing to the
signal string.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years ago_pinfo::set_ctty: Check potential NULL pointer in debug_printf statement
Corinna Vinschen [Thu, 24 Nov 2016 14:06:51 +0000 (15:06 +0100)]
_pinfo::set_ctty: Check potential NULL pointer in debug_printf statement

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoEliminate unused parameter from path_conv::eq_worker
Corinna Vinschen [Thu, 24 Nov 2016 14:06:05 +0000 (15:06 +0100)]
Eliminate unused parameter from path_conv::eq_worker

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRemove redundant check for NULL pointer in cygwin_exception::dump_exception
Corinna Vinschen [Thu, 24 Nov 2016 13:46:57 +0000 (14:46 +0100)]
Remove redundant check for NULL pointer in cygwin_exception::dump_exception

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix copy/paste typo in fhandler_console::scroll_buffer_screen
Corinna Vinschen [Thu, 24 Nov 2016 13:43:52 +0000 (14:43 +0100)]
Fix copy/paste typo in fhandler_console::scroll_buffer_screen

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoDon't allow sending invalid signals from user space
Corinna Vinschen [Thu, 24 Nov 2016 13:10:41 +0000 (14:10 +0100)]
Don't allow sending invalid signals from user space

Don't allow signal 0 in signal(2), sigaction(2), siginterrupt(3).
Don't allow any signal in sigqueue(3) but explicitely handle
signal 0 as in kill(2).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoraise: Add missing extern "C"
Corinna Vinschen [Thu, 24 Nov 2016 13:02:11 +0000 (14:02 +0100)]
raise: Add missing extern "C"

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agologin_tty: Rewrite following FreeBSD's traces
Corinna Vinschen [Thu, 24 Nov 2016 11:06:29 +0000 (12:06 +0100)]
login_tty: Rewrite following FreeBSD's traces

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agofcwd_access_t: Add missing breaks in f_cwd pointer computation
Corinna Vinschen [Thu, 24 Nov 2016 09:53:08 +0000 (10:53 +0100)]
fcwd_access_t: Add missing breaks in f_cwd pointer computation

Fixes Coverity CIDs 59893/59894

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd comments to intentional switch fallthroughs
Corinna Vinschen [Thu, 24 Nov 2016 09:51:32 +0000 (10:51 +0100)]
Add comments to intentional switch fallthroughs

Clarify Coverity "Missing break in switch" messages.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd length check creating domain\group strings
Corinna Vinschen [Thu, 24 Nov 2016 09:40:14 +0000 (10:40 +0100)]
Add length check creating domain\group strings

Fix Coverity CID 153932

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoProvide <memory.h>
Sebastian Huber [Tue, 22 Nov 2016 06:59:17 +0000 (07:59 +0100)]
Provide <memory.h>

Provide <memory.h> for all standard Newlib targets and remove
Cygwin-specific header.  Most POSIX like systems provide this historic
header.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoDeclare non-standard pthread_yield()
Sebastian Huber [Tue, 22 Nov 2016 06:59:16 +0000 (07:59 +0100)]
Declare non-standard pthread_yield()

The non-standard pthread_yield() function is available at least on
Cygwin, FreeBSD and glibc.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoMove pthread types to <sys/_pthreadtypes.h>
Sebastian Huber [Wed, 16 Nov 2016 13:51:31 +0000 (14:51 +0100)]
Move pthread types to <sys/_pthreadtypes.h>

This makes it possible provide operating system specific types for
<pthread.h>.  It is in line with the FreeBSD header file structure and
allows a future cleanup of <pthread.h> to not expose unrelated things
via <sys/types.h> and <unistd.h>.  Glibc uses the similar
<bits/pthreadtypes.h> for this purpose.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd _TICKET_LOCK_INITIALIZER to <sys/lock.h>
Sebastian Huber [Thu, 17 Nov 2016 10:21:28 +0000 (11:21 +0100)]
Add _TICKET_LOCK_INITIALIZER to <sys/lock.h>

Add _TICKET_LOCK_INITIALIZER to statically initialize a
_Ticket_lock_Control structure.  This makes it possible to embed a
ticket lock in other structures outside of <sys/lock.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoUse __inline in <sys/lock.h> for RTEMS
Sebastian Huber [Wed, 16 Nov 2016 13:51:29 +0000 (14:51 +0100)]
Use __inline in <sys/lock.h> for RTEMS

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd release note for commit 8a32c24
Corinna Vinschen [Thu, 17 Nov 2016 10:11:11 +0000 (11:11 +0100)]
Add release note for commit 8a32c24

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoUse allocation granularity as the 'page_size' in /proc/<pid>/status as well, for...
Erik M. Bray [Wed, 16 Nov 2016 14:50:34 +0000 (15:50 +0100)]
Use allocation granularity as the 'page_size' in /proc/<pid>/status as well, for consistency with /proc/<pid>/statm

7 years agostatm should report memory as multiples of allocation_granularity instead of page_size
Erik M. Bray [Wed, 16 Nov 2016 14:36:41 +0000 (15:36 +0100)]
statm should report memory as multiples of allocation_granularity instead of page_size

that ensures that values in statm mupltiplied by POSIX _SC_PAGESIZE give the correct values

7 years agosys/cdefs.h: Define __hidden as empty on Cygwin
Corinna Vinschen [Tue, 8 Nov 2016 15:14:43 +0000 (16:14 +0100)]
sys/cdefs.h: Define __hidden as empty on Cygwin

Non-default visibility attributes are unsupported on PE/COFF, so don't
use in __hidden definition for Cygwin.  Add comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoUse external header file for kernel space time
Sebastian Huber [Thu, 27 Oct 2016 06:38:17 +0000 (08:38 +0200)]
Use external header file for kernel space time

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd kernel space header for <sys/lock.h> for RTEMS
Sebastian Huber [Thu, 27 Oct 2016 06:38:16 +0000 (08:38 +0200)]
Add kernel space header for <sys/lock.h> for RTEMS

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoUse external header file for kernel space types
Sebastian Huber [Thu, 27 Oct 2016 06:38:15 +0000 (08:38 +0200)]
Use external header file for kernel space types

The FreeBSD kernel types are not used in Newlib.  Provide them via an
external header file to decouple Newlib and FreeBSD updates for RTEMS.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoProvide cap_ioctl_t for RTEMS
Sebastian Huber [Thu, 27 Oct 2016 06:38:14 +0000 (08:38 +0200)]
Provide cap_ioctl_t for RTEMS

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFix pdf build failure with texinfo 6.1.0
Thomas Preudhomme [Tue, 25 Oct 2016 15:11:09 +0000 (16:11 +0100)]
Fix pdf build failure with texinfo 6.1.0

Hi,

make pdf on Ubuntu 16.04 fail with:

newlib/libc/libc.texinfo:9: Missing @endcsname inserted.

After a lot of fiddling the reason appears to be the combination of concept
and function index despite a lack of concept index entries. Arguably texinfo
should not error in that case but here we are, newlib will fail to build its
documentation on some systems because of this. Since libc.texinfo only
contains function index entries this patch simply removes the combination of
indices. It does the same for libm.texinfo which has concept index entries but
no function index entries.

Tested by running make pdf, make dvi, make info and make html successfully.
libc.pdf appears to have only one index as expected.

== Proposed commit message ==

Fix pdf build failure with texinfo 6.1.0 as provided in Ubuntu 16.04. Index
combination in libc.texinfo and libm.texinfo fails because both file have only
one type of index entries. Removing index combination is thus harmless and
solves the problem.

Is this ok for master?

Best regards,

Thomas

7 years agoProvide vm_page_t for RTEMS via <machine/_types.h>
Sebastian Huber [Tue, 25 Oct 2016 06:34:24 +0000 (08:34 +0200)]
Provide vm_page_t for RTEMS via <machine/_types.h>

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoProvide rman_res_t for RTEMS via <machine/types.h>
Sebastian Huber [Tue, 25 Oct 2016 05:13:50 +0000 (07:13 +0200)]
Provide rman_res_t for RTEMS via <machine/types.h>

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoProvide __intmax_t and __uintmax_t
Sebastian Huber [Tue, 25 Oct 2016 05:13:49 +0000 (07:13 +0200)]
Provide __intmax_t and __uintmax_t

Provide __intmax_t and __uintmax_t via <machine/_default_types.h> and
define intmax_t and uintmax_t in <sys/_stdint.h> for FreeBSD
compatibility.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFix typo in <sys/_stdint.h>
Sebastian Huber [Tue, 25 Oct 2016 05:13:48 +0000 (07:13 +0200)]
Fix typo in <sys/_stdint.h>

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFix ShellExecuteW comment
Corinna Vinschen [Mon, 24 Oct 2016 09:23:55 +0000 (11:23 +0200)]
Fix ShellExecuteW comment

ShellExecuteW long path behaviour is now stable: It doesn't work since
Windows 8.1.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agopldd: Fix resource leak and missing check if fopen failed
Corinna Vinschen [Sun, 23 Oct 2016 15:22:34 +0000 (17:22 +0200)]
pldd: Fix resource leak and missing check if fopen failed

Fixes Coverity CID 66903

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agopasswd: Fix potential buffer overflow
Corinna Vinschen [Sun, 23 Oct 2016 15:16:30 +0000 (17:16 +0200)]
passwd: Fix potential buffer overflow

Fixes Coverity CID 66956

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agomkgroup/mkpasswd: Fix potential buffer overwrite in corner case
Corinna Vinschen [Sun, 23 Oct 2016 15:02:24 +0000 (17:02 +0200)]
mkgroup/mkpasswd: Fix potential buffer overwrite in corner case

Fixes Coverity CIDs 60076, 60077 and 60081

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agogetfacl: Don't trust length of incoming user/groupname
Corinna Vinschen [Sun, 23 Oct 2016 14:52:28 +0000 (16:52 +0200)]
getfacl: Don't trust length of incoming user/groupname

Fixes Coverity CIDs 60079 and 60080

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agotzset: Fix array length given to GetGeoInfoW
Corinna Vinschen [Sun, 23 Oct 2016 14:45:21 +0000 (16:45 +0200)]
tzset: Fix array length given to GetGeoInfoW

Fixes Coverity CID 66916

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agostrace: Fix Coverity issues
Corinna Vinschen [Sun, 23 Oct 2016 14:38:48 +0000 (16:38 +0200)]
strace: Fix Coverity issues

CID 66964: Don't trust environment variable without length check
CID 66968: Add missing va_end

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygcheck: Use snprintf instead of multiple strcat
Corinna Vinschen [Sun, 23 Oct 2016 14:16:22 +0000 (16:16 +0200)]
cygcheck: Use snprintf instead of multiple strcat

This not only simplifies the code but also fixes potential
memory corruption

Fixes Coverity CID 66952

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygcheck: Eenable output of Vista++ FS flags
Corinna Vinschen [Sun, 23 Oct 2016 13:57:40 +0000 (15:57 +0200)]
cygcheck: Eenable output of Vista++ FS flags

Also, code cleanup

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygcheck: Eliminate dead code
Corinna Vinschen [Sat, 22 Oct 2016 20:57:03 +0000 (22:57 +0200)]
cygcheck: Eliminate dead code

Fixes Coverity CID 66907

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygcheck: Fix broken test for invalid wcstombs conversion reading symlinks
Corinna Vinschen [Sat, 22 Oct 2016 20:53:29 +0000 (22:53 +0200)]
cygcheck: Fix broken test for invalid wcstombs conversion reading symlinks

Fixes Coverity CID 66905

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygcheck: Fix check for Cygwin symlink
Corinna Vinschen [Sat, 22 Oct 2016 20:44:25 +0000 (22:44 +0200)]
cygcheck: Fix check for Cygwin symlink

Fixes Coverity CID 66904 and 66906

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agostrace: Add comment trying to explain confusing code
Corinna Vinschen [Sat, 22 Oct 2016 20:39:31 +0000 (22:39 +0200)]
strace: Add comment trying to explain confusing code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygcheck: Close with pclose what has been opened with popen
Corinna Vinschen [Sat, 22 Oct 2016 20:14:34 +0000 (22:14 +0200)]
cygcheck: Close with pclose what has been opened with popen

Fixes Coverity CID 66900

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agotowupper: Eliminate dead code
Corinna Vinschen [Sat, 22 Oct 2016 20:00:51 +0000 (22:00 +0200)]
towupper: Eliminate dead code

Fixes Coverity CID 59865

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix a potential buffer overflow in wscanf family
Corinna Vinschen [Sat, 22 Oct 2016 19:43:28 +0000 (21:43 +0200)]
Fix a potential buffer overflow in wscanf family

Fixes Coverity CID 60046

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoget_alt_digits: Fix typo in allocation
Corinna Vinschen [Sat, 22 Oct 2016 19:29:10 +0000 (21:29 +0200)]
get_alt_digits: Fix typo in allocation

adi->digit is an array of CHAR *, not of CHAR **.

Fixes Coverity CID 60043

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRemove unreachable code from passwd(1)
Corinna Vinschen [Sat, 22 Oct 2016 19:20:28 +0000 (21:20 +0200)]
Remove unreachable code from passwd(1)

Fixed Coverity CID 66966

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoActually return value from __cp_index
Corinna Vinschen [Sat, 22 Oct 2016 19:08:44 +0000 (21:08 +0200)]
Actually return value from  __cp_index

Fixes Coverty CID 153470

Also drop redundant declaration of __cp_index.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoDrop redundant checks for NULL input string in wctomb helper funcs
Corinna Vinschen [Sat, 22 Oct 2016 18:28:08 +0000 (20:28 +0200)]
Drop redundant checks for NULL input string in wctomb helper funcs

Fixes Coverity CIDs 153465 and 153466

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix check for empty locale string in newlocale
Corinna Vinschen [Sat, 22 Oct 2016 18:22:20 +0000 (20:22 +0200)]
Fix check for empty locale string in newlocale

The original test is broken.  It tests for a NULL locale which
isn't just wrong, it simply can't occur at this point due to an
earlier check for a NULL locale string.  Thus, the locale info
for a category is never taken from the environment.

Fixes Coverty CID 153467.

Also, add comment.

Also, add some parens for readability.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd _PC_CASE_INSENSITIVE to [f]pathconf
Ken Brown [Thu, 20 Oct 2016 19:35:54 +0000 (15:35 -0400)]
Add _PC_CASE_INSENSITIVE to [f]pathconf

Update the getconf utility to support the new flag as well as
_PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY.  These were previously
unsupported, probably as an oversight.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix SetThreadName with gdb 7.10 on x86
Jon Turney [Sun, 11 Sep 2016 12:37:54 +0000 (13:37 +0100)]
Fix SetThreadName with gdb 7.10 on x86

Additionally to eccefd97, we need to ensure the exception handler is
installed for the _ljfault used to implement _try/_except to get called.

Also use the correct macro for x86 conditional compilation.

Addresses https://cygwin.com/ml/cygwin/2016-09/msg00143.html

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoUpdate FAQ answer about setting an early breakpoint
Jon Turney [Sun, 11 Sep 2016 12:41:32 +0000 (13:41 +0100)]
Update FAQ answer about setting an early breakpoint

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoDon't check directories always case-insensitive in rename(2)
Corinna Vinschen [Wed, 19 Oct 2016 11:26:03 +0000 (13:26 +0200)]
Don't check directories always case-insensitive in rename(2)

Long-standing problem in one of the corner cases of rename(2):
If we rename a directory a check is performed to see if newpath is
identical to oldpath or a subdir of oldpath. This check is
(accidentally? no hints anywhere in ChangeLogs or code) performed
case-insensitive for as long as we use Unicode paths and NT functions.
This leads to the problems described in
https://cygwin.com/ml/cygwin/2016-09/msg00264.html

Change this to be conditional case-sensitive as all other checks but
let's take this with a grain of salt.  There may be corner-cases in
this corner-case which require to chek parts of the path always
case-insensitive.  Off the top of my head I can't construct such a
case but that's no proof they don't exist :}

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd release msg for 5a3496c
Corinna Vinschen [Wed, 19 Oct 2016 10:53:58 +0000 (12:53 +0200)]
Add release msg for 5a3496c

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix regression in console charset handling
Corinna Vinschen [Wed, 19 Oct 2016 10:48:40 +0000 (12:48 +0200)]
Fix regression in console charset handling

Commit d16a5630 dropped usage of cygheap's locale functions
in favor of local on-the-fly usage of UTF-8 instead of ASCII.
This allowed to use the current local rather than a fixed
system-wide locale set at startup time.  d16a5630 just missed
to add the ASCII->UTF-8 conversion in the console as well.

Fixes https://cygwin.com/ml/cygwin/2016-10/msg00000.html

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoBump Cygwin version to 2.6.1
Corinna Vinschen [Wed, 19 Oct 2016 10:52:06 +0000 (12:52 +0200)]
Bump Cygwin version to 2.6.1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoMake ctype_.c and ctype_.h agree on _ctype_b type
Thomas Preud'homme [Tue, 6 Sep 2016 10:26:55 +0000 (11:26 +0100)]
Make ctype_.c and ctype_.h agree on _ctype_b type

_ctype_b is defined in ctype_.c as a const char array for non cygwin
targets allowing negative ctype index but as a char array for the same
targets in ctype_.h, giving type conflict at compile time.  This is
because the cygwin targets are not treated specially in the latter file.
This patch adds the necessary logic for cygwin targets in ctype_.h.

7 years agodlopen: on x/lib search x/bin if exe is in x/bin newlib-snapshot-20160923
Michael Haubenwallner [Fri, 2 Sep 2016 11:57:20 +0000 (13:57 +0200)]
dlopen: on x/lib search x/bin if exe is in x/bin

On 09/02/2016 11:03 AM, Corinna Vinschen wrote:
> On Sep  2 10:46, Michael Haubenwallner wrote:
>> On 09/01/2016 03:32 PM, Corinna Vinschen wrote:
>>> You could just use the global variable program_invocation_name.  If in
>>> doubt, use the Windows path global_progname and convert it to full POSIX
>>> via cygwin_conv_path.
>>
>> Patch updated, using global_progname now.
>
> Looks good and you're right to do it this way since I just noticed
> that program_invocation_name may return a relative pathname.

Yep.

> Btw., in other calls which require the full POSIX path we use
> mount_table->conv_to_posix_path instead of cygwin_conv_path (see
> e. g. fillout_pinfo()).  It's a bit faster.  Maybe something for a
> followup patch.

No problem - attached.
This renders the original patch 4/4 valid again.

> Note for some later improvement:  I really wonder why we don't store
> the absolute POSIX path of the current executable globally yet...

Same here.

Thanks!
/haubi/

>From f7255edd33cb4abe34f27188aab8dccdfa5dd2a0 Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
Date: Wed, 31 Aug 2016 18:05:11 +0200
Subject: [PATCH 3/4] dlopen: on x/lib search x/bin if exe is in x/bin

citing https://cygwin.com/ml/cygwin-developers/2016-08/msg00020.html
> Consider the file /usr/bin/cygz.dll:
> - dlopen (libz.so)            success
> - dlopen (/usr/bin/libz.so)   success
> - dlopen (/usr/lib/libz.so)   fails

* dlfcn.c (dlopen): For dlopen("x/lib/N"), when the application
executable is in "x/bin/", search for "x/bin/N" before "x/lib/N".

7 years agodlopen (pathfinder): try each basename per dir
Michael Haubenwallner [Wed, 31 Aug 2016 18:07:07 +0000 (20:07 +0200)]
dlopen (pathfinder): try each basename per dir

Rather than searching all search dirs per one basename,
search for all basenames within per one search dir.

pathfinder.h (check_path_access): Interchange dir- and basename-loops.

7 years agodlopen: switch to new pathfinder class
Michael Haubenwallner [Wed, 31 Aug 2016 18:07:06 +0000 (20:07 +0200)]
dlopen: switch to new pathfinder class

Instead of find_exec, without changing behaviour use new pathfinder
class with new allocator_interface around tmp_pathbuf and new vstrlist
class.
* pathfinder.h (pathfinder): New file.
* vstrlist.h (allocator_interface, allocated_type, vstrlist): New file.
* dlfcn.cc (dlopen): Avoid redundant GetModuleHandleExW with RTLD_NOLOAD
and RTLD_NODELETE.  Switch to new pathfinder class, using
(tmp_pathbuf_allocator): New class.
(get_full_path_of_dll): Drop.

7 years agoFix typo in strerror doc cygwin-2_6_0-release
Corinna Vinschen [Wed, 31 Aug 2016 11:43:19 +0000 (13:43 +0200)]
Fix typo in strerror doc

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