Commit Graph

15821 Commits

Author SHA1 Message Date
Corinna Vinschen dc847e6b9e * path.h (path_conv::init_reopen_attr): Change from void to returning
POBJECT_ATTRIBUTES.  Take OBJECT_ATTRIBUTES reference as argument, not
	pointer.
	* fhandler_disk_file.cc: Throughout accommodate above change.
	* syscalls.cc: Ditto.
	* ntea.cc (read_ea): Don't set hdl to NULL if it's already NULL.  Set
	attr with pc.init_reopen_attr before trying to reopen file.
	(write_ea): Ditto.
	* security.cc (get_file_sd): Use pc.init_reopen_attr rather than
	pc.get_object_attr when trying to reopen file.
	(set_file_sd): Ditto.
2014-08-26 20:47:46 +00:00
Corinna Vinschen 12b244394c * cygtls.cc (san::leave/x86_64): Implement.
* cygtls.h (class tls_pathbuf): Move counter variables into a union.
	Add 64 bit element _counters covering both counter variables to
	optimize save and restore operations.
	(class san/x86_64): Only store single 64 bit value.
	(san::san/x86_64): Implement.
	(san::leave/x86_64): Only declare here, as returns_twice function.
	Explain why.
	(class san/i686): Change type of _c_cnt and _w_cnt to uint32_t.
	(__try/x86_64): Move definition of __sebastian after the first memory
	barrier.  Drop __sebastian.setup call.
2014-08-25 19:47:44 +00:00
Corinna Vinschen 5578cc4b73 * cygtls.cc (_cygtls::remove): Revert previous patch.
*  cygtls.h (struct _local_storage): Move pathbufs back here.
	(class san/x86_64): Revert class.  Save and restore pathbufs counters
	only.
	(class san/i686): Revert saving and restoring pathbufs counters.
	(__try/x86_64): Add a san variable and call it's setup method.
	(__except/x86_64): Call san::leave to restore pathbufs counters.
	* gendef (_sigbe): Revert previous change.
	* thread.cc (verifyable_object_state): Remove gcc 4.7 workaround in
	forward declaration as well.
	* tls_pbuf.cc (tls_pbuf): Revert previous change.
	* tls_pbuf.h (class tmp_pathbuf): Accommodate reverting pathbufs to
	locals structure.
	* tlsoffsets.h: Regenerate.
	* tlsoffsets64.h: Regenerate.
2014-08-25 14:53:49 +00:00
Corinna Vinschen 3f3bd10104 * Throughout, use __try/__except/__endtry blocks, rather than myfault
handler.
	* cygtls.cc (_cygtls::remove): Accommodate the fact that pathbufs
	has been moved from _local_storage to _cygtls.
	* cygtls.h (class tls_pathbuf): Add comment to hint to gendef usage
	of counters.  Change type of counters to uint32_t for clarity.
	Remove _cygtls as friend class.
	(struct _local_storage): Move pathbufs from here...
	(struct _cygtls): ...to here, allowing to access it from _sigbe.
	(class san): Only define on 32 bit.  Remove errno, _c_cnt and _w_cnt
	members.
	(san::setup): Drop parameter.  Don't initialize removed members.
	(san::leave): Don't set removed members.
	(class myfault): Only define on 32 bit.
	(myfault::faulted): Only keep implementation not taking any parameter.
	Drop argument in call to sebastian.setup.
	(__try/__leave/__except/__endtry): Implement to support real SEH.  For
	now stick to SJLJ on 32 bit.
	* dcrt0.cc (dll_crt0_0): Drop 64 bit call to
	exception::install_myfault_handler.
	* exception.h (exception_handler): Define with EXCEPTION_DISPOSITION
	as return type.
	(PDISPATCHER_CONTEXT): Define as void * on 32 bit.  Define as pointer
	to _DISPATCHER_CONTEXT on 64 bit.
	(class exception): Define separately for 32 and 64 bit.
	(exception::myfault): Add handler for myfault SEH handling on 64 bit.
	(exception::exception): Fix mangled method name to account for change
	in type of last parameter.
	(exception::install_myfault_handler): Remove.
	* exceptions.cc (exception::myfault_handle): Remove.
	(exception::myfault): New SEH handler for 64 bit.
	* gendef (_sigbe): Set tls_pathbuf counters to 0 explicitely when
	returning to the caller.
	* ntdll.h: Move a comment to a better place.
	(struct _SCOPE_TABLE): Define on 64 bit.
	* thread.cc (verifyable_object_isvalid): Remove gcc 4.7 workaround.
	* tls_pbuf.cc (tls_pbuf): Fix to accommodate new place of pathbufs.
	(tls_pathbuf::destroy): Change type of loop variables to uint32_t.
	* tls_pbuf.h (class tmp_pathbuf): Change type of buffer counters to
	uint32_t.  Accommodate new place of pathbufs.
	* tlsoffsets.h: Regenerate.
	* tlsoffsets64.h: Regenerate.
