]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
8 years agoChange if_nameindex() to use unsigned int i variable.
Jeff Johnston [Thu, 4 Feb 2016 18:30:14 +0000 (13:30 -0500)]
Change if_nameindex() to use unsigned int i variable.

- i variable used in loop that shifts to right so use
  unsigned int instead

8 years agoinclude/grp.h: Remove prototypes of non-standard functions
Corinna Vinschen [Fri, 29 Jan 2016 12:39:57 +0000 (13:39 +0100)]
include/grp.h: Remove prototypes of non-standard functions

* libc/include/grp.h (group_from_gid): Remove prototype.
(setgrfile): Ditto.
(setgroupent): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix memcpy bug that reads past end of buffer.
Steve Ellcey [Thu, 28 Jan 2016 22:08:35 +0000 (14:08 -0800)]
Fix memcpy bug that reads past end of buffer.

* libc/machine/mips/memcpy.S (memcpy): Fix read past end of
input.

8 years agogrp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards
Yaakov Selkowitz [Thu, 28 Jan 2016 21:39:02 +0000 (15:39 -0600)]
grp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards

This fixes the build of krb5 and other packages on Cygwin.

* libc/include/grp.h: Use __BSD_VISIBLE and __XSI_VISIBLE guards.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoTreat ACLs with extra ACEs for Admins and SYSTEM like a trivial ACL
Corinna Vinschen [Thu, 28 Jan 2016 21:05:49 +0000 (22:05 +0100)]
Treat ACLs with extra ACEs for Admins and SYSTEM like a trivial ACL

POSIX.1e requires that chmod changes the MASK rather than the
GROUP_OBJ value if the ACL is non-trivial.

On Windows, especially on home machines, a standard ACL often
consists of entries for the user, maybe the group, and additional
entries for SYSTEM and the Administrators group.  A user calling
chmod on a file with bog standard Windows perms usually expects
that chmod changes the GROUP_OBJ perms, but given the rules from
POSIX.1e we can't do that.

However, since we already treat Admins and SYSTEM special in a
ACL (they are not used in MASK computations) we go a step in the
Windows direction to follow user expectations.  If an ACL only
consists of the three POSIX permissions, plus entries for Admins
and SYSTEM *only*, then we change the permissions of the GROUP_OBJ
entry *and* the MASK entry.

* fhandler_disk_file.cc (fhandler_disk_file::chmod): Drop unused
code.  Add special handling for a "standard" Windows ACL.  Add
comment to explain.
* sec_acl.cc (get_posix_access): Allow to return "standard-ness"
of an ACL to the caller.  Add preceeding comment to explain a bit.
* security.h (get_posix_access): Align prototype.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoget_posix_access: Fix primary group handing when multiple ACEs exist
Corinna Vinschen [Thu, 28 Jan 2016 13:34:11 +0000 (14:34 +0100)]
get_posix_access: Fix primary group handing when multiple ACEs exist

Handle additional ACE for primary group only as another GROUP
entry if it's an allow ACE.  Deny ACEs don't qualify.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMake macro checks ARMv8-M baseline proof
Thomas Preud'homme [Thu, 28 Jan 2016 10:26:09 +0000 (11:26 +0100)]
Make macro checks ARMv8-M baseline proof

libgloss:

        * arm/Makefile.in: Add newlib/libc/machine/arm to the include path if
        newlib is present.
        * arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macros __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__,
        !__ARM_ARCH_ISA_ARM rather than THUMB_V7M_V6M for fp enabling, and
        PREFER_THUMB rather than THUMB_V7_V6M.  Rename other occurences of
        THUMB_V7M_V6M to THUMB_VXM.
        * arm/linux-crt0.c: Likewise.
        * arm/redboot-crt0.S: Likewise.
        * arm/swi.h: Likewise.
        * arm/trap.S: Likewise.

newlib:

        * libc/machine/arm/memcpy-stub.c: Use ACLE macros __ARM_ARCH_ISA_THUMB
        and __ARM_ARCH_ISA_ARM to check for Thumb-2 only targets rather than
        __ARM_ARCH and __ARM_ARCH_PROFILE.
        * libc/machine/arm/memcpy.S: Likewise.
        * libc/machine/arm/setjmp.S: Likewise for Thumb-1 only target and
        include acle-compat.h.
        * libc/machine/arm/strcmp.S: Likewise for Thumb-1 and Thumb-2 only
        target and include acle-compat.h.
        * libc/sys/arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macro __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * libc/sys/arm/crt0.S: Use PREFER_THUMB rather than THUMB_V7_V6M and
        rename THUMB_V7M_V6M into THUMB_VXM.
        * libc/sys/arm/swi.h: Likewise.

8 years agoDeprecate newlib and winsup ChangeLog files
Corinna Vinschen [Thu, 28 Jan 2016 10:15:33 +0000 (11:15 +0100)]
Deprecate newlib and winsup ChangeLog files

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDon't use LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32). It hangs
Corinna Vinschen [Wed, 27 Jan 2016 14:43:15 +0000 (15:43 +0100)]
Don't use LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32).  It hangs

Observed running hexchat under X.  For some reason the call to
LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32) in dll_load
hangs when trying to autoload MsgWaitForMultipleObjectsEx in
select.cc after hexchat forks to run DNS calls.  Dropping the
call and just using full paths as in 2.3.1 fixes the issue.

* autoload.cc (dll_load): Drop call to LoadLibraryEx with
LOAD_LIBRARY_SEARCH_SYSTEM32 flag.
* wincap.h (wincaps::has_load_lib_search_flags): Remove.
* wincap.cc (wincaps::has_load_lib_search_flags): Drop handling
this flag.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop has_broken_fnoi flag
Corinna Vinschen [Wed, 27 Jan 2016 14:39:11 +0000 (15:39 +0100)]
Drop has_broken_fnoi flag

* mount.cc (fs_info::update): Don't set has_broken_fnoi.  It's
unused anyway.
* mount.h (class fs_info): Remove has_broken_fnoi status flag.
* path.h (class path_conv): Remove has_broken_fnoi method.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMake select wait state more readable
Corinna Vinschen [Mon, 25 Jan 2016 20:00:14 +0000 (21:00 +0100)]
Make select wait state more readable

Rename "res" to "wait_state" and change its type to
select_stuff::wait_states.  Use select_stuff::wait_states
values instead of ints throughout.  Rearrange a few comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix missing 'user' in usertemp docs
Corinna Vinschen [Mon, 25 Jan 2016 09:09:55 +0000 (10:09 +0100)]
Fix missing 'user' in usertemp docs

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd 2.4.1 release message file cygwin-2_4_1-release
Corinna Vinschen [Sat, 23 Jan 2016 21:33:31 +0000 (22:33 +0100)]
Add 2.4.1 release message file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygpath: Avoid returning SysWOW64
Corinna Vinschen [Thu, 21 Jan 2016 17:40:30 +0000 (18:40 +0100)]
cygpath: Avoid returning SysWOW64

