Commit Graph

11814 Commits

Author SHA1 Message Date
Sebastian Huber 5d29023c11 Add __nl_item to <sys/_types.h> and use it
Add __nl_item to <sys/_types.h> for FreeBSD compatibility.  Use it in
<langinfo.h> and the Cygwin <nl_types.h>.  Make the enum __nl_item in
<langinfo.h> anonymous.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-08-24 15:00:01 +02:00
Corinna Vinschen 36cb95f602 CYgwin: fix typo in comment
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-24 13:36:06 +02:00
Corinna Vinschen 71b4e3b336 Cygwin: get_mem_values: Fix prototype
Incomplete change unsigned long -> size_t was only visible on 32 bit, sigh.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-17 20:40:18 +02:00
Corinna Vinschen 09c114d7e2 Cygwin: document /proc/<PID>/status and /proc/<PID>/statm patches
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-17 20:33:38 +02:00
Corinna Vinschen c2fa05899d Cygwin: get_mem_values: Return number of Cygwin pages in arguments
Simplify callers accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-17 20:32:42 +02:00
Corinna Vinschen 7b70195f5d Cygwin: get_mem_values: Convert arguments to call-by-reference
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-17 20:32:42 +02:00
Corinna Vinschen 630294d373 Cygwin: get_mem_values: Return allocation as size_t values
Use size_t in callers, too.  Fix __small_sprintf format specifiers.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-17 20:32:42 +02:00
Corinna Vinschen ca2ec0c5cc Revert "Use allocation granularity as the 'page_size' in /proc/<pid>/status as well, for consistency with /proc/<pid>/statm"
This reverts commit 8a32c24a7b.

Replacing page_size() with allocation_granularity() was incorrect.
The values returned by get_mem_values() are # of pages of size
page_size().  Multiplying with allocation_granularity() here
results in values 16 times too big.
2018-08-17 19:16:42 +02:00
Corinna Vinschen 76d17e6860 Cygwin: Add missing items to release notes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-17 11:49:24 +02:00
Ken Brown ed4d919c24 setfacl: Rename the option --file to --set-file, as on Linux
Retain --file as an undocumented option for backwards compatibility.
2018-08-17 11:35:24 +02:00
Corinna Vinschen ef11dd8b47 Cygwin: Add FE_ALL_EXCEPT change to release notes.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-15 18:02:22 +02:00
J.H. van de Water 4c4c19f548 Keep the denormal-operand exception masked; modify FE_ALL_EXCEPT accordingly.
By excluding the denormal-operand exception from FE_ALL_EXCEPT, it will not
be possible anymore to UNmask this exception by means of the API defined by
/usr/include/fenv.h

Note: terminology has changed since IEEE Std 854-1987; denormalized numbers
are called subnormal numbers nowadays.

This modification has basically been motivated by the fact that it is also
not possible on Linux to manipulate the denormal-operand exception by means
of the interface as defined by /usr/include/fenv.h. This has been the state
of affairs on Linux since 2001 (Andreas Jaeger).

The exceptions required by the standard (IEEE Std 754), in case they can be
supported by the implementation, are:
FE_INEXACT, FE_UNDERFLOW, FE_OVERFLOW, FE_DIVBYZERO and FE_INVALID.

Although it is allowed to define additional exceptions, there is no reason
to support the "denormal-operand exception" in this case (fenv.h), because
the subnormal numbers can be handled almost as fast the normalized numbers
by the hardware of the x86/x86_64 architecture. Said differently, a reason
to trap on the input of subnormal numbers does not exist. At least that is
what William Kahan and others at Intel asserted around 2000.
(that is William Kahan of the K-C-S draft, the precursor to the standard)

This commit modifies winsup/cygwin/include/fenv.h as follows:
 - redefines FE_ALL_EXCEPT from 0x3f to 0x3d
 - removes the definition for FE_DENORMAL
 - introduces __FE_DENORM (0x2) (enum in Linux also uses __FE_DENORM)
 - introduces FE_ALL_EXCEPT_X86 (0x3f), i.e. ALL x86/x86_64 FP exceptions