2014-08-22 09:21:33 +00:00
Corinna Vinschen 33ed7bb5bc * miscfuncs.cc (__import_address): Cover the first dereference to imp
under the fault handler.
2014-08-21 09:04:09 +00:00
Corinna Vinschen b1f81c3b71 * net.cc (if_freenameindex): Don't catch a SEGV from free to fail
loudly on double free.
2014-08-21 08:59:28 +00:00
Corinna Vinschen 88fa851784 * dir.cc (rmdir): Don't skip deleting fh in the ENOTEMPTY case. 2014-08-21 08:46:35 +00:00
Corinna Vinschen 854e058b56 * tls_pbuf.h (tmp_pathbuf::tmp_pathbuf): Convert to inline method.
(tmp_pathbuf::~tmp_pathbuf): Ditto.
	* tls_pbuf.cc (tmp_pathbuf::tmp_pathbuf): Remove here.
	(tmp_pathbuf::~tmp_pathbuf): Ditto.
2014-08-20 19:44:09 +00:00
Corinna Vinschen 905a851912 * dir.cc (dirfd): Per POSIX, return EINVAL on invalid directory stream.
(telldir): Per POSIX, return -1 and set errno to EBADF, rather than
	just returning 0, on invalid directory stream.
	* signal.cc (sigwaitinfo): Return -1, not EFAULT, when SEGV was catched.
2014-08-19 19:25:54 +00:00
Richard Earnshaw 59c3d5a1a4 * libc/machine/aarch64/memchr.S: Add check for zero-sized buffer. 2014-08-19 10:44:44 +00:00
Corinna Vinschen de1c312566 * fhandler.h (enum conn_state): Add "connect_credxchg" state.
(class fhandler_socket): Grant another bit to connect_state flag.
	* fhandler_socket.cc (fhandler_socket::af_local_connect): Rearrange
	variable definition.  Set connect_state to connect_credxchg.
	(fhandler_socket::af_local_accept): Ditto.
	(fhandler_socket::recv_internal): Accept connect_credxchg on connection
	oriented AF_LOCAL sockets as well to allow the credential exchange.
	Extend comment to explain.
2014-08-19 09:47:12 +00:00
Corinna Vinschen 67986ac4a4 * autoload.cc: Replace WNet[...]A with WNet[...]W imports.
* dcrt0.cc (initial_env): Drop strlwr calls.  Call strcasestr instead.
	* fhandler_netdrive.cc: Throughout, convert to calling WNet UNICODE
	functions.  Use tmp_pathbuf rather than alloca.  Replace call to
	strlwr with call to RtlDowncaseUnicodeString.
2014-08-19 08:41:40 +00:00
Corinna Vinschen be2b7c5684 * fhandler.h (fhandler_serial::is_tty): Reinstantiate. 2014-08-19 08:31:10 +00:00
Corinna Vinschen bd094739f3 * miscfuncs.cc (strlwr): Rename from cygwin_strlwr. Drop __stdcall
decoration.
	(strupr): Rename from cygwin_strupr.  Drop __stdcall decoration.
	* string.h (strlwr): Remove override macro.  Simply declare.
	(strupr): Ditto.
