Corinna Vinschen [Mon, 18 Aug 2014 11:09:56 +0000 (11:09 +0000)]
* 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.
Corinna Vinschen [Thu, 14 Aug 2014 20:15:49 +0000 (20:15 +0000)]
* 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.
Corinna Vinschen [Thu, 14 Aug 2014 19:44:29 +0000 (19:44 +0000)]
* 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.
Corinna Vinschen [Thu, 14 Aug 2014 15:00:33 +0000 (15:00 +0000)]
* 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.
Corinna Vinschen [Mon, 11 Aug 2014 12:03:18 +0000 (12:03 +0000)]
* 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.
* 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.
* 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.
* 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.
Eric Blake [Fri, 1 Aug 2014 15:48:37 +0000 (15:48 +0000)]
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).
Eric Blake [Fri, 1 Aug 2014 15:44:51 +0000 (15:44 +0000)]
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)));
^
* cygwin.xsl: Allow 3 section levels in TOC.
* new-features.xml: (ov-new1.7.32): Add new section.
* ntsec.xml: Rename top-level section to reflect extension of topics.
Remove old /etc/passwd, /etc/group considerations. Add new sections
explaining Windows to POSIX account mapping. Make setuid sections
third level sections.
* pathnames.xml: Note new method of account mapping for fstab.d/$USER.
* faq-setup.xml: Rework references to /etc/passwd and /etc/group to
reflect changes to account handling.
* faq-using.xml: Ditto.
* mkgroup.c (usage): Move info message that this /etc/group isn't really
required anymore more to the top of the usage output.
* mkpasswd.c (usage): Ditto for /etc/passwd. Drop old text from output.
* cygheap.h (class cygheap_domain_info): Remove lowest_tdo_posix_offset.
* ldap.cc (cyg_ldap::fetch_posix_offset_for_domain): Return UINT32_MAX
in case of error.
* security.h (PRIMARY_POSIX_OFFSET): Define.
(NOACCESS_POSIX_OFFSET): Define.
(UNUSABLE_POSIX_OFFSET): Define.
* uinfo.cc (cygheap_domain_info::init): Drop initializing
lowest_tdo_posix_offset.
(pwdgrp::fetch_account_from_file): Set PosixOffset to either
UNUSABLE_POSIX_OFFSET or NOACCESS_POSIX_OFFSET in case we don't get a
sensible offset from AD. Explain why. Drop setting ch
lowest_tdo_posix_offset.
(pwdgrp::fetch_account_from_windows): Replace constant 0x100000 with
PRIMARY_POSIX_OFFSET throughout.
* fhandler_socket.cc (fhandler_socket::send_internal): Fix value of
out_len when tweaking the last buffer so out_len is correct in a
subsequent if expression.
* thread.cc (pthread::create): Handle stackaddr as upper bound address.
Add comment.
(pthread_attr_setstack): Store upper bound address in stackaddr.
Explain why.
(pthread_attr_getstack): Handle stackaddr as upper bound address.
Add comment.
(pthread_attr_setstackaddr): Add comment.
(pthread_attr_getstackaddr): Add comment.
(pthread_attr_getstacksize): Return default stacksize if stacksize has
not been set by the application, just as on Linux. Add comment.
(pthread_getattr_np): Store upper bound address in stackaddr. Explain
why.
* include/pthread.h: Remove outdated comment.
(pthread_attr_getstackaddr): Mark as deprecated, as on Linux.
(pthread_attr_setstackaddr): Ditto.
* sigproc.cc (sigproc_init): Set aside more buffer space for signal pipes.
(sig_send): Retry WriteFiles which fail when there is no error but packbytes
have not been sent.
* uinfo.cc (cygheap_domain_info::init): Correctly set
lowest_tdo_posix_offset to UNIX_POSIX_OFFSET.
(fetch_posix_offset): Redesign to fake a POSIX offset in all cases
where we can't fetch a non-0 POSIX offset from our primary domain.
* thread.cc (pthread_mutex::pthread_mutex): Change default type
to PTHREAD_MUTEX_NORMAL.
(pthread_mutex::unlock): Return EPERM if the mutex has no owner and
the mutex type is PTHREAD_MUTEX_ERRORCHECK, as on Linux.
(pthread_mutexattr::pthread_mutexattr): Ditto.
(pthread_mutex_unlock): Do not fail if mutex is a normal mutex
initializer.
* include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Redefine as
PTHREAD_NORMAL_MUTEX_INITIALIZER_NP.
Richard Earnshaw [Fri, 11 Jul 2014 09:10:50 +0000 (09:10 +0000)]
[aarch64] Add memchr.
2014-07-11 K�vin Petit <kevin.petit@arm.com>
* libc/machine/aarch64/memchr.S: New file.
* libc/machine/aarch64/memchr-stub.c: New file.
* libc/machine/aarch64/Makefile.am: Add the new files.
* libc/machine/aarch64/Makefile.in: Regenerated.
* thread.cc (pthread::create): Use PTHREAD_DEFAULT_STACKSIZE stacksize
if attr.stacksize is 0.
(pthread_attr::pthread_attr): Initialize stacksize to 0 to align more
closely to Linux.
(pthread_attr_getstack): Fix incorrect stackaddr computation. Return
stackaddr just like pthread_attr_getstackaddr. Remove slightly off
comment.
(pthread_attr_getstackaddr): Remove slightly off comment.
(pthread_getattr_np): Return stackaddr and stacksize based on the full
allocated stackarea.
* fhandler_socket.cc (fhandler_socket::send_internal): Improve loop to
write streams in chunks of wmem() bytes to raise performance when
writing small buffers. Rename variables and add comments to help
understanding the code in years to come.
Corinna Vinschen [Wed, 25 Jun 2014 09:10:50 +0000 (09:10 +0000)]
* autoload.cc (ldap_search_sW): Replace ldap_search_stW.
(LdapMapErrorToWin32): Import.
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Accommodate
change to cyg_ldap::open.
* ldap.cc (CYG_LDAP_TIMEOUT): Remove.
(CYG_LDAP_ENUM_TIMEOUT): Remove.
(def_tv): Remove.
(enum_tv): Remove.
(cyg_ldap::map_ldaperr_to_errno): New method to map LDAP error codes to
POSIX errno codes. Explicitly map LDAP_NO_RESULTS_RETURNED to ENMFILE.
(cyg_ldap::wait): Ditto.
(struct cyg_ldap_init): New struct.
(cyg_ldap::connect_ssl): Return ULONG. Drop setting LDAP_OPT_TIMELIMIT.
Add call to ldap_search_sW to fetch root DSE.
(cyg_ldap::connect_non_ssl): Ditto.
(ldap_init_thr): New static thread function.
(cyg_ldap::connect): New method to call connect_ssl/connect_non_ssl in
an interruptible cygthread.
(struct cyg_ldap_search): New struct.
(cyg_ldap::search_s): New method to perform generic synchronous search.
(ldap_search_thr): New static thread function.
(cyg_ldap::search): New method to call search_s in an interruptible
cygthread.
(struct cyg_ldap_next_page): New struct.
(cyg_ldap::next_page_s): New method to perform generic synchronous
paged search.
(ldap_next_page_thr): New static thread function.
(cyg_ldap::next_page): New method to call next_page_s in an
interruptible cygthread.
(cyg_ldap::open): Return POSIX errno. Call connect method.
(cyg_ldap::fetch_ad_account): Call search method rather than
ldap_search_stW.
(cyg_ldap::enumerate_ad_accounts): Return POSIX errno. Use infinite
timeout in call to ldap_search_init_pageW.
(cyg_ldap::next_account): Return POSIX errno. Call next_page method
rather than ldap_get_next_page_s.
(cyg_ldap::fetch_posix_offset_for_domain): Call search method rather
than ldap_search_stW.
(cyg_ldap::fetch_unix_sid_from_ad): Ditto.
(cyg_ldap::fetch_unix_name_from_rfc2307): Ditto.
* ldap.h (class cyg_ldap): Accommodate aforementioned changes.
* passwd.cc (pg_ent::enumerate_ad): Ditto. Break search if one of
cyg_ldap::enumerate_ad_accounts or cldap.next_account returns with
an error code other than ENMFILE.
* sec_helper.cc (cygpsid::get_id): Accommodate change to cyg_ldap::open.
* uinfo.cc (fetch_posix_offset): Ditto.
Corinna Vinschen [Mon, 23 Jun 2014 14:05:16 +0000 (14:05 +0000)]
* mount.cc (fs_info::update): Define dir in the outermost scope to avoid
accessing out-of-scope value (CID 60027). Always initialize attr to
upath (CID 60113).
Corinna Vinschen [Mon, 23 Jun 2014 09:09:54 +0000 (09:09 +0000)]
* ldap.cc (CYG_LDAP_TIMEOUT): Set to 5 secs.
(CYG_LDAP_ENUM_TIMEOUT): New timeout value for enumeration only. Set
to 60 secs.
(CYG_LDAP_ENUM_PAGESIZE): Define as number of entries per single
search page. Set to 100. Use throughout.
(def_tv): Rename from tv. Use throughout.
(enum_tv): New variable. Use in call to ldap_get_next_page_s.
Corinna Vinschen [Wed, 18 Jun 2014 17:41:52 +0000 (17:41 +0000)]
* ldap.cc (CYG_LDAP_TIMEOUT): Define as timeout value. Set to 30 secs
for now. Use throughout.
* uinfo.cc (colon_to_semicolon): New local function.
(pwdgrp::fetch_account_from_windows): Convert all colons in AD gecos
entry to commas.