summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include
Commit message (Collapse)AuthorAgeFilesLines
* Rename <sys/_locale.h> to <xlocale.h>Yaakov Selkowitz2017-03-221-1/+1
| | | | | | | | | The locale_t type is provided by <xlocale.h> on Linux, FreeBSD, and Darwin. While, like on some of those systems, it is automatically included by <locale.h> with the proper feature test macros, its presence under this particular name is still presumed in real-world software. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Belatedly bump Cygwin DLL version to 2.8.0Corinna Vinschen2017-03-101-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement dladdr() (partially)Jon Turney2017-03-082-1/+20
| | | | | | | Note that this always returns with dli_sname and dli_saddr set to NULL, indicating no symbol matching addr could be found. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Export timingsafe_bcmp and timingsafe_memcmpJon Turney2017-03-071-1/+2
| | | | Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Bump Cygwin version to 2.7.1Corinna Vinschen2017-02-241-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: create separate bits/byteswap.hYaakov Selkowitz2017-02-083-37/+51
| | | | | | | | Match glibc behaviour to expose the public bswap_* macros only with an explicity #include <byteswap.h>; #include'ing <endian.h> should not expose them. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Cygwin: Add IUTF8 termios iflagCorinna Vinschen2017-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The termios code doesn't handle erasing of multibyte characters in canonical mode, it always erases a single byte. When entering a multibyte character and then pressing VERASE, the input ends up with an invalid character. Following Linux we introduce the IUTF8 input flag now, set by default. When this flag is set, VERASE or VWERASE will check if the just erased input byte is a UTF-8 continuation byte. If so, it erases another byte and checks again until the entire UTF-8 character has been removed from the input buffer. Note that this (just as on Linux) does NOT work with arbitrary multibyte codesets. This only works with UTF-8. For a discussion what happens, see https://cygwin.com/ml/cygwin/2017-01/msg00299.html Sidenote: The eat_readahead function is now member of fhandler_termios, not fhandler_base. That's necessary to get access to the terminal's termios flags. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Export getentropy and getrandom callsCorinna Vinschen2016-12-162-3/+33
| | | | | | | | | | | | getentropy per OpenBSD http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2 getrandom per Linux http://man7.org/linux/man-pages/man2/getrandom.2.html Note that GRND_NONBLOCK is not handled
* Provide <memory.h>Sebastian Huber2016-11-221-15/+0
| | | | | | | | Provide <memory.h> for all standard Newlib targets and remove Cygwin-specific header. Most POSIX like systems provide this historic header. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Move pthread types to <sys/_pthreadtypes.h>Sebastian Huber2016-11-172-46/+59
| | | | | | | | | | This makes it possible provide operating system specific types for <pthread.h>. It is in line with the FreeBSD header file structure and allows a future cleanup of <pthread.h> to not expose unrelated things via <sys/types.h> and <unistd.h>. Glibc uses the similar <bits/pthreadtypes.h> for this purpose. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add _PC_CASE_INSENSITIVE to [f]pathconfKen Brown2016-10-211-1/+2
| | | | | | | | Update the getconf utility to support the new flag as well as _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY. These were previously unsupported, probably as an oversight. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump Cygwin version to 2.6.1Corinna Vinschen2016-10-191-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Export and document strerror_l, strptime_l, wcsftime_l from CygwinCorinna Vinschen2016-08-231-1/+2
| | | | | | Bump Cygwin API minor number. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add pthread_getname_np and pthread_setname_npJon Turney2016-08-232-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds pthread_getname_np and pthread_setname_np. These were added to glibc in 2.12[1] and are also present in some form on NetBSD and several UNIXes. The code is based on NetBSD's implementation with changes to better match Linux behaviour. Implementation quirks: * pthread_setname_np with a NULL pointer segfaults (as linux) * pthread_setname_np returns ERANGE for names longer than 16 characters (as linux) * pthread_getname_np with a NULL pointer returns EFAULT (as linux) * pthread_getname_np with a buffer length of less than 16 returns ERANGE (as linux) * pthread_getname_np truncates the thread name to fit the buffer length. This guarantees success even when the default thread name is longer than 16 characters, but means there is no way to discover the actual length of the thread name. (Linux always truncates the thread name to 16 characters) * Changing program_invocation_short_name changes the default thread name (on linux, it has no effect on the default thread name) I'll leave it up to you to decide if any of these matter. This is implemented via class pthread_attr to make it easier to add pthread_attr_[gs]etname_np (present in NetBSD and some UNIXes) should it ever be added to Linux (or we decide we want it anyway). [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS
* Implement missing POSIX function nl_langinfo_lCorinna Vinschen2016-08-201-1/+2
| | | | | | | | | | | | Change nl_langinfo to nl_langinfo_l using locale given as argument. Remove outdated TRANSITION_PERIOD_HACK. The codeset is stored in the locale for quite some time now. For !MB_CAPABLE targets, just return "US_ASCII" as codeset. Implement nl_langinfo by calling nl_langinfo_l. Export nl_langinfo_l from Cygwin DLL and bump minor API version number. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Only define __getreent inline function when building newlib or CygwinCorinna Vinschen2016-08-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Commit 6f3943b erroneously removed the `#ifdef _COMPILING_NEWLIB' guarding the __getreent inline function. This patch ignored the fact that config.h is included when building applications, and the code in question requires internal, auto-generated headers to be available which are not exposed to user-space. Reinstantiate defined(_COMPILING_NEWLIB) test and alternatively check for defined (__INSIDE_CYGWIN__), otherwise we'd have to reinstantiate the __getreent macro in cygtls.h which is really confusing. While testing it turned out that a low number of source codes inside Cygwin won't see the inline __getreent due to a missing __INSIDE_CYGWIN__ definition. For malloc.cc this was actually deliberate to get different definitions from including cygmalloc.h. Change this by defining __INSIDE_CYGWIN__ in malloc.cc but changing the test in cygmalloc.h to test for defined(DLMALLOC_VERSION). This might need a change if we ever get around to replace dlmalloc with a newer, more threading-aware malloc implementation. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Reinstantiate Cygwin function called `__getreent'Corinna Vinschen2016-08-181-2/+0
| | | | | | | | | | This partially reverts commit 10a30e7 as far as the Cygwin version of the __getreent function is concerned. Remove _COMPILING_NEWLIB guard only allowing to use __getreent inline function when building newlib, since we wan to use it in Cygwin as well. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Stefan Assmann <sassmann@redhat.com>
* Revert "Fix __getreent function for Cygwin"Corinna Vinschen2016-08-181-2/+1
| | | | | | | | | | | This reverts commit 4de8596. It worked around a problem which was actually introduced by patch 10a30e7 a few weeks ago. Rather than adding special code to the newlib version of __getreent, the followup patch reinstantiates the original, Cygwin-only implementation of __getreent. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Stefan Assmann <sassmann@redhat.com>
* Fix __getreent function for CygwinCorinna Vinschen2016-08-181-1/+2
| | | | | | | | | | | | | | | | | | So far the lib function __getreent always returned _impure_ptr. On Cygwin this is only correct after _impure_ptr got initialized. The inline function in include/cygwin/config.h always returns the right _reent ptr, though. After introducing per-thread locales, the __getreent function is called prior to initialization of _impure_ptr (from dll_crt0_0) to access the locale pointer, which leads to a crash. Fix the __getreent lib function for Cygwin to return the correct _reent pointer all the time. Rename inline function to __inline_getreent and introduce a macro __getreent calling the inline function. Change the lib function __getreent to call __inline_getreent on Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement strto[dflu]_l/wcsto[dflu]_lCorinna Vinschen2016-08-151-1/+4
| | | | | | | | | | Implement GNU extensions strtod_l, strtof_l, strtol_l, strtold_l, strtoll_l, strtoul_l, strtoull_l, wcstod_l, wcstof_l, wcstol_l, wcstold_l, wcstoll_l, wcstoul_l, wcstoull_l. Export from Cygwin, fix posix.xml. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add sys/_locale.h header and fix up headersCorinna Vinschen2016-08-151-1/+12
| | | | Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Bump CygwinAPI minor.Corinna Vinschen2016-08-151-3/+5
| | | | Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Implement all per-locale ctype functionsCorinna Vinschen2016-08-151-1/+7
| | | | Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Implement newlocale, freelocale, duplocale, uselocaleCorinna Vinschen2016-08-151-3/+4
| | | | | | | | Add global const __C_locale for reference purposes. Bump Cygwin API minor number and DLL major version number to 2.6.0. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Fix 32-bit SSIZE_MAXEric Blake2016-07-141-1/+9
| | | | | | | | | | | | | | | | | | | POSIX requires that SSIZE_MAX have the same type as ssize_t, but on 32-bit, we were defining it as a long even though ssize_t resolves to an int. It also requires that SSIZE_MAX be usable via preprocessor #if, so we can't cheat and use a cast. If this were newlib, I'd have had to hack _intsup.h to probe the qualities of size_t (via gcc's __SIZE_TYPE__), similar to how we already probe the qualities of int8_t and friends, then cross our fingers that ssize_t happens to have the same rank (most systems do, but POSIX permits a system where they differ such as size_t being long while ssize_t is int). Unfortunately gcc gives us neither __SSIZE_TYPE__ nor __SSIZE_MAX__. On the other hand, our limits.h is specific to cygwin, so we can just shortcut to the correct results rather than being generic to all possible ABI. Signed-off-by: Eric Blake <eblake@redhat.com>
* machine/_types.h: __blkcnt_t should be signedRay Donnelly2016-07-141-1/+1
| | | | | | | | | | [1] states: "blkcnt_t and off_t shall be signed integer types." This causes pacman to fail when the size requirement of the net update operation is negative, instead it calculated a huge positive number. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
* Remove leftover useless copyright hintsCorinna Vinschen2016-06-252-6/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix comments for AI_ADDRCONFIG and AI_V4MAPPEDCorinna Vinschen2016-06-241-3/+3
|
* include/cygwin/if.h: Fix a commentCorinna Vinschen2016-06-241-2/+2
|
* Bump DLL minor versionCorinna Vinschen2016-06-231-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen2016-06-23102-216/+0
| | | | | | | | | | | | | | Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause. Everything else stays under GPLv3+. New Linking Exception exempts resulting executables from LGPLv3 section 4. Add CONTRIBUTORS file to keep track of licensing. Remove 'Copyright Red Hat Inc' comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: include sys/types.h in sys/xattr.hYaakov Selkowitz2016-06-031-0/+1
| | | | | | | Using libattr's <xattr/xattr.h> requires consumers to explicitly include <sys/types.h> first, but glibc's header in sys/ already contains the include. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Bump Cygwin DLL version to 2.5.2Corinna Vinschen2016-05-181-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always provide register_t via <sys/types.h>Sebastian Huber2016-04-211-5/+0
| | | | | | | | Always provide register_t via <sys/types.h> for glibc and BSD compatibility. Define __BIT_TYPES_DEFINED__ to 1 like glibc for legacy header files. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Remove cygwin/types.hCorinna Vinschen2016-04-211-22/+0
|
* Resurrect <machine/types.h> for <sys/types.h>Sebastian Huber2016-04-212-123/+143
| | | | | | | | | | | Resurrect <machine/_user_types.h> for use in <sys/types.h>. Newlib targets may provide an own version of <machine/types.h> in their machine directory to add custom user types for <sys/types.h>. Check the _SYS_TYPES_H header guard to prevent a direct include of <machine/types.h>, since the <machine/types.h> file is a Newlib speciality. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide in_port_t via <sys/types.h>Sebastian Huber2016-04-191-1/+4
| | | | | | | Provide in_port_t via <sys/types.h> if __BSD_VISIBLE for BSD compatibility. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide in_addr_t via <sys/types.h>Sebastian Huber2016-04-191-1/+5
| | | | | | | Provide in_addr_t via <sys/types.h> if __BSD_VISIBLE for BSD compatibility. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Introduce __sa_family_t for BSD compatibiliySebastian Huber2016-04-192-1/+4
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Introduce __socklen_t for BSD compatibilitySebastian Huber2016-04-192-5/+7
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* BSD compatibility for <machine/endian.h>Sebastian Huber2016-04-193-29/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce <machine/_endian.h> to let target based customization of <machine/endian.h> via * _LITTLE_ENDIAN, * _BIG_ENDIAN, * _PDP_ENDIAN, and * _BYTE_ORDER. defines. Add definitions expected by FreeBSD to <machine/endian.h> like * _QUAD_HIGHWORD, * _QUAD_LOWWORD, * __bswap16(), * __bswap32(), * __bswap64(), * __htonl(), * __htons(), * __ntohl(), and * __ntohs(). Also, if __BSD_VISIBLE * LITTLE_ENDIAN, * BIG_ENDIAN, * PDP_ENDIAN, and * BYTE_ORDER. Targets that define __machine_host_to_from_network_defined in <machine/_endian.h> must provide their own implementation of * __htonl(), * __htons(), * __ntohl(), and * __ntohs(), otherwise a default implementation is provided by <machine/endian.h>. In case of GCC defines to builtins are used. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide POSIX defined fsblkcnt_t and fsfilcnt_tSebastian Huber2016-04-152-12/+8
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide POSIX defined blksize_t in <sys/types.h>Sebastian Huber2016-04-152-5/+3
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide POSIX defined blkcnt_t in <sys/types.h>Sebastian Huber2016-04-152-6/+4
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Define mode_t via __mode_tSebastian Huber2016-04-151-4/+0
| | | | | | Use __uint32_t to avoid the use of GCC-specific _ST_INT32. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Add BSD guard for ino_t in <sys/types.h>Sebastian Huber2016-04-152-8/+4
| | | | | | Introduce internal type __ino_t. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Provide POSIX defined id_t in <sys/types.h>Sebastian Huber2016-04-151-6/+0
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Use __machine_*_t_defined for internal typesSebastian Huber2016-04-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | Newlib defines defaults for internal types via <sys/_types.h> and uses <machine/_types.h> to let targets define their own type if necessary. Previously for example #ifndef __dev_t_defined typedef short __dev_t; #endif However, the __*_t_defined pattern conflicts with the glibc type guard pattern for user types, e.g. dev_t in this example. Introduce a __machine_*_t_defined pattern for internal types (defined by <machine/_types.h>, used by <sys/_types.h>). For example #ifndef __machine_dev_t_defined typedef short __dev_t; #endif Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Get rid of some special cases for Cygwin in sys/types.hCorinna Vinschen2016-04-133-31/+27
| | | | | | | | | Remove off_t typedef from cygwin/types.h thus relying on sys/types.h. Introduce winsup/cygwin/machine/_types.h and move some types shared with newlib into it. Get rid of their definition in cygwin/types.h. Add same handling for __key_t/key_t as for the other types. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Eliminate use of Newlib-specific <machine/types.h>Sebastian Huber2016-04-131-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change solves a glibc/BSD compatibility problem. glibc and BSD use double underscore types for internal types. The Linux port of Newlib uses some glibc provided internal type definitions which are not protected by guard defines, e.g. __off_t. To avoid a conflict Newlib uses single underscore types for some internal types, e.g. _off_t. However, for BSD compatibility we have to define the internal types with double underscore names in <sys/_types.h>. The header file <machine/types.h> is Newlib-specific. It was used instead of <sys/_types.h> to provide the internal type definitions _CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t. Move these definitions to <sys/_types.h> (there exist two instances of this file, one for Linux and one for all other targets). This makes the _HAVE_SYSTYPES configuration define obsolete (could possibly break the __RDOS__ target). Use the standard <sys/_types.h> include throughout. Move __loff_t defintion to default (non-Linux) <sys/_types.h>. Define it via _off64_t to avoid a dependency on the compiler. Provide the __off_t definition via default (non-Linux) <sys/_types.h> based on _off_t for all systems except Cygwin. For Cygwin use _off64_t. Define off_t via __off_t. Provide the __pid_t definition via default (non-Linux) <sys/_types.h>. This prevents a potential __pid_t and pid_t incompatibility. Add BSD guard defines for pid_t. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>