On Cygwin 32 running under WOW64:

When case-correcting the path fetched with -S, the underlying
Windows function fetching the normalized path returns the real
path C:\Windows\SysWOW64 instead of the path redirection
enabled C:\Windows\System32 path.  This breaks using the result
of `cygpath -S' to fetch the POSIX path of the network related
files under SYSTEMROOT\drivers\etc.  This path is in fact under
the *real* C:\Windows\System32 and only mapped into the 32 bit
C:\Windows\System32 (aka C:\Windows\SysWOW64) via path redirection.
Sounds messy?

This patch checks if we're running under WOW64.  If so, it
changes the path returned by GetSystemDirectoryW from "system32"
to "Sysnative".  This in turn is changed to "System32" by
NtQueryInformationFile, so we're back to what we need.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin_logon_user: Return non-privileged token as well
Corinna Vinschen [Thu, 21 Jan 2016 17:32:16 +0000 (18:32 +0100)]
cygwin_logon_user: Return non-privileged token as well

If the calling process doesn't have sufficient privileges to
fetch the linked token of an admin-user token, cygwin_logon_user
fails.  This patch changes that by returning the original,
unprivileged token of the admin user to allow authentication
and calling setuid for the current process.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix formatting in sec_auth.cc
Corinna Vinschen [Thu, 21 Jan 2016 17:27:05 +0000 (18:27 +0100)]
Fix formatting in sec_auth.cc

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBump cygwin version to 2.4.1
Corinna Vinschen [Sat, 16 Jan 2016 11:57:53 +0000 (12:57 +0100)]
Bump cygwin version to 2.4.1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agofaq: Update FAQ question and answer about gdb and signals
Jon Turney [Thu, 14 Jan 2016 17:44:18 +0000 (17:44 +0000)]
faq: Update FAQ question and answer about gdb and signals

    * faq-programming.xml: Update question and answer about gdb and signals.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agoget_posix_access: Fix group deny bits leaking into file type attribute bits cygwin-2_4_0-release
Corinna Vinschen [Fri, 15 Jan 2016 14:13:11 +0000 (15:13 +0100)]
get_posix_access: Fix group deny bits leaking into file type attribute bits

* sec_acl.cc (get_posix_access): Fix bracketing in expression
constructing POSIX group permissions so as not leaking deny bits
into POSIX file type bits.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoInitialize handle in dll_load to avoid compiler warning
Corinna Vinschen [Tue, 12 Jan 2016 14:45:17 +0000 (15:45 +0100)]
Initialize handle in dll_load to avoid compiler warning

* autoload.cc (dll_load): Initialize h to NULL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse MAKEWORD macro in WSAStartup call per documentation
Corinna Vinschen [Tue, 12 Jan 2016 14:25:15 +0000 (15:25 +0100)]
Use MAKEWORD macro in WSAStartup call per documentation

* autoload.cc (wsock_init): Use MAKEWORD macro to create requested
version rather than handcrafted expression.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoTry loading with safe path using LOAD_LIBRARY_SEARCH_SYSTEM32 first
Corinna Vinschen [Tue, 12 Jan 2016 14:23:14 +0000 (15:23 +0100)]
Try loading with safe path using LOAD_LIBRARY_SEARCH_SYSTEM32 first

* autoload.cc (dll_load): Move safe loading from std_dll_init here.
Add code to handle systems supporting LOAD_LIBRARY_SEARCH flags.
Add comments to explain what the code is doing.  Fix up comment
preceeding this function.
(std_dll_init): Move safe loading code to dll_load.
* wincap.h (wincaps::has_load_lib_search_flags): New element.
        * wincap.cc: Implement above element throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix previous fix for generating unique inode numbers for sockets
Corinna Vinschen [Mon, 11 Jan 2016 18:10:45 +0000 (19:10 +0100)]
Fix previous fix for generating unique inode numbers for sockets

* fhandler.h (fhandler_base::get_plain_ino): New inline method.
Add comment to explain what it's supposed to be used for.
* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Create
filename using inode number.
(fhandler_socket::fstat): Generate inode number from filename if
ino is not set (that's the case in a stat(2) call).
* pipe.cc: Throughout, use get_plain_ino when appropriate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRevert "autoload.cc: Drop using full paths for system DLLs"
Corinna Vinschen [Mon, 11 Jan 2016 17:46:01 +0000 (18:46 +0100)]
Revert "autoload.cc: Drop using full paths for system DLLs"

This reverts commit 4b104ce07070e32363a217a554441a8b4df69d12.

The DLLs always guaranteed to be loaded from the system dir are only
those in the KnownDLLs list.  We're using some DLLs not in that list on
all supported OSes, thus we need to make sure to use full paths.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoReturn unique inode numbers when calling stat/fstat on pipes and IP sockets
Corinna Vinschen [Mon, 11 Jan 2016 11:35:41 +0000 (12:35 +0100)]
Return unique inode numbers when calling stat/fstat on pipes and IP sockets

        * fhandler.h (class fhandler_base): Convert unique_id to int64_t.
        (fhandler_base::set_ino): New protected inline method.
        (fhandler_base::get_unique_id): Convert to int64_t.
        (fhandler_base::set_unique_id): New inline method taking int64_t.
        (fhandler_pipe::fstat): Declare.
        (fhandler_pipe::init): Take extra parameter.
        (fhandler_pipe::create): Ditto.
        * fhandler_socket.cc (fhandler_socket::init_events): Set inode number
        to serial number.
        (fhandler_socket::fstat): Set device to DEV_TCP_MAJOR.  Create st_ino
        from get_ino.
        * include/cygwin/signal.h (struct _sigcommune): Replace
        _si_pipe_fhandler with _si_pipe_unique_id.
        * pinfo.h (_pinfo::pipe_fhandler): Take unique id instead of HANDLE.
        * pinfo.cc (commune_process): Accommodate change to _si_pipe_unique_id.
        (_pinfo::commune_request): Ditto.
        (_pinfo::pipe_fhandler): Ditto.
        * pipe.cc (fhandler_pipe::init): Take unique id as argument and set
        inode number and unique_id from there.
        (fhandler_pipe::open): Rework to find any matching pipe from unique
        id in filename.
        (fhandler_pipe::get_proc_fd_name): Create filename using inode number.
        (fhandler_pipe::create): Generate and return unique id from process pid
        and pipe_unique_id.  In outer method, call init with additional unique
        id as parameter.
        (fhandler_pipe::fstat): New method.
        (pipe_worker): Accommodate using 64 bit inode number in filename.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect(2): Drop checking descriptors in case of immediate timeout.
Corinna Vinschen [Mon, 11 Jan 2016 09:36:33 +0000 (10:36 +0100)]
select(2): Drop checking descriptors in case of immediate timeout.

* select.cc (select): Call sel.poll only if sel.wait returned
select_ok.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for previous commit
Corinna Vinschen [Sat, 9 Jan 2016 14:05:21 +0000 (15:05 +0100)]
Add release message for previous commit

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect: Don't timeout without setting descriptor arrays to all zero
Corinna Vinschen [Sat, 9 Jan 2016 13:53:06 +0000 (14:53 +0100)]
select: Don't timeout without setting descriptor arrays to all zero

        * select.cc (copyfd_set): Remove.
        (select): Don't copy local wait fd arrays over to returned fd arrays
        since bits set there are not accounted for in return value.  Zero out
        returned fd arrays instead.  Always call sel.poll even in case of a
        timeout.  Always zero out fd array when timing out.  Convert while/do
        to do/while for clarity.  Use dedicated variable as return value to
        decouple return value from artificial return code from sel.wait.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDo not treat the command line or environment like paths
Johannes Schindelin [Thu, 17 Dec 2015 15:22:49 +0000 (16:22 +0100)]
Do not treat the command line or environment like paths

* dcrt0.cc (dll_crt0_1), environ.cc (environ_init, getwinenveq,
build_env), strfuncs.cc (sys_wcstombs, sys_wcstombs_alloc),
wchar.c (sys_wcstombs, sys_wcstombs_alloc): avoid mis-conversions
of text that does not, actually, refer to a path or file name

Detailed explanation:

Our WCS -> UTF conversion handles the private Unicode page specially
to allow for otherwise invalid file names. However, this handling makes
no sense for command-lines, nor environment variables, which we would
rather convert verbatim.

As a stop-gap solution, let's just introduce a version of the
sys_wcstombs() function that specifically excludes that file name
conversion magic.

The proper solution is to change sys_wcstombs() to assume that it is not
a path that wants to be converted, and introduce sys_wcstombs_path()
that does, but that is a bigger task which we leave for another patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
8 years agoDeprecate all winsup ChangeLog files
Corinna Vinschen [Thu, 7 Jan 2016 20:16:01 +0000 (21:16 +0100)]
Deprecate all winsup ChangeLog files

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygpath: Try to return system directories with correct case
Corinna Vinschen [Thu, 7 Jan 2016 20:07:56 +0000 (21:07 +0100)]
cygpath: Try to return system directories with correct case

* cygpath.cc (do_sysfolders): Drop lame workaround to fix case of
directory returned by GetSystemDirectoryW.  Try to fix case of
any path returned by this function in case it has to return a
POSIX path to support case-sensitivity.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect: Set exceptfd bit if fetching mailslot info fails
Corinna Vinschen [Thu, 7 Jan 2016 17:01:44 +0000 (18:01 +0100)]
select: Set exceptfd bit if fetching mailslot info fails

* select.cc (peek_mailslot): Set except_ready if GetMailslotInfo fails.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect.cc: Fit comments into 80 columns
Corinna Vinschen [Thu, 7 Jan 2016 16:56:33 +0000 (17:56 +0100)]
select.cc: Fit comments into 80 columns

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoConvert utmp{x}name to int, return useful value. Define _PATH_UTMPX
Corinna Vinschen [Thu, 7 Jan 2016 14:40:40 +0000 (15:40 +0100)]
Convert utmp{x}name to int, return useful value.  Define _PATH_UTMPX

* syscalls.cc (utmpname): Convert to int.  Return 0 if strdup
worked, -1 otherwise.
* include/utmpx.h (_PATH_UTMPX): Define as _PATH_UTMP.
(utmpxname): Declare as int function.
* include/sys/utmp.h (utmpname): Ditto.
* include/cygwin/version.h: Bump API minor version.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop use of not yet available type acl_perm_t
Corinna Vinschen [Thu, 7 Jan 2016 12:28:12 +0000 (13:28 +0100)]
Drop use of not yet available type acl_perm_t

* sec_acl.cc (__aclcalcmask): Use mode_t instead of acl_perm_t

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDeprecate Cygwin ChangeLog file
Corinna Vinschen [Thu, 7 Jan 2016 12:23:05 +0000 (13:23 +0100)]
Deprecate Cygwin ChangeLog file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix up errors in regenerated files for 2.3.0 release. newlib-snapshot-20160104
Jeff Johnston [Mon, 4 Jan 2016 17:57:31 +0000 (12:57 -0500)]
Fix up errors in regenerated files for 2.3.0 release.

8 years agosetfacl: Remove unused local variable
Corinna Vinschen [Fri, 25 Dec 2015 20:41:52 +0000 (21:41 +0100)]
setfacl: Remove unused local variable

        * setfacl.cc (delacl): Remove unused local variable.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoOnly request WRITE_DAC rights when writing an ACL
Corinna Vinschen [Fri, 25 Dec 2015 20:40:51 +0000 (21:40 +0100)]
Only request WRITE_DAC rights when writing an ACL

        * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request
        query_write_dac rather than query_write_control access when writing
        an ACL.  Fix a comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoaclsort: Honor calclass argument and allow recalculating ACL mask.
Corinna Vinschen [Wed, 23 Dec 2015 23:48:20 +0000 (00:48 +0100)]
aclsort: Honor calclass argument and allow recalculating ACL mask.

        * sec_acl.cc (__aclcalcmask): New function to recalculate ACL masks.
        (aclsort32): Honor calclass argument.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoaclfromtext: Actually return aclcnt parameter
Corinna Vinschen [Wed, 23 Dec 2015 23:39:45 +0000 (00:39 +0100)]
aclfromtext: Actually return aclcnt parameter

        * sec_acl.cc (aclfromtext32): Return missing aclcnt parameter.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse TLS buffer in ACL<->text conversion
Corinna Vinschen [Wed, 23 Dec 2015 23:32:54 +0000 (00:32 +0100)]
Use TLS buffer in ACL<->text conversion

        * sec_acl.cc (acltotext32): Use tmp_pathbuf rather than stack buffer.
        (aclfromtext32): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosec_acl.cc: Cosmetic changes
Corinna Vinschen [Wed, 23 Dec 2015 23:24:39 +0000 (00:24 +0100)]
sec_acl.cc: Cosmetic changes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRegenerate files for newlib 2.3.0. newlib-2_3_0
Jeff Johnston [Tue, 22 Dec 2015 02:03:25 +0000 (21:03 -0500)]
Regenerate files for newlib 2.3.0.

8 years agosetfacl(1): Fix handling of -m and -x on a single commandline
Corinna Vinschen [Mon, 21 Dec 2015 17:15:57 +0000 (18:15 +0100)]
setfacl(1): Fix handling of -m and -x on a single commandline

        * setfacl.cc (delace): New helper function to delete a single ACE.
        (delacl): Call delace.
        (modacl): Ditto, if entry is supposed to get deleted.  Align comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix atexit logic to honor _ATEXIT_DYNAMIC_ALLOC setting.
Jeff Johnston [Mon, 21 Dec 2015 16:53:14 +0000 (11:53 -0500)]
Fix atexit logic to honor _ATEXIT_DYNAMIC_ALLOC setting.

If small reent is enabled (_REENT_SMALL is defined) then malloc() was
used in __register_exitproc() even if user requested it to be disabled
(_ATEXIT_DYNAMIC_ALLOC is defined). With this fix, function fails when
_ATEXIT_DYNAMIC_ALLOC is defined and whole static storage is already
used.

2015-12-21  Freddie Chopin  <freddie.chopin@gmail.com>

        * libc/stdlib/__atexit.c (__register_exitproc): Fix for
        _ATEXIT_DYNAMIC_ALLOC.

8 years agoAdd static instance of _on_exit_args for _REENT_SMALL platforms.
Jeff Johnston [Mon, 21 Dec 2015 16:49:28 +0000 (11:49 -0500)]
Add static instance of _on_exit_args for _REENT_SMALL platforms.

2015-12-21  Freddie Chopin  <freddie.chopin@gmail.com>

        * libc/stdlib/on_exit_args.{c,h}: New files.
        * libc/stdlib/Makefile.am: Add new source file.
        * libc/stdlib/Makefile.in: Regenerate.
        * libc/stdlib/__atexit.c (__register_exitproc): Initialize
        _on_exit_args_ptr field of _GLOBAL_ATEXIT on first run.
        * libc/stdlib/on_exit.c: Force linking of static instance of
        _on_exit_args.
        * libc/stdlib/cxa_atexit.c: Likewise.

8 years agosetfacl(1): Rewrite support for mask recomputation
Corinna Vinschen [Mon, 21 Dec 2015 12:05:41 +0000 (13:05 +0100)]
setfacl(1): Rewrite support for mask recomputation

        * setfacl.cc (modacl): Move recomputing mask into new function.
        (check_got_mask): New function checking if mask is in input.
        (recompute_mask): New function to recompute mask.
        (addmissing): Align mask computation to Linux setfacl.
        (setfacl): Call check_got_mask and recompute_mask on Set, Delete and
        Modify actions.
        (usage): Rename --substitute to --set.
        (longopts): Add --set option.

        * utils.xml (setfacl): Rename --substitute to --set.
        * new-features.xml (ov-new2.4): Rephrase setfacl changes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosetfacl --mask/--no-mask really don't need an argument
Houder [Sun, 20 Dec 2015 12:14:34 +0000 (13:14 +0100)]
setfacl --mask/--no-mask really don't need an argument

        * setfacl.cc (longopts): Drop accidentally requiring an argument to
        the --mask and --no-mask options.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix missing arg requirement for setfacl -x option
Houder [Sat, 19 Dec 2015 20:00:46 +0000 (21:00 +0100)]
Fix missing arg requirement for setfacl -x option

        * setfacl.cc (opts): Add colon to x option.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop sys_cp_wcstombs and save two arguments per call
Corinna Vinschen [Fri, 18 Dec 2015 11:42:40 +0000 (12:42 +0100)]
Drop sys_cp_wcstombs and save two arguments per call

        * strfuncs.cc (sys_cp_wcstombs): Delete and move functionality into
        sys_wcstombs.
        * wchar.h (sys_cp_wcstombs): Drop declaration.
        * fhandler_console.cc (dev_console::con_to_str): Call sys_wcstombs.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBuild msp430-specific libnosys
DJ Delorie [Thu, 17 Dec 2015 21:49:08 +0000 (16:49 -0500)]
Build msp430-specific libnosys

The MSP430 debuggers support I/O on hardware through CIO, so
we can use a CIO-enabled library as the "nosys" library (in
addition to the libsim library, which talks to our simulator)

* configure.in: Don't build default libnosys for msp430
* configure: Regenerate.
* msp430/Makefile: Rename libcio to libnosys.

8 years agoARC: Use new definitions for optional ARC CPU features
Anton Kolesov [Tue, 15 Dec 2015 17:54:58 +0000 (20:54 +0300)]
ARC: Use new definitions for optional ARC CPU features

GCC for ARC has been updated to provide consistent naming of preprocessor
definitions for different optional architecture features:

    * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for
      -mbarrel-shifter
    * __ARC_LL64__ instead of __LL64__ for -mll64
    * __ARCEM__ instead of __EM__ for -mcpu=arcem
    * __ARCHS__ instead of __HS__ for -mcpu=archs
    * etc (not used in newlib)

This patch updates assembly routines for ARC to use new definitions instead
of a deprecated ones. To ensure compatibility with older compiler new
definitions are also defined in asm.h if needed, based on deprecated
preprocessor definitions.

*** newlib/ChangeLog ***
2015-12-15  Anton Kolesov  <Anton.Kolesov@synopsys.com>

* libc/machine/arc/asm.h: Define new GCC definition for old compiler.
* libc/machine/arc/memcmp-bs-norm.S: Use new GCC defines to detect
  processor features.
* libc/machine/arc/memcmp.S: Likewise.
* libc/machine/arc/memcpy-archs.S: Likewise.
* libc/machine/arc/memcpy-bs.S: Likewise.
* libc/machine/arc/memcpy.S: Likewise.
* libc/machine/arc/memset-archs.S: Likewise.
* libc/machine/arc/memset-bs.S: Likewise.
* libc/machine/arc/memset.S: Likewise.
* libc/machine/arc/setjmp.S: Likewise.
* libc/machine/arc/strchr-bs-norm.S: Likewise.
* libc/machine/arc/strchr-bs.S: Likewise.
* libc/machine/arc/strchr.S: Likewise.
* libc/machine/arc/strcmp-archs.S: Likewise.
* libc/machine/arc/strcmp.S: Likewise.
* libc/machine/arc/strcpy-bs-arc600.S: Likewise.
* libc/machine/arc/strcpy-bs.S: Likewise.
* libc/machine/arc/strcpy.S: Likewise.
* libc/machine/arc/strlen-bs-norm.S: Likewise.
* libc/machine/arc/strlen-bs.S: Likewise.
* libc/machine/arc/strlen.S: Likewise.
* libc/machine/arc/strncpy-bs.S: Likewise.
* libc/machine/arc/strncpy.S: Likewise.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
8 years agoRemove inclusion of sys/select.h in sys/types.h for backward compat
Corinna Vinschen [Thu, 17 Dec 2015 21:45:19 +0000 (22:45 +0100)]
Remove inclusion of sys/select.h in sys/types.h for backward compat

* libc/include/sys/types.h: Remove including <sys/select.h>.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUpdate CIO hooks to be more flexible.
DJ Delorie [Thu, 17 Dec 2015 21:22:52 +0000 (16:22 -0500)]
Update CIO hooks to be more flexible.

Replace the one hook we had with two to avoid underscore issues.

* msp430/cio.c: Remove, replace with...
* msp430/cio.S: New, this.

8 years agorl78: Don't output CR when LF is encountered in write().
Kevin Buettner [Tue, 15 Dec 2015 03:41:53 +0000 (20:41 -0700)]
rl78: Don't output CR when LF is encountered in write().

The file libgloss/rl78/write.c currently contains code which outputs
\r when \n is seen.  The code will then output the \n as well.

This patch removes the bit of code that tests for \n and then outputs
\r.

I made this change to fix some failures in gdb.base/call-ar-st.exp.  In
that test, I see two carriage returns followed by a newline.  One CR is
output by the libgloss code.  The other is output by the terminal driver.

The total list of failures fixed (using the default rl78 multilib) are:

FAIL: gdb.base/call-ar-st.exp: print print_double_array(double_array) (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_char_array(char_array) (timeout)
FAIL: gdb.base/call-ar-st.exp: continue to tbreak2 (timeout)
FAIL: gdb.base/call-ar-st.exp: continuing to tbreak3 (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_double_array(array_d) (timeout)
FAIL: gdb.base/call-ar-st.exp: continuing to tbreak4 (timeout)
FAIL: gdb.base/call-ar-st.exp: print sum_array_print(10, *list1, *list2, *list3, *list4) (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_small_structs (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065) (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_small_structs from print_long_arg_list (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_struct_rep(*struct1, *struct2, *struct3) (timeout)
FAIL: gdb.base/dprintf.exp: call: printf: 1st dprintf (timeout)
FAIL: gdb.base/dprintf.exp: call: printf: 2nd dprintf (timeout)
FAIL: gdb.base/interrupt.exp: process is alive (the program exited)

There are no regressions.

libgloss/ChangeLog:

* rl78/write.c (_write): Don't output CR when LF is encountered.

8 years agoAdd release message for previous commit
Corinna Vinschen [Wed, 16 Dec 2015 11:35:08 +0000 (12:35 +0100)]
Add release message for previous commit

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix crash reading invalid SIDs from passwd and group files
Corinna Vinschen [Wed, 16 Dec 2015 11:25:27 +0000 (12:25 +0100)]
Fix crash reading invalid SIDs from passwd and group files

        * grp.cc (pwdgrp::parse_group): Only copy the SID if it's valid.
        * passwd.cc (pwdgrp::parse_passwd): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd usertemp to 2.4.0 release text
Corinna Vinschen [Tue, 15 Dec 2015 10:25:23 +0000 (11:25 +0100)]
Add usertemp to 2.4.0 release text

8 years agoAdd _REENT_INIT_PTR_ZEROED()
Sebastian Huber [Mon, 14 Dec 2015 08:57:54 +0000 (09:57 +0100)]
Add _REENT_INIT_PTR_ZEROED()

Provide a _REENT_INIT_PTR_ZEROED() macro to initialize an already
zero-initialized struct _reent.

* libc/include/sys/reent.h (_REENT_INIT_PTR_ZEROED): New.
(_REENT_INIT_PTR): Define only once and use _REENT_INIT_PTR_ZEROED().

8 years agoFreeBSD compatibility for <sys/select.h>
Sebastian Huber [Mon, 14 Dec 2015 09:06:18 +0000 (10:06 +0100)]
FreeBSD compatibility for <sys/select.h>

* libc/include/sys/_sigset.h: New.
* libc/include/sys/select.h: Do not include <sys/types.h> and
<sys/time.h> to avoid cyclic header file dependencies.  Include
specialized header files instead.
(sigset_t): Conditionally define.
* libc/include/sys/signal.h (sigset_t): Likewise.
* libc/include/sys/time.h: Include <sys/select.h> if
__BSD_VISIBLE.
* libc/include/sys/types.h: Likewise.

8 years agoAdd missing lock releases in __register_exitproc().
Freddie Chopin [Sat, 12 Dec 2015 10:52:21 +0000 (11:52 +0100)]
Add missing lock releases in __register_exitproc().

In some code paths the __atexit_lock held by this function was not
released when returning with an error.

        * libc/stdlib/__atexit.c (__register_exitproc): Always release
        lock before return.

8 years agoFix regparm attribute of fhandler_base::fstat_helper
Ken Brown [Fri, 11 Dec 2015 22:08:28 +0000 (17:08 -0500)]
Fix regparm attribute of fhandler_base::fstat_helper

* winsup/cygwin/fhandler_disk_file.cc (fhandler_base::fstat_helper):
Align regparm attribute to declaration in fhandler.h.

8 years agoFetch and store FileAllInformation rather than FileNetworkOpenInformation
Corinna Vinschen [Wed, 9 Dec 2015 23:02:34 +0000 (00:02 +0100)]
Fetch and store FileAllInformation rather than FileNetworkOpenInformation

        * path.h (class path_conv_handle): Use FILE_ALL_INFORMATION instead of
        FILE_NETWORK_OPEN_INFORMATION.  Use definitions from ntdll.h since it's
        included anyway.
        (path_conv_handle::fai): Change name from fnoi.
        (path_conv::fai): Ditto.
        (file_get_fai): Change name from file_get_fnoi.  Drop second parameter.
        * path.cc (file_get_fai): Ditto.  Fetch FileAllInformation rather than
        FileNetworkOpenInformation.  Convert STATUS_BUFFER_OVERFLOW to
        STATUS_SUCCESS.  Remove workaround to fetch FileBasicInformation and
        FileStandardInformation on filesystems with broken
        FileNetworkOpenInformation handling.
        (symlink_info::check): Accommodate above changes.  In case of using
        the NtQueryDirectoryFile fallback, fetch FileIdBothDirectoryInformation
        to get inode number as well.
        * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop outdated
        comment.  Accommodate change to using FileAllInformation.  Drop
        extra function calls to fetch NumberOfLinks and IndexNumber.  Set ino
        directly from IndexNumber stored in pc.fai().  Drop second argument
        from call to fstat_helper.
        (fhandler_base::fstat_by_name): Drop second argument from call to
        fstat_helper.
        (fhandler_base::fstat_helper): Drop second parameter.  Accommodate
        the fact that we access a FILE_ALL_INFORMATION structure now.
        (fhandler_base::open_fs): Set ino directly from IndexNumber stored in
        pc.fai().
        * fhandler.h (fhandler_base::fstat_helper): Fix declaration accrdingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop unused path_conv::ndisk_links method
Corinna Vinschen [Wed, 9 Dec 2015 22:56:47 +0000 (23:56 +0100)]
Drop unused path_conv::ndisk_links method

        * fhandler_disk_file.cc (path_conv::ndisk_links): Drop unused method.
        (fhandler_base::fstat_helper): Drop unused call to ndisk_links.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse fii instead of fai for FILE_INTERNAL_INFORMATION vars
Corinna Vinschen [Wed, 9 Dec 2015 22:51:48 +0000 (23:51 +0100)]
Use fii instead of fai for FILE_INTERNAL_INFORMATION vars

        * fhandler_disk_file.cc (path_conv::get_ino_by_handle): Rename fai to
        fii for clearness.
        (fhandler_disk_file::readdir): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoIn FILE_ID_BOTH_DIR_INFORMATION it's actually FileId, not IndexNumber
Corinna Vinschen [Wed, 9 Dec 2015 17:11:47 +0000 (18:11 +0100)]
In FILE_ID_BOTH_DIR_INFORMATION it's actually FileId, not IndexNumber

        * ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Revert IndexNumber to FileId
        since it's actually right here.
        * fhandler_disk_file.cc: Accommodate above change.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoCheck for 64 FP instructions availability in libm before using them
Thomas Preud'homme [Wed, 9 Dec 2015 03:00:55 +0000 (11:00 +0800)]
Check for 64 FP instructions availability in libm before using them

Currently, double precision math functions in newlib/libm/machine/arm detect whether neon instructions can be used for double precision computation by checking the architecture version (>= 8) and the availability of floating-point instructions. However, these instructions would not be available if targeting fpv5-sp-d16 as the FPU, which by definition does not have 64bit float instructions. This patch adds a check that __ARM_FP advertises 64bit float instructions.

        * libm/machine/arm/s_ceil.c: Also check that 64bit FP instructions are
        available in the guard.
        * libm/machine/arm/s_floor.c: Likewise.
        * libm/machine/arm/s_nearbyint.c: Likewise.
        * libm/machine/arm/s_rint.c: Likewise.
        * libm/machine/arm/s_round.c: Likewise.
        * libm/machine/arm/s_trunc.c: Likewise.

8 years agoAdd missing checks for __SNLK flag
Corinna Vinschen [Tue, 8 Dec 2015 20:23:22 +0000 (21:23 +0100)]
Add missing checks for __SNLK flag

        * libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls
        dependent on __SNLK flag.
        * libc/stdio/findfp.c (__fp_lock): Ditto.
        (__fp_unlock): Ditto.
        * libc/stdio/freopen.c (_freopen_r): Ditto.
        * libc/stdio64/freopen64.c (_freopen64_r): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix re-initialization of FILE flags and mbstate in freopen
Corinna Vinschen [Tue, 8 Dec 2015 17:44:23 +0000 (18:44 +0100)]
Fix re-initialization of FILE flags and mbstate in freopen

        * libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4.
        * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of
        flag values and _mbstate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRemove unnecessary locking in pthread_setcancelstate/pthread_setcanceltype
Corinna Vinschen [Tue, 8 Dec 2015 16:55:33 +0000 (17:55 +0100)]
Remove unnecessary locking in pthread_setcancelstate/pthread_setcanceltype

        * thread.cc (pthread::setcancelstate): Remove unnecessary locking.
        (pthread::setcanceltype): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRename FileId to IndexNumber in NT structures to align with upstream
Corinna Vinschen [Tue, 8 Dec 2015 13:33:07 +0000 (14:33 +0100)]
Rename FileId to IndexNumber in NT structures to align with upstream

        * ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Rename FileId to IndexNumber
        to align with Microsoft naming scheme.
        (FILE_INTERNAL_INFORMATION): Ditto.
        * fhandler_disk_file.cc: Rename FileId to IndexNumber throughout.
        * syscalls.cc: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix minor style issue in _dll_crt0.
Corinna Vinschen [Mon, 7 Dec 2015 17:41:15 +0000 (18:41 +0100)]
Fix minor style issue in _dll_crt0.

Fix missing space.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoIntroduce the 'usertemp' filesystem type
Johannes Schindelin [Tue, 1 Dec 2015 14:02:14 +0000 (15:02 +0100)]
Introduce the 'usertemp' filesystem type

* mount.cc (mount_info::from_fstab_line): Support mounting the current
user's temp folder as /tmp/.  This is particularly useful a feature
when Cygwin's own files are write-protected.

* pathnames.xml: document the new usertemp file system type

Detailed explanation:

In the context of Windows, there is a per-user directory for temporary
files, by default specified via the environment variable %TEMP%. Let's
allow to use that directory for our /tmp/ directory.

With this patch, we introduce the special filesystem type "usertemp":
By specifying

none /tmp usertemp binary,posix=0 0 0

in /etc/fstab, the /tmp/ directory gets auto-mounted to the directory
specified by the %TEMP% variable.

This feature comes handy in particularly in scenarios where the
administrator might want to write-protect the entire Cygwin directory
yet still needs to allow users to write into the /tmp/ directory.
This is the case in the context of Git for Windows, where the
Cygwin (MSys2) root directory lives inside C:\Program Files and hence
/tmp/ would not be writable otherwise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
8 years agoAdd definitions for NBBY to arm and rtems targets
Nick Withers [Mon, 7 Dec 2015 15:31:00 +0000 (16:31 +0100)]
Add definitions for NBBY to arm and rtems targets

* libc/sys/arm/sys/param.h (NBBY): Define if not already defined.
* libc/sys/rtems/include/sys/param.h (NBBY): Define.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMove fd_stuff from sys/types.h to sys/select.h
Corinna Vinschen [Wed, 18 Nov 2015 21:13:31 +0000 (22:13 +0100)]
Move fd_stuff from sys/types.h to sys/select.h

* libc/include/sys/types.h: Move definitions of NBBY and howmany to
sys/param.h.  Move definitions of select(2) macros to sys/select.h.
* libc/include/sys/param.h: See above.
* libc/include/sys/select.h: Move Cygwin's sys/select.h here.

* include/sys/select.h: Move select(2) macros from newlib's sys/types.h
here.  Rename howmany to _howmany to unclutter namespace. Move file to
newlib.
* libc/rexex.cc: Add declaration for cygwin_gethostname.
* poll.cc: Include sys/param.h and locale select.h.
* select.h (cygwin_select): Declare.
* uname.cc: Declare cygwin_gethostname.
* winsup.h: Drop declarations of cygwin_select and cygwin_gethostname.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAlways allocate main thread stack from pthread stack area on x86_64.
Corinna Vinschen [Mon, 7 Dec 2015 15:10:55 +0000 (16:10 +0100)]
Always allocate main thread stack from pthread stack area on x86_64.

        * dcrt0.cc: Semi-revert commit 12743c2d5d2721f3a80b4d7671a349be03c1f520.
        (dll_crt0_0): Drop setting wow64_needs_stack_adjustment on 64 bit.
        (_dll_crt0): Split out 64 bit code again and always create new main
        thread stack, unless forked off from the non main thread in the parent.
        Call create_new_main_thread_stack with parent stack commitsize if
        started from the parent's main thread.
        Only call child_info_fork::alloc_stack for the latter case on 64 bit.
        Slightly rearrange moving rsp and rbp to new stack and document how.
        Revert 32 bit wow64 handling to its former self.
        * miscfunc.cc (create_new_main_thread_stack): Take a commitsize
        parameter and use it if it's not 0.  Don't set _main_tls here, it's
        done in the caller _dll_crt0 anyway.  Return stackbase - 16 bytes,
        rather than stacklimit (which was very wrong anyway).
        * miscfuncs.h (create_new_main_thread_stack): Accommodate declaration
        to aforementioned change.
        * wincap.h (wincaps::has_3264_stack_broken): Remove element.
        * wincap.cc: Ditto, throughout.
        * wow64.cc: Semi-revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520
        but keep architecture-agnostic type changes intact.  Fix formatting.
        * wow64.h: Revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAllow cygwin_conv_path(3) and cygpath(1) to emit /proc/cygdrive prefixed path
Corinna Vinschen [Sun, 6 Dec 2015 16:25:48 +0000 (17:25 +0100)]
Allow cygwin_conv_path(3) and cygpath(1) to emit /proc/cygdrive prefixed path

        * include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag.
        * mount.cc (mount_info::cygdrive_posix_path): Take flag values rather
        than just a trailing_slash_p bool.  Emit /proc/cygdrive path if
        CCP_PROC_CYGDRIVE flag is given.
        (mount_info::conv_to_posix_path): Take flag values rather than just
        a keep_rel_p bool.  Rename _p variables.  Print flag value as hex in
        debug_printf.  Call cygdrive_posix_path with flag values.
        * mount.h (mount_info::cygdrive_posix_path): Accommodate above change
        in declaration.
        (mount_info::conv_to_posix_path): Ditto.
        * fhandler_process.cc (format_process_exename): Accommodate change to
        mount_info::conv_to_posix_path.
        * path.cc (cygwin_conv_path): Ditto.

        * cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify
        expressions.
        (cygdrive_flag): New global flag.
        (long_options): Add --proc-cygdrive option.
        (options): Add -U option.
        (usage): Add description for -U option.
        (do_sysfolders): Or cygdrive_flag to cygwin_conv_path call.
        (do_pathconv): Simply or absolute_flag to conv_func.  Or
        cygdrive_flag to conv_func.
        (do_options): Initalize absolute_flag to CCP_RELATIVE.  Initialize new
        cygdrive_flag.  Set absolute_flag to CCP_ABSOLUTE on -a.  Set
        cygdrive_flag to CCP_PROC_CYGDRIVE on -U.

        * new-features.xml (ov-new2.4): Document cygpath -U option.
        * utils.xml (cygpath): Ditto.
        * path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAlways define __high_bsssize, do not just PROVIDE it.
Nick Clifton [Fri, 4 Dec 2015 10:14:10 +0000 (10:14 +0000)]
Always define __high_bsssize, do not just PROVIDE it.

* msp430/msp430xl-sim.ld (__high_bsssize): Define.

8 years agoAdd release message for workaround added with previous commits
Corinna Vinschen [Thu, 3 Dec 2015 22:09:03 +0000 (23:09 +0100)]
Add release message for workaround added with previous commits

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoOn 64 bit, only create new thread stack if started from 32 bit process on affected...
Corinna Vinschen [Thu, 3 Dec 2015 21:56:44 +0000 (22:56 +0100)]
On 64 bit, only create new thread stack if started from 32 bit process on affected platforms

        * dcrt0.cc (dll_crt0_0): On 64 bit, set wow64_needs_stack_adjustment
        if not started from a 64 bit process.
        (_dll_crt0): Enable wow64_needs_stack_adjustment branch on 64 bit
        as well.  Remove 64 bit only code.  Introduce CREATE_STACK and
        FIX_STACK macros to conditionalize the code.  Rearrange and
        partially rewrite comments.
        * wincap.h (wincaps::has_3264_stack_broken): New element.
        * wincap.cc: Implement above element throughout.
        (wincapc::init): Set has_3264_stack_broken to false on 32 bit.
        * wow64.cc: Enable functionality on 64 bit architecture, except for
        wow64_revert_to_original_stack.  Enhance comments to explain.
        (wow64_eval_expected_main_stack): Make 64 bit clean.
        (wow64_test_for_64bit_parent): Ditto.
        * wow64.h: Export wow64_revert_to_original_stack on 32 bit only,
        everything else on all architectures.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix thinko in /proc/<PID>/maps TEB detection on W10 1511
Corinna Vinschen [Thu, 3 Dec 2015 15:54:08 +0000 (16:54 +0100)]
Fix thinko in /proc/<PID>/maps TEB detection on W10 1511

        * fhandler_process.cc (thread_info::thread_info): Accommodate the fact
        that TEBs take two pages.
        (thread_info::fill_if_match): Rewrite the method for post W10 1511 TEB
        detection.
        (format_process_maps): Add a state member to region.  Fix the code
        to handle PEB/TEB region since W10 1511.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix /proc/<PID>/maps output for PEB and TEBs on W10 1511
Corinna Vinschen [Thu, 3 Dec 2015 12:33:43 +0000 (13:33 +0100)]
Fix /proc/<PID>/maps output for PEB and TEBs on W10 1511

        * fhandler_process.cc (heap_info::fill_if_match): Return NULL, not 0.
        (thread_info::fill_if_match): Ditto.
        (thread_info::fill_if_match): New method to extract TEB info from
        PEB/TEB region since W10 1511.
        (format_process_maps): Drop outdated FIXME comment.  Add code to handle
        PEB/TEB region since W10 1511.
        * mmap.cc (posix_madvise): Align comment to new W10 1511 version.
        * wincap.h (wincaps::has_new_pebteb_region): New element.
        * wincap.cc: Implement above element throughout.
        (wincap_10_1511): New global wincaps to support Windows 10 since 1511.
        (wincapc::init): Use wincap_10_1511 for W10 builds >= 10586.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAlways move 64 bit main thread stack to defined pthread stack area
Corinna Vinschen [Thu, 3 Dec 2015 12:02:55 +0000 (13:02 +0100)]
Always move 64 bit main thread stack to defined pthread stack area

         x86_64 only:
        * dcrt0.cc (_dll_crt0): Always move stack to pthread stack area.
        Explain why.
        * miscfuncs.cc (create_new_main_thread_stack): New function to create
        OS-like stack for main thread in pthread stack area.
        * miscfuncs.cc (create_new_main_thread_stack): Declare.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoCleanup in dcrt0.cc and fork.cc
Corinna Vinschen [Thu, 3 Dec 2015 11:59:56 +0000 (12:59 +0100)]
Cleanup in dcrt0.cc and fork.cc

        * dcrt0.cc (child_info_fork::alloc_stack): Fix formatting.
        * fork.cc (frok::parent): Fix formatting.
        (child_copy): Change type of res to BOOL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAlways restore full TEB stack info in forkee
Corinna Vinschen [Thu, 3 Dec 2015 11:58:37 +0000 (12:58 +0100)]
Always restore full TEB stack info in forkee

        * dcrt0.cc (dll_crt0_1): Always restore the TEB stack info.  Especially
        restore DeallocationStack.  Fix comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd missing dcrt0.cc patch to previous commit
Corinna Vinschen [Thu, 3 Dec 2015 11:38:19 +0000 (12:38 +0100)]
Add missing dcrt0.cc patch to previous commit

* dcrt0.cc (child_info_fork::alloc_stack): Don't set stackaddr to 0.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSafely recognize when fork is running from main thread or another pthread
Corinna Vinschen [Thu, 3 Dec 2015 11:38:19 +0000 (12:38 +0100)]
Safely recognize when fork is running from main thread or another pthread

        * child_info.h (struct child_info): Add member from_main.
        * fork.cc (frok::child): Check from_main rather than stackaddr.
        (frok::parent): Set ch.from_main if running in the main thread.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRename parent stack members in child_info struct to align with OS names
Corinna Vinschen [Wed, 2 Dec 2015 11:31:40 +0000 (12:31 +0100)]
Rename parent stack members in child_info struct to align with OS names

        * child_info.h (CURR_CHILD_INFO_MAGIC): Align to below change.
        (class child_info_fork): Rename stacktop to stacklimit.  Rename
        stackbottom to stackbase.  Accommodate name change throughout Cygwin.
        Rephrase comments to be clearer.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop using _tlsbase and _tlstop in favor of access via NtCurrentTeb.
Corinna Vinschen [Wed, 2 Dec 2015 11:11:06 +0000 (12:11 +0100)]
Drop using _tlsbase and _tlstop in favor of access via NtCurrentTeb.

        * cygtls.h (_tlsbase): Remove.  Replace throughout with
        NtCurrentTeb()->Tib.StackBase.
        (_tlstop): Remove. Replace throughout with
        NtCurrentTeb()->Tib.StackLimit.
        * dcrt0.cc (child_info_fork::alloc_stack): Move definition of local
        teb variable up to be used throughout.
        * include/cygwin/config.h (__getreent): Use inline function on both
        architectures.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agomiscfuncs.cc: Fix typos in comment
Corinna Vinschen [Wed, 2 Dec 2015 09:23:56 +0000 (10:23 +0100)]
miscfuncs.cc: Fix typos in comment

8 years agoOnly generate BUILTIN SIDs for uid/gid values <= 999
Corinna Vinschen [Sun, 29 Nov 2015 20:21:35 +0000 (21:21 +0100)]
Only generate BUILTIN SIDs for uid/gid values <= 999

* uinfo.cc (pwdgrp::fetch_account_from_windows): Only create 1-5-32-x
SIDs from ids for x <= 999.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse correct gid value for Microsoft Account when /etc/group is in use
Corinna Vinschen [Sun, 29 Nov 2015 19:26:48 +0000 (20:26 +0100)]
Use correct gid value for Microsoft Account when /etc/group is in use

* sec_acl.cc (get_posix_access): In case owner SID == group SID, when
encountering the group entry, change the value of `id' accordingly.
Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSave and restore MXCSR register in delayed signal handling
Corinna Vinschen [Sat, 28 Nov 2015 10:10:41 +0000 (11:10 +0100)]
Save and restore MXCSR register in delayed signal handling

