Commit Graph

489 Commits

Author SHA1 Message Date
Mark Geisert 7f32efbf73 POSIX Asynchronous I/O support: other files
Updates to misc files to integrate AIO into the Cygwin source tree.
Much of it has to be done when adding any new syscalls.  There are
some updates to limits.h for AIO-specific limits.  And some doc mods.
2018-07-25 09:36:24 +02:00
Corinna Vinschen 732e0b395d Cygwin: Implement pthread_tryjoin_np and pthread_timedjoin_np
- Move pthread_join to thread.cc to have all `join' calls in
  the same file (pthread_timedjoin_np needs pthread_convert_abstime
  which is static inline in thread.cc)
- Bump API version

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27 17:56:59 +02:00
Ken Brown ebc9171ede Bump Cygwin DLL version to 2.11.0 2018-06-07 09:42:36 +02:00
Ken Brown 2ea436b433 Cygwin: Document clearenv and bump API minor
Also add earlier "What changed" items to new-features.xml.
2018-06-07 09:42:36 +02:00
Corinna Vinschen 623d3fdf6b Cygwin: bump version to 2.10.1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-02-02 15:32:28 +01:00
Yaakov Selkowitz cadc12f695 cygwin: add catopen, catgets, catclose
The implementation is taken from FreeBSD with #ifdef __CYGWIN__ modifications.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-19 13:19:21 -06:00
Mark Geisert 24ff42d79a Cygwin: Implement sigtimedwait
Abstract out common code from sigwait/sigwaitinfo/sigtimedwait to
implement the latter.
2017-12-18 19:46:18 +01:00
Corinna Vinschen 08d77e5154 cygwin: document %l[ and bump API minor
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-12-01 18:21:59 +01:00
Corinna Vinschen 10b57ba8d0 cygwin: Document latest changes, bump API minor
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-11-30 21:57:16 +01:00
Yaakov Selkowitz f636eae26f cygwin: export wmempcpy
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-11-30 04:06:51 -06:00
Yaakov Selkowitz 6a848db442 cygwin: export SSP functions
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-11-29 11:25:48 -06:00
Corinna Vinschen ce0b11f9c4 Cygwin: Bump DLL version to 2.10.0, bump API minor to 319
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-11-14 21:45:32 +01:00
Corinna Vinschen 3bdd484103 cygwin: belatedly bump DLL minor version
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:40:56 +02:00
Corinna Vinschen cf8bf843f8 cygwin: export strnstr
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-08-25 18:00:46 +02:00
Ken Brown f665b1cef3 cygwin: Implement renameat2
Define the RENAME_NOREPLACE flag in <cygwin/fs.h> as defined on Linux
in <linux/fs.h>.  The other RENAME_* flags defined on Linux are not
supported.
2017-08-19 18:06:49 +02:00
Corinna Vinschen 8128f5482f cygwin: Implement pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-08-03 21:31:38 +02:00
Corinna Vinschen eb206317a8 cygwin: Bump DLL version to 2.9.0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-08-03 19:17:45 +02:00
Corinna Vinschen 37738448a0 cygwin: Implement pthread_mutex_timedlock
- pthread_mutex::lock now takes a PLARGE_INTEGER timeout pointer
  and uses that in the call to cygwait.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-08-03 19:13:21 +02:00
Yaakov Selkowitz 2c83bc950f cygwin: Export explicit_bzero
This was added to newlib together with timingsafe_*cmp but never exported.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-08-02 01:09:49 -05:00
Corinna Vinschen a674199fc9 cygwin: Bump DLL version to 2.8.3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-07-19 10:38:15 +02:00
Corinna Vinschen 2d9c69da1c cygwin: export fls, flsl, flsll
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-07-11 10:31:44 +02:00
Corinna Vinschen 055daff132 Bump DLL minor version
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-07-04 15:10:27 +02:00
Yaakov Selkowitz f698efbce1 cygwin: export strverscmp, add versionsort
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-06-19 08:16:42 -05:00
Yaakov Selkowitz dde6af6f82 Export XSI sigpause
There are two common sigpause variants, both of which take an int argument.
If you request _XOPEN_SOURCE or _GNU_SOURCE, you get the System V version,
which removes the given signal from the process's signal mask; otherwise
you get the BSD version, which sets the process's signal mask to the given
value.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-06-14 14:23:52 -05:00
Corinna Vinschen 961a6909d9 Cygwin: Export reallocarray
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-04 12:23:18 +02:00
Corinna Vinschen 6f88e6b2d5 Bump Cygwin to 2.8.1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-04 12:23:09 +02:00
Jon Turney d0a359f6d2 Implement getloadavg()
v2:
autoload PerfDataHelper functions
Keep loadavg in shared memory
Guard loadavg access by a mutex
Initialize loadavg to the current load

v3:
Shared memory version bump isn't needed if we are only extending it
Remove unused autoload
Mark inititalized flags as NO_COPY for correct behaviour in fork child

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-27 22:03:58 +01:00
Corinna Vinschen c9e4b69e9f Belatedly bump Cygwin DLL version to 2.8.0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10 20:50:35 +01:00
Jon Turney c8432a01c8 Implement dladdr() (partially)
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>
2017-03-08 17:49:08 +00:00
Jon Turney b9498f17f9 Export timingsafe_bcmp and timingsafe_memcmp
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-07 18:40:35 +00:00
Corinna Vinschen fa9d3148bf Bump Cygwin version to 2.7.1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-02-24 20:51:50 +01:00
Corinna Vinschen 4e75d7f504 Export getentropy and getrandom calls
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
2016-12-16 23:10:19 +01:00
Ken Brown dda82d1a7b Add _PC_CASE_INSENSITIVE to [f]pathconf
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>
2016-10-21 13:39:02 +02:00
Corinna Vinschen ba2851eeca Bump Cygwin version to 2.6.1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-10-19 12:52:14 +02:00
Corinna Vinschen 2ea3993619 Export and document strerror_l, strptime_l, wcsftime_l from Cygwin
Bump Cygwin API minor number.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23 17:51:14 +02:00
Jon Turney fdb7df230d Add pthread_getname_np and pthread_setname_np
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
2016-08-23 15:07:42 +01:00
Corinna Vinschen 216054fa77 Implement missing POSIX function nl_langinfo_l
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>
2016-08-20 17:22:41 +02:00
Corinna Vinschen 238455adfa Implement strto[dflu]_l/wcsto[dflu]_l
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>
2016-08-15 17:35:21 +02:00
Corinna Vinschen 91ebe04042 Bump CygwinAPI minor.
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 10:56:58 +02:00
Corinna Vinschen 8493c16316 Implement all per-locale ctype functions
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 10:56:57 +02:00
Corinna Vinschen aefd8b5b51 Implement newlocale, freelocale, duplocale, uselocale
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>
2016-08-15 10:56:57 +02:00
Corinna Vinschen bceb8ebebb Bump DLL minor version
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-23 15:21:44 +02:00
Corinna Vinschen 6e623e9320 Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout option
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>
2016-06-23 10:09:17 +02:00
Corinna Vinschen f6d9d8a182 Bump Cygwin DLL version to 2.5.2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-05-18 21:27:57 +02:00
Corinna Vinschen 002c9b468d Reformat comments in Cygwin's version.h, remove very outdated info
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-04-12 15:23:41 +02:00
Corinna Vinschen 308de2a1d4 Bump Cygwin DLL version to 2.5.1.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-04-12 15:18:29 +02:00
Corinna Vinschen 792e51b721 Add missing long double functions to Cygwin
This patch adds the long double functions missing in newlib to Cygwin.
Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l},
isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib.
Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and
fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin.

Cygwin:
	* math: New subdir with math functions.
	* Makefile.in (VPATH): Add math subdir.
	(MATH_OFILES): List of object files collected from building files in
	math subdir.
	(DLL_OFILES): Add $(MATH_OFILES).
	${CURDIR}/libm.a: Add $(MATH_OFILES) to build.
	* common.din: Add new functions from math subdir.
	* i686.din: Align to new math subdir.  Remove functions now commonly
	available.
	* x86_64.din: Ditto.
	* math.h: math.h wrapper to define mingw structs used in some files in
	math subdir.
	* include/cygwin/version.h: Bump API minor version.

newlib:
	* libc/include/complex.h: Add prototypes for complex long double
	functions.  Only define for Cygwin.
	* libc/include/math.h: Additionally enable prototypes of long double
	functions for Cygwin.  Add Cygwin-only prototypes for dreml, sincosl,
	exp10l and pow10l.  Explain why we don't add them to newlib.
	* libc/include/tgmath.h: Enable long double handling on Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29 14:43:55 +02:00
Yaakov Selkowitz 660f84b15b cygwin: export __getpagesize
The inclusion of <sys/cygwin.h> by <sys/shm.h>, besides causing namespace
pollution, also makes it very difficult to get the WINVER-dependent parts
of the former.  This affects code (such as x11vnc -unixpw_nis) which use
both SysV shared memory (e.g. the X11 MIT-SHM extension) and user password
authentication.

getpagesize is the simplest function to retreive this information, but it
is a legacy function and would also pollute the global namespace. The LSB
lists another form which is in the implementation-reserved namespace:

http://refspecs.linuxfoundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/baselib---getpagesize.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-29 12:14:18 +02:00
Corinna Vinschen 9ddf063921 Implement POSIX.1e ACL functions
* Makefile.in (DLL_OFILES): Add sec_posixacl.o.
	(SUBLIBS): Add libacl.a
	(libacl.a): New rule to create libacl.a.
	* common.din: Export POSIX ACL functions as well as most libacl.a
	extensions.
	* fhandler.h (fhander_base::acl_get): New prototype.
	(fhander_base::acl_set): Ditto.
	(fhandler_disk_file::acl_get): Ditto.
	(fhandler_disk_file::acl_set): Ditto.
	* include/acl/libacl.h: New file.
	* include/cygwin/version.h: Bump API minor version.
	* include/sys/acl.h: Drop including cygwin/acl.h.  Accommodate
	throughout Cygwin.  Add POSIX ACL definitions.
	* sec_acl.cc: Include sec_posixacl.h.  Replace ILLEGAL_UID and
	ILLEGAL_GID with ACL_UNDEFINED_ID where sensible.
	(__aclcheck): New internal acl check function to be used for
	Solaris and POSIX ACLs.
	(aclcheck32): Call __aclcheck.
	(__aclcalcmask): New function to compute ACL_MASK value.
	(__aclsort): New internal acl sort function to be used for Solaris
	and POSIX ACLs.
	(aclsort32): Call __aclsort.
	(permtostr): Work directly on provided buffer.
	(__acltotext): New internal acltotext function to be used for
	Solaris and POSIX ACLs.
	(acltotext32): Call __acltotext.
	(__aclfromtext): New internal aclfromtext function to be used for
	Solaris and POSIX ACLs.
	(aclfromtext32): Call __aclfromtext.
	* sec_posixacl.cc: New file implemeting POSIX ACL functions.
	* sec_posixacl.h: New internal header.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-08 13:56:40 +01:00
Yaakov Selkowitz 8b1ede3ce1 cygwin: Export clog10, clog10f
winsup/cygwin/
	* common.din: Add clog10, clog10f.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

	winsup/doc/
	* new-features.xml (ov-new2.5): Mention clog10, clog10f.
	* posix.xml (std-gnu): Add clog10, clog10f.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-02-22 14:45:37 -06:00