Commit Graph

17435 Commits

Author SHA1 Message Date
Erik M. Bray 8a32c24a7b Use allocation granularity as the 'page_size' in /proc/<pid>/status as well, for consistency with /proc/<pid>/statm 2016-11-16 15:58:15 +01:00
Erik M. Bray 6477a48cd1 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
2016-11-16 15:58:08 +01:00
Corinna Vinschen 9ba4744620 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>
2016-11-08 16:14:43 +01:00
Sebastian Huber 172e2050d9 Use external header file for kernel space time
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-11-07 14:03:55 +01:00
Sebastian Huber 4b3a664a20 Add kernel space header for <sys/lock.h> for RTEMS
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-11-07 14:03:54 +01:00
Sebastian Huber dcaf7fedb9 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>
2016-11-07 14:03:53 +01:00
Sebastian Huber 64f900c9ce Provide cap_ioctl_t for RTEMS
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-11-07 14:03:51 +01:00
Thomas Preudhomme cf6e411f17 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
2016-10-25 17:45:11 +02:00
Sebastian Huber 2b496cf1af Provide vm_page_t for RTEMS via <machine/_types.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-10-25 16:24:07 +02:00
Sebastian Huber 40f07f7922 Provide rman_res_t for RTEMS via <machine/types.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-10-25 16:24:06 +02:00
Sebastian Huber b1f3215380 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>
2016-10-25 16:24:05 +02:00
Sebastian Huber 4e91600796 Fix typo in <sys/_stdint.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-10-25 16:24:03 +02:00
Corinna Vinschen 11b7f94212 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>
2016-10-24 11:23:55 +02:00
Corinna Vinschen bb7ad4ed64 pldd: Fix resource leak and missing check if fopen failed
Fixes Coverity CID 66903

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-23 17:22:34 +02:00
Corinna Vinschen 79edb254ac passwd: Fix potential buffer overflow
Fixes Coverity CID 66956

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-23 17:16:30 +02:00
Corinna Vinschen 526107a753 mkgroup/mkpasswd: Fix potential buffer overwrite in corner case
Fixes Coverity CIDs 60076, 60077 and 60081

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-23 17:04:55 +02:00
Corinna Vinschen 7d5af6f0ba getfacl: Don't trust length of incoming user/groupname
Fixes Coverity CIDs 60079 and 60080

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-23 16:52:28 +02:00
Corinna Vinschen cf01b8f029 tzset: Fix array length given to GetGeoInfoW
Fixes Coverity CID 66916

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-23 16:45:21 +02:00
Corinna Vinschen 5e087a8373 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>
2016-10-23 16:38:48 +02:00
Corinna Vinschen 9807a501b1 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>
2016-10-23 16:16:22 +02:00
Corinna Vinschen f16f20ff95 cygcheck: Eenable output of Vista++ FS flags
Also, code cleanup

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-23 15:57:40 +02:00
Corinna Vinschen 015f6894a0 cygcheck: Eliminate dead code
Fixes Coverity CID 66907

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 22:57:03 +02:00
Corinna Vinschen bbeef8ef3f cygcheck: Fix broken test for invalid wcstombs conversion reading symlinks
Fixes Coverity CID 66905

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 22:53:29 +02:00
Corinna Vinschen 7909b528e5 cygcheck: Fix check for Cygwin symlink
Fixes Coverity CID 66904 and 66906

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 22:50:33 +02:00
Corinna Vinschen 61401f24ef strace: Add comment trying to explain confusing code
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 22:39:31 +02:00
Corinna Vinschen 46c472a1c1 cygcheck: Close with pclose what has been opened with popen
Fixes Coverity CID 66900

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 22:14:34 +02:00
Corinna Vinschen 5c758bf910 towupper: Eliminate dead code
Fixes Coverity CID 59865

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 22:00:51 +02:00
Corinna Vinschen 941df759a2 Fix a potential buffer overflow in wscanf family
Fixes Coverity CID 60046

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 21:43:28 +02:00
Corinna Vinschen 94f40db019 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>
2016-10-22 21:29:10 +02:00
Corinna Vinschen db8bda4b47 Remove unreachable code from passwd(1)
Fixed Coverity CID 66966

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-22 21:20:28 +02:00
Corinna Vinschen 8c6e4fec14 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>
2016-10-22 21:08:44 +02:00
Corinna Vinschen 5005be3daf 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>
2016-10-22 20:28:08 +02:00
Corinna Vinschen 34aded1f54 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>
2016-10-22 20:22:20 +02:00
Ken Brown dda82d1a7b 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>
2016-10-21 13:39:02 +02:00
Jon Turney 93374181cb 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>
2016-10-20 13:12:20 +01:00
Jon Turney afcde26618 Update FAQ answer about setting an early breakpoint
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-10-20 13:12:20 +01:00
Corinna Vinschen e3ccb68610 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>
2016-10-19 13:26:03 +02:00
Corinna Vinschen e1824aea27 Add release msg for 5a3496c
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-19 12:53:58 +02:00
Corinna Vinschen 5a3496c3e3 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>
2016-10-19 12:52:14 +02:00
Corinna Vinschen ba2851eeca Bump Cygwin version to 2.6.1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-19 12:52:14 +02:00
Thomas Preud'homme 8394e47d73 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.
2016-10-17 16:37:44 +02:00
Michael Haubenwallner f763e2dc88 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".
2016-09-08 13:36:32 +02:00
Michael Haubenwallner b37c3ed5e5 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.
2016-09-08 13:36:31 +02:00
Michael Haubenwallner 97974e3076 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.
2016-09-08 13:36:29 +02:00
Corinna Vinschen 091a0ac120 Fix typo in strerror doc
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-31 13:43:19 +02:00
Corinna Vinschen a157df3165 strace: Don't print exception info for SetThreadName exception
The new functionality to set the thread name for debugging purposes
creates exception debugging events.  These are printed out when running
strace.  Since these exceptions have nothing to do with real exceptions
but are, like breakpoint execptions, expected and non-fatal, don't print
exception info for them.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-31 12:15:29 +02:00
Corinna Vinschen 472e5439e7 Fix passwd getting error 1265 when running on newer Windows
On Windows 8.1 and later, the NetUserChangePassword call apparently
doesn't accept the usual "\\server" string anymore, but requires to
use the "domain" instead, otherwise it emits en error code 1265,
ERROR_DOWNGRADE_DETECTED.  Since this is accepted by pre-8.1 as well,
use the domain indiscriminately when calling NetUserChangePassword
from passwd(1).

While at it, do some minor cleanup in passwd.c.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-31 12:08:34 +02:00
Yaakov Selkowitz abd37f0c79 Add release message for commit 3d3ab82
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-08-30 10:53:35 -05:00
Yaakov Selkowitz 3d3ab82968 Fix off_t typedef on Cygwin64
While both long and long long are 64-bits on x86_64, they are distinct types,
and long was used prior to commit 477463a201.
Changing this breaks the linking of previously compiled C++ functions with
off_t arguments on 64-bit Cygwin with newly compiled code, as the mangling of
long (l) and long long (x) differ.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-08-29 15:30:59 -05:00
Corinna Vinschen de8b81950d Change return type from locale_t to struct __locale_t * as well
Complements commit 14228e2.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25 17:27:37 +02:00