2014-08-18 18:24:06 +00:00
Corinna Vinschen d5fd6aeb6d * libc/include/sys/signal.h: Declare sigaltstack for RTEMS only. 2014-08-18 18:18:10 +00:00
Jeff Johnston 6811cfb0b9 2014-08-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/config.h[__m68k__]: Set _READ_WRITE_RETURN_TYPE
        to _ssize_t to match underlying code in libgloss.
2014-08-18 16:43:42 +00:00
Joel Sherrill 81c17949f0 2014-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/string.h: Improve language and OS standard guards.
2014-08-18 14:18:10 +00:00
Joel Sherrill 6042d39486 2014-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/signal.h: Add sigaltstack() support.
2014-08-18 14:03:35 +00:00
Corinna Vinschen 697c710dc3 *** empty log message *** 2014-08-18 11:37:27 +00:00
Corinna Vinschen 1091d4404e * dtable.cc (dtable::init_std_file_from_handle): Mention that console
handles are kernel objects since Windows 8.
	* fhandler.h (enum conn_state): Add "listener" state.
	(class fhandler_socket): Drop listener status flag.
	(fhandler_socket::lseek): Return -1 and errno ESPIPE.
	(fhandler_serial::lseek): Ditto.
	* fhandler_socket.cc (fhandler_socket::listen): Set connect_state to
	listener.  Add comment.
	(fhandler_socket::accept4): Explicitely check if the socket is listening
	and fail with EINVAL, if not.  Explain why we have to do that.
	(fhandler_socket::recv_internal): Explicitely check if the socket is
	connected if it's a stream socket.  Explain why we have to do that.
	(fhandler_socket::getpeereid): Drop now redundant test.
2014-08-18 11:09:56 +00:00
Corinna Vinschen 7e46c0af62 * configure.ac: Convert to new AC_INIT style.
* configure: Regenerate.
2014-08-15 21:24:35 +00:00
Corinna Vinschen 4dd1ecc3d4 * winsup.h (_GNU_SOURCE): Define. Explain why.
* configure.ac: Convert to new AC_INIT style.
	* configure: Regenerate.
2014-08-15 21:21:59 +00:00
Corinna Vinschen fc15ff2f0d * cygerrno.h (seterrno): Define as (always) inline function.
* errno.cc (seterrno): Remove.
2014-08-15 13:50:53 +00:00
Corinna Vinschen 1b580c732a Add missing file from last patch 2014-08-15 10:52:38 +00:00
Corinna Vinschen d1ebeeab58 * cygwin-api.xml: Include misc-funcs.xml.
* misc-funcs.xml: New file.
2014-08-14 20:47:14 +00:00
Corinna Vinschen d9e9de3f38 * dll_init.sgml: Remove.
* dtable.sgml: Move into ../doc/misc-funcs.xml.
	* external.sgml: Ditto.
	* stackdump.sgml: Ditto.
2014-08-14 20:46:28 +00:00
Corinna Vinschen 9f2842e92c * cygwin-api.xml: Move chapter tags from path.xml back here.
Include logon-funcs.xml.
	* logon-funcs.xml: Moved from ../cygwin here and converted to XML.
	* path.xml: Drop chapter tags.  Create subsections.