2018-08-15 18:02:22 +02:00
Corinna Vinschen 9122f82a55 Cygwin: Add J.H. van de Water to CONTRIBUTORS
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-15 18:02:22 +02:00
Corinna Vinschen dbd872f4ad Cygwin: fenv.h: Convert to ASCII-only
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-14 11:48:29 +02:00
Corinna Vinschen 423fc83dfd Cygwin: utils: ps: use fputs to print fixed strings
Avoid gcc warning "format not a string literal and no format arguments"

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-09 08:41:18 +02:00
Corinna Vinschen 8bfb1afd6b Cygwin: utils: strace: fix format string
%ll is long valid for mingw builds.  Use this rather than %I64
to avoid a gcc warning

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-08 10:50:19 +02:00
Corinna Vinschen 37f4fea07c Cygwin: utils: change 3rd readlink param to size_t
Avoid gcc warnings

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-08 10:50:19 +02:00
Corinna Vinschen 13909bc262 Cygwin: utils: cygcheck: fix filesystem output format
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-08 10:50:13 +02:00
Corinna Vinschen 1e0a1f59d9 Cygwin: implement sched_getcpu
* create new function __get_cpus_per_group to evaluate # of CPU groups
* Call from  format_proc_cpuinfo and sched_getcpu
* Bump API minor version

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-07 14:51:10 +02:00
Mark Geisert b1952c03a8 Fix return value on aio_read/write success
Internally track resultant byte counts as ssize_t, but return 0 as int
for success indication, per POSIX.
2018-08-07 09:49:18 +02:00
Corinna Vinschen f16b198c3b Cygwin: Document fegetenv patch
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-03 09:35:31 +02:00
J.H. van de Water d79069d2ff Cygwin: fegetenv() should not disable exceptions
fnstenv MUST be followed by fldenv in fegetenv(), as the former disables all
exceptions in the x87 FPU, which is not appropriate here (fegetenv() ).
fldenv after fnstenv should reload the x87 FPU w/ the configuration that was
saved by fnstenv, i.e. a configuration that might have exceptions enabled.

Note: x86_64 uses SSE for floating-point, not the x87 FPU. However, because
feraiseexcept() attempts to provoke an exception using the x87 FPU, the bug
in fegetenv() will make this attempt futile here (x86_64).

Note: WoW uses the x87 FPU for floating-point, not SSE. Here anything that
would normally result in triggering an exception, not only feraiseexcept(),
will not be able to, as result of the bug in fegetenv().
2018-08-03 09:33:49 +02:00
Yaakov Selkowitz 7e09931ad9 Cygwin: fpathconf: update _PC_ASYNC_IO return value
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-07-25 15:00:43 -05:00
Yaakov Selkowitz f6417be2aa Cygwin: define _POSIX_ASYNCHRONOUS_IO
This feature is now available as of the recent AIO commits.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-07-25 10:48:55 -05:00
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
Mark Geisert 87253cbe38 POSIX Asynchronous I/O support: fhandler files
This code is where the AIO implementation is wired into existing Cygwin
mechanisms for file and device I/O: the fhandler* functions.  It makes
use of an existing internal routine prw_open to supply a "shadow fd"
that permits asynchronous operations on a file the user app accesses
via its own fd.  This allows AIO to read or write at arbitrary locations
within a file without disturbing the app's file pointer.  (This was
already the case with normal pread|pwrite; we're just adding "async"
to the mix.)
2018-07-25 09:36:24 +02:00
Mark Geisert a9ffa71a15 POSIX Asynchronous I/O support: aio files
This is the core of the AIO implementation: aio.cc and aio.h.  The
latter is used within the Cygwin DLL by aio.cc and the fhandler* modules,
as well as by user programs wanting the AIO functionality.
2018-07-25 09:36:22 +02:00
Ken Brown 982dd20ed9 getfacl: Simplify by using acl_to_any_text 2018-07-25 09:32:36 +02:00
Ken Brown b610a9cf29 getfacl and setfacl: Align with Linux
Make getfacl print two colons instead of one after "other" and "mask".
Change the help text for setfacl to indicate that there can be either
one colon or two.
2018-07-23 17:31:09 +02:00
Corinna Vinschen e9f223877f Cygwin: move FP environment exports to common.din
We only have the symbols defined for i686 by accident since 2013...

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-20 13:55:26 +02:00
Mark Geisert 3e51cc478d fix duration handling in sigtimedwait 2018-07-19 13:18:49 +02:00
Corinna Vinschen 5ed8f2354f Cygwin: Treat PROCESSOR_ARCHITECTURE_INTEL as running under WOW64 on ARM64
Bug in current ARM64 WOW64: GetNativeSystemInfo returns
PROCESSOR_ARCHITECTURE_INTEL rather than PROCESSOR_ARCHITECTURE_ARM64.
Provide for this.

Make code better readable.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-12 15:28:13 +02:00
Corinna Vinschen a4f1f59bc7 Cygwin: Don't print FAST_CWD warning in WOW64 on ARM64 systems
No way to test this, yet.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-10 14:45:52 +02:00
Corinna Vinschen 698d93c4b4 Cygwin: fix a race in the FAST_CWD fallback code
Guard the entire operation with the FastPebLock critical section
used by RtlSetCurrentDirectory_U as well, thus eliminating the
race between concurrent chdir/fchdir/SetCurrentDirectory calls.