* gendef (sigdelayed): Save and restore content of the MXCSR register
on x86_64.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBelatedly create release notes for commits 2f4fef9 and 9471b0b
Corinna Vinschen [Fri, 27 Nov 2015 14:56:01 +0000 (15:56 +0100)]
Belatedly create release notes for commits 2f4fef9 and 9471b0b

8 years agoFix race condition when waiting for a signal
Corinna Vinschen [Fri, 27 Nov 2015 13:39:11 +0000 (14:39 +0100)]
Fix race condition when waiting for a signal

        * cygtls.h (_cygtls::wait_signal_arrived): Renamed from
        set_signal_arrived.
        (_cygtls::set_signal_arrived): New function signalling signal_arrived.
        (_cygtls::reset_signal_arrived): Don't reset will_wait_for_signal.
        (_cygtls::unwait_signal_arrived): New function only resetting
        will_wait_for_signal.
        (class wait_signal_arrived): Rename from set_signal_arrived.
        Accommodate name change throughout Cygwin.
        (wait_signal_arrived::~wait_signal_arrived): Call
        _cygtls::unwait_signal_arrived.  Add comment.
        * cygserver_ipc.h (ipc_set_proc_info): Fetch signal_arrived handle
        via call to _cygtls::get_signal_arrived.
        * exceptions.cc (_cygtls::interrupt_setup): Signal signal_arrived via
        call to _cygtls::set_signal_arrived.
        (_cygtls::handle_SIGCONT): Ditto.
        * fhandler_socket.cc (fhandler_socket::wait_for_events): Generate
        WSAEVENT array prior to entering wait loop.  Add cancel event object
        if available.  Remove calls to pthread_testcancel and just call
        pthread::static_cancel_self if the cancel event object is signalled.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix SEGV of kill -l 0