2014-08-14 20:15:49 +00:00
Corinna Vinschen 308ea1e73c * security.sgml: Move to ../doc dir and rename to logon-funcs.xml. 2014-08-14 20:12:50 +00:00
Corinna Vinschen 6b31215816 * Makefile.in: Throughout use parenthesis instead of braces where
appropriate.
	(DBXDIRS): Remove.
	(XSLTPROC): Define for symmetry.  Use throughout.
	(clean): Drop removing cygwin-api.xml and doctool.*.
	(cygwin-api.xml): Drop rule.
	(doctool): Drop rule.
	(Makefile.dep): Add dependency to cygwin-api.xml.
	* cygwin-api.in.xml: Rename to cygwin-api.xml.  Convert includes to
	XML XInclude style.
	* doctool.c: Remove.
	* doctool.txt: Remove.
	* faq-programming.xml: Drop reference to local utils.xml file.
	* path.xml: Moved from ../cygwin and converted to XML.
	* posix.xml: Ditto.
	* using.xml: Drop relative path from utils.xml include.
	* utils.xml: Moved from ../utils.
2014-08-14 19:44:29 +00:00
Corinna Vinschen fbf2e44799 * utils.xml: Move to ../doc. 2014-08-14 19:33:57 +00:00
Corinna Vinschen ec50fa3597 * path.sgml: Move to ../doc dir and rename to path.xml.
* posix.sgml: Move to ../doc dir and rename to posix.xml.
2014-08-14 19:31:33 +00:00
Corinna Vinschen f509713291 * dlmalloc.c: Remove unused file.
* dlmalloc.h: Ditto.
	* malloc.cc: Update to Doug Lea's malloc version 2.8.6.
2014-08-14 17:36:24 +00:00
Corinna Vinschen 433de33ec2 * arm/elf-nano.specs: New file.
* arm/elf-rdimon.specs: Support nano.specs.
	* arm/Makefile.in: Support nano.specs.
	* libnosys/nosys.specs: Support nano.specs.
2014-08-14 15:00:33 +00:00
Corinna Vinschen f703e6aa08 * libc/stdio/findfp.c (std): Don't inline when optimizing for code size. 2014-08-14 08:33:00 +00:00
Corinna Vinschen 12a8027532 * new-features.xml: (ov-new1.7.33): Add new section.
(ov-new1.7.32): Reflect intermediate 1.7.32 release.
2014-08-13 17:44:07 +00:00
Corinna Vinschen 0d45f7ee54 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 33.
(CYGWIN_VERSION_API_MINOR): Bump to reflect intermediate 1.7.32 release.
2014-08-13 17:38:47 +00:00
Corinna Vinschen 5b4e301b36 * cpuid.h: Add missing copyright header. Fix formatting. Use uint32_t
instead of unsigned throughout.  Change functions to static inline and
	always inline.
	(cpuid): Add parameter to set ecx, allowing to request extended CPUID
	info.
	* fhandler_proc.cc (format_proc_cpuinfo): Use uint32_t instead of
	unsigned throughout.  Add fake decimal places to MHz info.  Handle more
	feature flags.
	* fhandler_random.cc (fhandler_dev_random::write): Allow up to 4K
	input to add entropy.
	* syscalls.cc: Drop including cpuid.h.
2014-08-11 12:03:18 +00:00
Yaakov Selkowitz f9c956a1ff * common.din (__cxa_finalize): Export.
* dcrt0.cc (cygwin_atexit): Use d->handle with __cxa_atexit.
* dll_init.cc (dll_list::detach): Use d->handle with __cxa_finalize.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Use 274 for
__cxa_finalize as well.
2014-08-07 16:25:06 +00:00
Yaakov Selkowitz 85a7b23a5c * Makefile.common (COMPILE.cc): Add -fno-use-cxa-atexit. 2014-08-07 16:19:09 +00:00
Corinna Vinschen 5528975705 * passwd.c (usage): Rename DAYS to MINDAYS and MAXDAYS.
* utils.xml (passwd): Ditto.
2014-08-06 19:24:57 +00:00
Corinna Vinschen 89d35a4833 * ntsec.xml (ntsec-mapping): Drop plus-prepended builtin accounts as
default setting.  Add short explanation in db_prefix: always mode.
	Fix a type.  Drop a paragraph with redundant information.