Streamline comment explaining the fallback method.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-10 14:13:15 +02:00
Takashi Yano 8e782bbd94 Fix a problem that connection to syslogd fails.
* fhandler_socket_local.cc (get_inet_addr_local): Change type from
  'static int' to 'int' to be callable from syslog.cc.
* syslog.cc (connect_syslogd): Use get_inet_addr_local() instead of
  getsockname() to retrieve name information of the syslogd socket.
2018-07-06 10:41:21 +02:00
Takashi Yano 0ce27ecd08 Cygwin: Include local ntsecapi.h
Our local ntsecapi.h wrapper corrects a bug in the definition of
SystemFunction036 which otherwise leads to crashes on 32 bit when
using RtlGenRandom.  The fhandler_socket_local.cc file accidentally
included the incorrect w32api version of that file, rather than the
local wrapper.  Fix it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-07-04 14:17:28 +02:00
Takashi Yano 1c1cec9cdf Fix a bug of psiginfo() that changes the orientation of stderr.
* strsig.cc (psiginfo): Fix the problem that psiginfo() changes
  the orientation of stderr to byte-oriented mode if stderr is
  not oriented yet.
2018-07-03 15:38:47 +02:00
Corinna Vinschen 995d2a824a Cygwin: tape: Handle non-standard "no medium" error code
Certain tape drives (known example: QUANTUM_ULTRIUM-HH6) return
the non-standard ERROR_NOT_READY rather than ERROR_NO_MEDIA_IN_DRIVE
if no media is present.  ERROR_NOT_READY is not documented as valid
return code from GetTapeStatus.  Without handling this error code
Cygwin's tape code can't report an offline state to user space.

Fix this by converting ERROR_NOT_READY to ERROR_NO_MEDIA_IN_DRIVE
where appropriate.

Add a debug_printf to mtinfo_drive::get_status to allow requesting
user info without having to rebuild the DLL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-29 15:31:15 +02:00
Corinna Vinschen 4b97244d12 Cygwin: define pthread_tryjoin_np/pthread_timedjoin_np _GNU_VISIBLE
These functions are GNU extensions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27 18:20:47 +02:00
Corinna Vinschen c9d6787e76 Cygwin: doc: add pthread_tryjoin_np, pthread_timedjoin_np
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27 18:20:11 +02:00
Corinna Vinschen cb3ddf9e2a Cygwin: pthread_timedjoin_np: return ETIMEDOUT, not EBUSY
pthread_timedjoin_np returns ETIMEDOUT if a thread is still running,
not EBUSY as pthread_tryjoin_np.

Also, clean up initializing timeout in pthread_tryjoin_np.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-27 18:19:18 +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
Corinna Vinschen 6497fdfaf4 Cygwin: fix bumptious GCC 7 warnings
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26 17:20:48 +02:00
Corinna Vinschen 6c55be9dbb Cygwin: Allow to build without experimental AF_UNIX code by default
Introduce __WITH_AF_UNIX preprocessor flag to enable the new code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26 16:31:17 +02:00
Corinna Vinschen 17918cc6a6 Cygwin: add Unicode patch to release notes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26 10:21:18 +02:00
Corinna Vinschen dbe905c140 Cygwin: exceptions: fix FPE exception flags
The FPE flags for divisions by zero were not implemented

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26 10:12:19 +02:00
Corinna Vinschen 3dc89bbafe Cygwin: signal.h: improve exception flags definition
- add numbers for readability
- add a preprocessor macro for each flag

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26 10:12:10 +02:00
Takashi Yano 9c84bfd479 Fix the handling of out-of-band (OOB) data in a socket.
* fhandler.h (class fhandler_socket_inet): Add variable bool oobinline.
* fhandler_socket_inet.cc (fhandler_socket_inet::fhandler_socket_inet):
  Initialize variable oobinline.
(fhandler_socket_inet::recv_internal): Make the handling of OOB data
  as consistent with POSIX as possible. Add simulation of inline mode
  for OOB data as a workaround for broken winsock behavior.
(fhandler_socket_inet::setsockopt): Ditto.
(fhandler_socket_inet::getsockopt): Ditto.
(fhandler_socket_wsock::ioctl): Fix return value of SIOCATMARK command.
  The return value of SIOCATMARK of winsock is almost opposite to
  expectation.
* fhandler_socket_local.cc (fhandler_socket_local::recv_internal):
  Remove the handling of OOB data from AF_LOCAL domain socket. Operation
  related to OOB data will result in an error like Linux does.
(fhandler_socket_local::sendto): Ditto.
(fhandler_socket_local::sendmsg): Ditto.

This fixes the issue reported in following post.
https://cygwin.com/ml/cygwin/2018-06/msg00143.html
2018-06-22 10:20:08 +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