* 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>
* 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>
* 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>
* 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>
* 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>
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.
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.
* 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>
* setfacl.cc (longopts): Drop accidentally requiring an argument to
the --mask and --no-mask options.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
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.
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>
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.
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().
* 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.
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.
* 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>
* 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>
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.
* 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>
* 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>
* 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>