2014-08-06 14:46:03 +00:00
Corinna Vinschen 0b20d00bf3 * include/sys/file.h: Add extern "C". 2014-08-06 08:46:12 +00:00
Jon TURNEY a4a96eb436 * libc/include/math.h: Also define M_PI etc. if _XOPEN_SOURCE is
defined appropriately.
2014-08-04 21:32:37 +00:00
Corinna Vinschen 79131d442e * common.din (__cxa_atexit): Export.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump to 274.
2014-08-04 16:52:04 +00:00
Corinna Vinschen 64665f459e * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop "plus_prepended"
as naming style.  Drop enum name_style_t, use a boolean
	"fully_qualified_name" value instead.  Rework function to drop
	"plus_prepended" handling througout and default to "name only" style
	as replacement.
2014-08-04 15:50:42 +00:00
Yaakov Selkowitz c0a211cc3e * faq-what.xml (faq.what.who): Remove mention of retired setup
maintainers.  Add link to cygwin-pkg-maint.
2014-08-03 19:53:24 +00:00
Eric Blake 9067d19b9a headers: properly decorate attributes
As pointed out here:
https://cygwin.com/ml/cygwin/2014-07/msg00371.html

any use of __attribute__ in a header that can be included by a user
should be namespace-safe, by decorating the attribute arguments with __
(while gcc does a lousy job at documenting it, ALL attributes have a __
counterpart, precisely so that public headers can use attributes without
risk of collision with macros belonging to user namespace).

* include/pthread.h: Decorate attribute names with __, for
namespace safety.
* include/cygwin/core_dump.h: Likewise.
* include/cygwin/cygwin_dll.h: Likewise.
* include/sys/cygwin.h: Likewise.
* include/sys/strace.h: Likewise.
2014-08-01 15:48:37 +00:00
Eric Blake ada456dcfe headers: properly decorate attributes
Found by:
find -name '*.h' |xargs grep -i 'attribute.*(([a-z]'

For an example of the type of bugs this causes, try compiling this valid
C11 program (it's valid because 'noreturn' is reserved for use in the
user namespace unless you include <stdnoreturn.h>):

$ cat foo.c
#define noreturn __attribute__((noreturn))
#include <stdlib.h>
$ gcc -c -o foo.o -Wall foo.c
In file included from /usr/include/stdlib.h:11:0,
                 from foo.c:2:
foo.c:1:18: error: expected ')' before '__attribute__'
 #define noreturn __attribute__((noreturn))
                  ^
/usr/include/stdlib.h:66:28: error: expected ',' or ';' before ')' token
 _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
                            ^

* libc/machine/spu/spu_timer_internal.h: Decorate attribute names
with __, for namespace safety.
* libc/machine/xscale/machine/profile.h: Likewise.
* libc/include/stdlib.h: Likewise.
* libc/include/_ansi.h: Likewise.
* libc/include/sys/unistd.h: Likewise.
* libc/sys/linux/linuxthreads/libc-symbols.h: Likewise.
* libc/sys/linux/linuxthreads/internals.h: Likewise.
* libc/sys/linux/machine/i386/weakalias.h: Likewise.
* libc/sys/linux/machine/i386/dl-procinfo.h: Likewise.
* libc/sys/linux/machine/i386/dl-machine.h: Likewise.
* libc/sys/linux/libc-symbols.h: Likewise.
* libc/sys/linux/iconv/gconv_charset.h: Likewise.
* libc/sys/linux/include/resolv.h: Likewise.
* libc/sys/linux/sys/unistd.h: Likewise.
* libc/sys/linux/dl/atomicity.h: Likewise.
* libc/sys/linux/dl/dynamic-link.h: Likewise.
* libc/sys/linux/dl/ldsodefs.h: Likewise.
2014-08-01 15:44:51 +00:00
Yaakov Selkowitz 02206cd3e4 * faq-what.xml (faq.what.who): CGF has retired. 2014-08-01 01:29:46 +00:00
Corinna Vinschen 1721a38efd * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix comment. 2014-07-30 14:23:53 +00:00