Michael Kwasigroch [Thu, 26 Nov 2015 21:30:43 +0000 (22:30 +0100)]
Fix SEGV of kill -l 0

* kill.cc (strsigno): Don't call sys_sigabbrev for signal 0.
(listsig): Don't call strsigno for signal 0.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix creating relative native symlinks in top-level directories
Corinna Vinschen [Thu, 26 Nov 2015 11:12:52 +0000 (12:12 +0100)]
Fix creating relative native symlinks in top-level directories

* path.cc (symlink_native): Fix index when looking for colon in path.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd MacType to BLODA
David Macek [Wed, 25 Nov 2015 12:49:42 +0000 (13:49 +0100)]
Add MacType to BLODA

One more patch. MacType was observed by several users to cause `GPGME:
Invalid crypto engine` failures in MSYS2. See
<https://github.com/Alexpux/MSYS2-packages/issues/393>.

I also removed two full stops in the sake of consistency.

* faq-using.xml: Add MacType to the BLODA.  Fix formatting.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd a section describing peculiarities of how Cygwin creates NTFS symlinks
David Macek [Tue, 24 Nov 2015 22:59:01 +0000 (23:59 +0100)]
Add a section describing peculiarities of how Cygwin creates NTFS symlinks

First take on how to describe dereferencing of Cygwin-only symlinks path
components when creating NTFS symlinks.

Note that I haven't tried building the documentation, so I don't know if
the added paragraph breaks anything. Hopefully not.

* pathnames.xml: Add a section describing peculiarities of how Cygwin
creates NTFS symlinks.

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