Re: [PATCH] Cygwin: add fd validation to mq_* functions

2025-01-15 Thread mark
I believe a positive but nonexistent fd passed to cygheap_getfd results in a -1, so that case should be covered by this patch. However I botched the coding for mq_close. That fix plus anything else needed per reviews will appear as a v2. Thanks & Regards, ..mark Jan 15, 2025 3:35:4

Re: [PATCH] Ctrl-C and non-Cygwin programs

2012-05-25 Thread Mark Lofdahl
rk in this situation. http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155.aspx Thanks, Mark Lofdahl

[PATCH] FAQ update: packages needed to build Cygwin

2013-12-30 Thread Mark Geisert
Hope I'm doing this correctly. Here is the ChangeLog entry followed by the patch. I wasn't sure if patch originator or patch committer, if different, gets their name in the ChangeLog entry. Patch rationale available on request. Cheers, ..mark 2013-12-31 Ma

Re: [PATCH] FAQ update: packages needed to build Cygwin

2013-12-30 Thread Mark Geisert
Missed this in proofreading... +installed; you at least need g++, make, ..should be.. +installed; you at least need gcc-g++, make, ..mark

patch for command line containing equals sign

2014-03-20 Thread Weber, Mark
See http://cygwin.com/ml/cygwin-patches/2014-q1/msg00017.html and related. Thanks for posting how the new behavior is different from the old. I am having a related issue, with C++ code that parses the command line. The command line we support is something like - program_name arg1 -option1=v

gprof profiling of multi-threaded Cygwin programs

2016-02-16 Thread Mark Geisert
on abstracting out the updating of profile counters based on a thread handle. (profthr_func): Updated to call profthr_byhandle() to sample the main thread then call cygheap_profthr_all() to sample all other pthreads. Thanks for reading, ..mark diff --git a/winsup/cygwin/c

Re: gprof profiling of multi-threaded Cygwin programs

2016-02-17 Thread Mark Geisert
On Wed, 17 Feb 2016, Corinna Vinschen wrote: Hi Mark, thanks for the patch. Generally the patch is fine, I have just a few nits. On Feb 16 21:28, Mark Geisert wrote: I've attached a patch set modifying Cygwin's profiling support to sample PC values of all an application's th

Re: gprof profiling of multi-threaded Cygwin programs

2016-02-18 Thread Mark Geisert
On Thu, 18 Feb 2016, Jon Turney wrote: Thanks for this. On 17/02/2016 05:28, Mark Geisert wrote: There is a behavioral change that ought to be documented somewhere: If a gmon.out file exists when a profiled application exits, the app will now dump its profiling info into another file

Re: gprof profiling of multi-threaded Cygwin programs

2016-02-18 Thread Mark Geisert
On Thu, 18 Feb 2016, Jon Turney wrote: On 18/02/2016 11:29, Mark Geisert wrote: A brief search tells me that apparently glibc supports the (undocumented) GMON_OUT_PREFIX env var which enables a similar behaviour. Ah, I did not know about that. It would be easy to implement. So I'm le

Re: gprof profiling of multi-threaded Cygwin programs

2016-02-18 Thread Mark Geisert
On Thu, 18 Feb 2016, Corinna Vinschen wrote: On Feb 17 22:35, Mark Geisert wrote: I do see that a case could be made for general profiling documentation in winsup/doc/programming.xml but that's more than I want to take on at the moment. It doesn't have to be part of the source

[PATCH] gprof profiling of multi-threaded Cygwin programs, ver 2

2016-02-20 Thread Mark Geisert
rs based on a thread handle. (profthr_func): Update to call profthr_byhandle() to sample the main thread then call cygheap_profthr_all() indirectly through cygwin_internal(CW_CYGHEAP_PROFTHR_ALL) to sample all other threads. Thanks, ..mark --- winsup/cygwin/cyghe

Re: [PATCH] gprof profiling of multi-threaded Cygwin programs, ver 2

2016-02-22 Thread Mark Geisert
good to me. Great! I'll follow up with Jon separately (to the list) on his comments. ..mark

Re: [PATCH] gprof profiling of multi-threaded Cygwin programs, ver 2

2016-02-22 Thread Mark Geisert
Hi Jon, On Mon, 22 Feb 2016, Jon Turney wrote: Thanks for this. A few comments inline. On 20/02/2016 08:16, Mark Geisert wrote: +/* Called from profil.c to sample all non-main thread PC values for profiling */ +extern "C" void +cygheap_profthr_all (void (*profthr_byhandl

Re: [PATCH] gprof profiling of multi-threaded Cygwin programs, ver 2

2016-02-25 Thread Mark Geisert
On Tue, 23 Feb 2016, Corinna Vinschen wrote: On Feb 22 23:36, Mark Geisert wrote: On Mon, 22 Feb 2016, Jon Turney wrote: There doesn't seem to be anything specific to profiling about this, so it could be written in a more generic way, as "call a callback function for each thread"

[PATCH] Support profiling of multi-threaded apps.

2016-03-09 Thread Mark Geisert
(profile_ctl): Call pthread_atfork() to set profile_child callback. Thanks, ..mark From 56b79572a654293e940a03d016833f07157dbef1 Mon Sep 17 00:00:00 2001 From: Mark Geisert Date: Fri, 19 Feb 2016 22:58:31 -0800 Subject: [PATCH] Support profiling of multi-threaded apps. This patch set modifies Cygwin

Re: [PATCH] Support profiling of multi-threaded apps.

2016-03-09 Thread Mark Geisert
On Wed, 9 Mar 2016, Corinna Vinschen wrote: Hi Mark, On Mar 9 00:39, Mark Geisert wrote: This is Version 3 incorporating review comments of Version 2. This is just the code patch; a separate doc patch is forthcoming. The patch looks fine to me code-wise. I just have a few style requests

Re: [PATCH] Support profiling of multi-threaded apps.

2016-03-10 Thread Mark Geisert
(profile_ctl): Call pthread_atfork() to set profile_child callback. Thank you, ..mark >From e65fb126be97090f92e9ee919a87116feaaffa49 Mon Sep 17 00:00:00 2001 From: Mark Geisert Date: Fri, 19 Feb 2016 22:58:31 -0800 Subject: [PATCH] Support profiling of multi-threaded apps. This patch set modi

Re: [PATCH] Support profiling of multi-threaded apps.

2016-03-10 Thread Mark Geisert
On Thu, 10 Mar 2016, Corinna Vinschen wrote: On Mar 10 10:39, Corinna Vinschen wrote: On Mar 10 00:35, Mark Geisert wrote: This is Version 4 incorporating review comments of Version 3. This is just the code patch; a separate doc patch is forthcoming. Uhm... + long divisor

[PATCH] Documentation covering profiling Cygwin programs.

2016-03-11 Thread Mark Geisert
This patch set updates the Cygwin User's Guide to say something about profiling. Existing winsup/doc files programming.xml and setup-env.xml are updated. A new winsup/doc file gprof.xml is added. I'd appreciate any comments y'all may have on formatting and/or content. Thanks muc

Re: Fwd: [PATCH] spinlock spin with pause instruction

2016-03-11 Thread Mark Geisert
s a patch to do this. I wanted to try out this patch but compilation is failing on the "unlikely" call. Is that a macro that needs defining or something else? Thanks, ..mark

Remove "function" from line to avoid dash objecting to this bash-ism

2017-04-05 Thread Mark Geisert
FWIW using dash instead of bash has the build running 5%-10% faster. Cheers, ..mark From fb9db7a75c7e391f451cb1df3c1e8463ef4c7bf3 Mon Sep 17 00:00:00 2001 From: Mark Geisert Date: Wed, 5 Apr 2017 22:20:09 -0700 Subject: [PATCH] Remove "function" from line to avoid dash objecting to thi

[PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-11-27 Thread Mark Geisert
--- winsup/cygwin/fhandler_disk_file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 5dfcae4d9..2ead9948c 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_f

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-11-28 Thread Mark Geisert
Mark Geisert wrote: --- winsup/cygwin/fhandler_disk_file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 5dfcae4d9..2ead9948c 100644 [...] Oops, I neglected to include an explanatory

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-11-28 Thread Mark Geisert
Corinna Vinschen wrote: On Nov 28 00:03, Mark Geisert wrote: Mark Geisert wrote: --- winsup/cygwin/fhandler_disk_file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 5dfcae4d9

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-11-29 Thread Mark Geisert
Corinna Vinschen wrote: On Nov 28 02:28, Mark Geisert wrote: Corinna Vinschen wrote: On Nov 28 00:03, Mark Geisert wrote: Mark Geisert wrote: --- winsup/cygwin/fhandler_disk_file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_disk_file.cc

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-11-29 Thread Mark Geisert
lieve it?". Perhaps y'all know this idiom already but it was only while contemplating a cerveza that I realized it might have come across badly. Cheers & Regards, ..mark

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-11-30 Thread Mark Geisert
n written twice: once by the late-finishing pwrite and again by the recovery code. A blocking pwrite() (i.e., not overlapped or async in any way) has to wait for the underlying NtWriteFile() to complete in order to get a correct write count and/or correct final status code, doesn't

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-12-01 Thread Mark Geisert
On Thu, 30 Nov 2017, Corinna Vinschen wrote: On Nov 30 01:50, Mark Geisert wrote: Yes, I believe that's correct. But in my aio implementation for Cygwin, I'm not using overlapped I/O or any kind of async or nonblocking write. I'm using separate threads to do plain vanilla block

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-12-01 Thread Mark Geisert
On Fri, 1 Dec 2017, Corinna Vinschen wrote: On Dec 1 10:30, Corinna Vinschen wrote: On Dec 1 00:44, Mark Geisert wrote: [...] I'd better take this info back to "the lab" and do some more digging. Thanks very much for these details and your earlier repli

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-12-02 Thread Mark Geisert
On Sat, 2 Dec 2017, Corinna Vinschen wrote: On Dec 1 13:46, Mark Geisert wrote: I'm open to using overlapped I/O for the usual read & write cases of aio but there are some extensions I have in mind that don't allow for overlapped so I think I need to have threads handle them. I

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite

2017-12-11 Thread Mark Geisert
Just closing out this email thread... On Fri, 1 Dec 2017, Mark Geisert wrote: On Fri, 1 Dec 2017, Corinna Vinschen wrote: On Dec 1 10:30, Corinna Vinschen wrote: On Dec 1 00:44, Mark Geisert wrote: And then pwrite() creates its own handle (or reuses one (!)) to avoid messing up the seek

[PATCH] Implement sigtimedwait

2017-12-13 Thread Mark Geisert
Abstract out common code from sigwait/sigwaitinfo/sigtimedwait to implement the latter. --- winsup/cygwin/common.din | 1 + winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/signal.cc| 32 ++-- winsup/cygwin/thread.cc

[PATCH] Implement sigtimedwait (revised)

2017-12-14 Thread Mark Geisert
Abstract out common code from sigwait/sigwaitinfo/sigtimedwait to implement the latter. --- winsup/cygwin/common.din | 1 + winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/signal.cc| 36 -- winsup/cygwin/thread.cc

Re: [PATCH] Implement sigtimedwait

2017-12-14 Thread Mark Geisert
On Thu, 14 Dec 2017, Corinna Vinschen wrote: Hi Mark, Thanks for sigtimedwait! Two questions: On Dec 13 22:54, Mark Geisert wrote: diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 69c5e2aad..0599d8a3e 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc

Re: [PATCH] Implement sigtimedwait (revised)

2017-12-18 Thread Mark Geisert
On Mon, 18 Dec 2017, Corinna Vinschen wrote: Hi Mark, [...] as I wrote on Friday, the patch looks good to me. I just need a contributors license agreement from you per the "Before you get started" section on https://cygwin.com/contrib.html Hi Corinna, Y'all should have one

[PATCH] cygwin_internal methods to get/set thread name

2017-12-20 Thread Mark Geisert
Add support to cygwin_internal() for setting a cygthread name and getting or setting a pthread name. Also add support for getting the internal i/o handle for a given file descriptor. --- winsup/cygwin/cygthread.cc | 40 +++-- winsup/cygwin/cygthread.h

Re: [PATCH] cygwin_internal methods to get/set thread name

2017-12-21 Thread Mark Geisert
On Wed, 20 Dec 2017, Corinna Vinschen wrote: Hi Mark, A lot to discuss here. Yes, but first let me say I'd call these "speculative" patches, things I found necessary during aio library development. I had an incorrect mental picture of the Cygwin DLL: I was treating it as ju

Re: [PATCH] cygwin_internal methods to get/set thread name

2017-12-22 Thread Mark Geisert
On Thu, 21 Dec 2017, Corinna Vinschen wrote: On Dec 21 00:29, Mark Geisert wrote: On Wed, 20 Dec 2017, Corinna Vinschen wrote: Hi Mark, A lot to discuss here. Yes, but first let me say I'd call these "speculative" patches, things I found necessary during aio library develop

[PATCH] Define internal function mythreadname() This new function returns the name of the calling thread; works for both cygthreads and pthreads. All calls to cygthread::name(/*void*/) replaced by cal

2018-01-22 Thread Mark Geisert
--- winsup/cygwin/exceptions.cc | 4 ++-- winsup/cygwin/fhandler_tty.cc | 2 +- winsup/cygwin/strace.cc | 2 +- winsup/cygwin/thread.cc | 17 + winsup/cygwin/thread.h| 3 +++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/exc

[PATCH] Define internal function mythreadname()

2018-01-22 Thread Mark Geisert
This new function returns the name of the calling thread; works for both cygthreads and pthreads. All calls to cygthread::name(/*void*/) replaced by calls to mythreadname(/*void*/). --- winsup/cygwin/exceptions.cc | 4 ++-- winsup/cygwin/fhandler_tty.cc | 2 +- winsup/cygwin/strace.cc

[PATCH] Define internal function mythreadname() -- revised

2018-01-24 Thread Mark Geisert
This new function returns the name of the calling thread; works for both cygthreads and pthreads. All calls to cygthread::name(/*void*/) replaced by calls to mythreadname(/*void*/). --- winsup/cygwin/exceptions.cc | 4 ++-- winsup/cygwin/fhandler_tty.cc | 2 +- winsup/cygwin/strace.cc

Re: [PATCH] doc/ntsec.xml: Fix typo

2018-02-22 Thread Mark Geisert
atch' followed by 'git send-email'. With cheers and understanding, ..mark

[PATCH] Posix asynchronous I/O support, part 1

2018-03-28 Thread Mark Geisert
--- winsup/cygwin/Makefile.in | 1 + winsup/cygwin/common.din | 8 winsup/cygwin/include/cygwin/version.h | 4 +++- winsup/cygwin/include/limits.h | 12 ++-- winsup/doc/posix.xml | 16 5 files changed, 26 ins

[PATCH] Posix asynchronous I/O support, part 2

2018-03-28 Thread Mark Geisert
--- winsup/cygwin/include/aio.h | 78 + 1 file changed, 78 insertions(+) create mode 100644 winsup/cygwin/include/aio.h diff --git a/winsup/cygwin/include/aio.h b/winsup/cygwin/include/aio.h new file mode 100644 index 0..d6ca56517 --- /dev/null

[PATCH] Posix asynchronous I/O support, part 3

2018-03-28 Thread Mark Geisert
amp;workcrit); + if (!worklisthd) +{ + /* another aioworker picked up the work already */ + LeaveCriticalSection (&workcrit); + continue; +} + + aio = dequeue (worklisthd); + LeaveCriticalSection (&workcrit); + +#ifdef AIODEBUG +

[PATCH v2 1/2] Posix asynchronous I/O support: fhandler files

2018-04-19 Thread Mark Geisert
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. T

[PATCH v2 0/3] Posix asynchronous I/O support

2018-04-19 Thread Mark Geisert
only deals with disk files at present. I'd say the whole thing is 90% complete. I will address testing on the developers list shortly. Thanks & Regards, ..mark

[PATCH v2 1/3] Posix asynchronous I/O support: aio files

2018-04-19 Thread Mark Geisert
ad|write. Should we require aio_offset to be zero? + //XXX Or ignore aio_offset? Or manually seek/op/reseek on seekable fds? + //XXX [time passes for testing] + //XXX Crap! Must seek/op/reseek or all the writes append to the file! + //XXX Or turn these back into pre

[PATCH v2 3/3] Posix asynchronous I/O support: other files

2018-04-19 Thread Mark Geisert
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. This is the 2nd WIP patch set for AIO. The string XXX marks issues I'm specifically requesti

Re: [PATCH v2 1/3] Posix asynchronous I/O support: aio files

2018-05-02 Thread Mark Geisert
ys/signal.h defines that should be changed, given that Posix doesn't specify values but only the names of the values. And the winsup* enum values are the ones used internally so should likely not be changed. Does this sound like the right way to go? Thanks, ..mark

Re: [PATCH v2 1/3] Posix asynchronous I/O support: aio files

2018-05-14 Thread Mark Geisert
On Wed, 2 May 2018, Brian Inglis wrote: On 2018-05-02 02:21, Mark Geisert wrote: I found a discrepancy in the Cygwin source tree and would like input on how to resolve it... On Thu, 19 Apr 2018, Corinna Vinschen wrote: +static void +aionotify (struct aiocb *aio) +{ +  /* if signal notification

[PATCH v3 0/3] POSIX Asynchronous I/O support

2018-07-15 Thread Mark Geisert
This is intended to be the final patch set implementing POSIX AIO. The string XXX marks issues I'm specifically requesting comments on. I think there are only two of these XXXs left, both in aio.cc. Questions, comments, or suggestions are all welcome. Thanks & Regards, ..mark

[PATCH v3 2/3] POSIX Asynchronous I/O support: fhandler files

2018-07-15 Thread Mark Geisert
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. T

[PATCH v3 3/3] POSIX Asynchronous I/O support: other files

2018-07-15 Thread Mark Geisert
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. --- winsup/cygwin/Makefile.in | 1 + winsup/cygwin/common.din |

[PATCH v3 1/3] POSIX Asynchronous I/O support: aio files

2018-07-15 Thread Mark Geisert
ksem); +} +} +} + +static int +asyncread (struct aiocb *aio) +{ /* Try to initiate an asynchronous read, either from app or worker thread */ + ssize_t res = 0; + + cygheap_fdget cfd (aio->aio_fildes); + if (cfd < 0) +res = -1; /* errno has been set to EBADF

Re: [PATCH v3 1/3] POSIX Asynchronous I/O support: aio files

2018-07-17 Thread Mark Geisert
Corinna Vinschen wrote: Hi Mark, this looks good. Inline comments as usual. Thank you; OK. On Jul 15 01:20, Mark Geisert wrote: [...] +static int +aiochkslot (struct aiocb *aio) +{ + /* Sanity check.. make sure this AIO is not already busy */ + for (int slot = 0; slot < AIO_MAX; ++s

Re: [PATCH v3 2/3] POSIX Asynchronous I/O support: fhandler files

2018-07-17 Thread Mark Geisert
Corinna Vinschen wrote: On Jul 15 01:20, Mark Geisert wrote: + if (aio) + status = NtReadFile (prw_handle, aiocb->aio_win_event, NULL, NULL, +&aiocb->aio_win_iosb, buf, count, &off, NULL); + else + status = NtReadFile (prw_hand

Re: [PATCH v3 1/3] POSIX Asynchronous I/O support: aio files

2018-07-17 Thread Mark Geisert
Corinna Vinschen wrote: Hey Mark, I just belatedly noticed a few problems in aiosuspend: On Jul 15 01:20, Mark Geisert wrote: +static int +aiosuspend (const struct aiocb *const aiolist[], + int nent, const struct timespec *timeout) +{ + /* Returns lowest list index of completed aios

Re: [PATCH v3 1/3] POSIX Asynchronous I/O support: aio files

2018-07-18 Thread Mark Geisert
Corinna Vinschen wrote: Mark, I think there's a bug in sigtimedwait. I just found the problem while looking into this aio_suspend stuff: On Jul 17 16:51, Corinna Vinschen wrote: + res = sigtimedwait (&sigmask, &si, to); You're giving the timeout value verbatim to sigt

[PATCH] fix duration handling in sigtimedwait

2018-07-19 Thread Mark Geisert
--- winsup/cygwin/signal.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index e581d28da..de3e88697 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -640,6 +640,8 @@ sigtimedwait (const sigset_t *set, siginfo_t *info,

[PATCH v4 1/2] POSIX Asynchronous I/O support: aio files

2018-07-20 Thread Mark Geisert
worksem); +} +} +} + +static int +asyncread (struct aiocb *aio) +{ /* Try to initiate an asynchronous read, either from app or worker thread */ + ssize_t res = 0; + + cygheap_fdget cfd (aio->aio_fildes); + if (cfd < 0) +res = -1; /* errno has been set to EBADF */ + else +{ + int slot = aio

[PATCH v4 2/2] POSIX Asynchronous I/O support: fhandler files

2018-07-20 Thread Mark Geisert
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. T

Re: [PATCH v4 1/2] POSIX Asynchronous I/O support: aio files

2018-07-23 Thread Mark Geisert
Corinna Vinschen wrote: Hi Mark, there's just one problem left: [...] + + QueryUnbiasedInterruptTime (&time0); Nice idea to use QueryUnbiasedInterruptTime. The problem here is just that QueryUnbiasedInterruptTime has been introduced with Windows 7, but we still support Wind

[PATCH final] POSIX Asynchronous I/O support

2018-07-23 Thread Mark Geisert
. It's time to open it up for wider usage. Thanks & Regards, ..mark

[PATCH final 3/3] POSIX Asynchronous I/O support: other files

2018-07-23 Thread Mark Geisert
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. --- winsup/cygwin/Makefile.in | 1 + winsup/cygwin/common.din |

[PATCH final 2/3] POSIX Asynchronous I/O support: fhandler files

2018-07-23 Thread Mark Geisert
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. T

[PATCH final] POSIX Asynchronous I/O support

2018-07-23 Thread Mark Geisert
spot-check programs, as well as with iozone for stress testing. It's time to open it up for wider usage. Thanks & Regards, ..mark

[PATCH final 1/3] POSIX Asynchronous I/O support: aio files

2018-07-23 Thread Mark Geisert
ost (&worksem); +} +} +} + +static int +asyncread (struct aiocb *aio) +{ /* Try to initiate an asynchronous read, either from app or worker thread */ + ssize_t res = 0; + + cygheap_fdget cfd (aio->aio_fildes); + if (cfd < 0) +res = -1; /* errno has been set to EBADF */ + else +

Re: [PATCH final] POSIX Asynchronous I/O support

2018-07-24 Thread Mark Geisert
ld be helpful. Source could go to cygwin-developers and/or I could host both source and exes on my GitHub space. Let me know. ..mark

Re: [PATCH 0/1] Update _PC_ASYNC_IO return value

2018-07-26 Thread Mark Geisert
terms of _PC_ASYNC_IO, the test might be a bit tricky let me check actually, no it's easy Mark implemented the stuff with pread/pwrite only on disk files but otherwise it's device independent in that he implemented a workaround for pipes and stuff so, in theory we can jus

[PATCH] Fix return value on aio_read/write success

2018-08-04 Thread Mark Geisert
Oops. Something that iozone testing had found but I regarded as an iozone bug. Re-reading the man pages set me straight. --- winsup/cygwin/aio.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/aio.cc b/winsup/cygwin/aio.cc index fe63dec04..571a9621b 100644 -

Re: [PATCH] Fix return value on aio_read/write success

2018-08-04 Thread Mark Geisert
Corinna Vinschen wrote: On Aug 4 01:44, Mark Geisert wrote: Oops. Something that iozone testing had found but I regarded as an iozone bug. Re-reading the man pages set me straight. --- winsup/cygwin/aio.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin

[PATCH v2] Fix return value on aio_read/write success

2018-08-06 Thread Mark Geisert
Internally track resultant byte counts as ssize_t, but return 0 as int for success indication, per POSIX. --- winsup/cygwin/aio.cc | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/aio.cc b/winsup/cygwin/aio.cc index fe63dec04..7d5d98299 100644 --- a/winsup/

[PATCH] fix version typo

2018-11-30 Thread Mark Geisert
--- winsup/doc/new-features.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index e3786e545..7cc449764 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -4,7 +4,7 @@ What's new and what

[PATCH] Implement sched_[gs]etaffinity()

2019-04-10 Thread Mark Geisert
--- newlib/libc/include/sched.h | 4 +++ winsup/cygwin/sched.cc | 68 + 2 files changed, 72 insertions(+) diff --git a/newlib/libc/include/sched.h b/newlib/libc/include/sched.h index 1016235bb..e3a5b97e5 100644 --- a/newlib/libc/include/sched.h +++ b/newl

[PATCH v2] Cygwin: Implement sched_[gs]etaffinity()

2019-04-28 Thread Mark Geisert
There are a couple of multi-group affinity operations that cannot be done without heroic measures. Those are marked with XXX in the code. Further discussion would be helpful to me. --- newlib/libc/include/sched.h | 13 ++ winsup/cygwin/common.din| 4 + winsup/cygwin/include/pthre

Re: [PATCH v2] Cygwin: Implement sched_[gs]etaffinity()

2019-04-29 Thread Mark Geisert
Corinna Vinschen wrote: Hi Mark, Howdy! FTR Here's the intro paragraph left out of my patch submission: Second version of CPU affinity patch set. Attempts to mimic operation of Linux affinity functions, both the sched_* and pthread_* varieties. This v2 version assumes Windows proc

[PATCH v3] Cygwin: Implement sched_[gs]etaffinity()

2019-06-23 Thread Mark Geisert
This patch set implements the Linux syscalls sched_getaffinity, sched_setaffinity, pthread_getaffinity_np, and pthread_setaffinity_np. Linux has a straightforward view of the cpu sets used in affinity masks. They are simply long (1024-bit) bit masks. This code emulates that view while internally d

[PATCH] Cygwin: Fix return value of sched_getaffinity

2019-06-24 Thread Mark Geisert
Return what the documentation says, instead of a misreading of it. --- winsup/cygwin/sched.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc index e7b44d319..8f24bf80d 100644 --- a/winsup/cygwin/sched.cc +++ b/winsup/cygwin/sched

[PATCH] Cygwin: Build cygwin-console-helper with correct compiler

2019-06-25 Thread Mark Geisert
--- winsup/utils/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index b64f457e7..cebf39572 100644 --- a/winsup/utils/Makefile.in +++ b/winsup/utils/Makefile.in @@ -64,7 +64,7 @@ MINGW_BINS := ${addsuffix .exe,cygc

Re: [PATCH] Cygwin: Fix return value of sched_getaffinity

2019-06-25 Thread Mark Geisert
Corinna Vinschen wrote: Hi Mark, On Jun 24 22:25, Mark Geisert wrote: Return what the documentation says, instead of a misreading of it. --- winsup/cygwin/sched.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc index

[PATCH v2] Fix return value of sched_getaffinity

2019-06-26 Thread Mark Geisert
Have sched_getaffinity() interface like glibc's, and provide an undocumented internal interface __sched_getaffinity_sys() like the Linux kernel's sched_getaffinity() for benefit of taskset(1). --- newlib/libc/include/sched.h| 1 + winsup/cygwin/common.din | 1 + winsup

Re: [PATCH] Cygwin: Build cygwin-console-helper with correct compiler

2019-06-26 Thread Mark Geisert
Corinna Vinschen wrote: On Jun 25 00:54, Mark Geisert wrote: --- winsup/utils/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index b64f457e7..cebf39572 100644 --- a/winsup/utils/Makefile.in +++ b/winsup

[PATCH v3] Cygwin: Fix return value of sched_getaffinity

2019-06-26 Thread Mark Geisert
Have sched_getaffinity() interface like glibc's, and provide an undocumented internal interface __sched_getaffinity_sys() like the Linux kernel's sched_getaffinity() for benefit of taskset(1). --- newlib/libc/include/sched.h| 3 +++ winsup/cygwin/common.din | 1 + wins

[PATCH] Cygwin: Use correct string conversion

2019-06-26 Thread Mark Geisert
Correct the string conversion calls so both argv elements get converted at full precision. --- winsup/utils/cygwin-console-helper.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/utils/cygwin-console-helper.cc b/winsup/utils/cygwin-console-helper.cc index 8f62ed7e

Re: [PATCH] Cygwin: Build cygwin-console-helper with correct compiler

2019-06-26 Thread Mark Geisert
Corinna Vinschen wrote: On Jun 26 01:48, Mark Geisert wrote: Corinna Vinschen wrote: On Jun 25 00:54, Mark Geisert wrote: --- winsup/utils/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index b64f457e7

[PATCH] Cygwin: Implement CPU_SET(3) macros

2019-06-30 Thread Mark Geisert
This patch supplies an implementation of the CPU_SET(3) processor affinity macros as documented on the relevant Linux man page. --- winsup/cygwin/include/sys/cpuset.h | 62 +++--- winsup/cygwin/sched.cc | 8 ++-- 2 files changed, 60 insertions(+), 10 deletions(

Re: [PATCH] Cygwin: Implement CPU_SET(3) macros

2019-07-01 Thread Mark Geisert
Corinna Vinschen wrote: Hi Mark, On Jun 30 15:59, Mark Geisert wrote: This patch supplies an implementation of the CPU_SET(3) processor affinity macros as documented on the relevant Linux man page. --- winsup/cygwin/include/sys/cpuset.h | 62 +++--- winsup/cygwin

Re: [PATCH] Cygwin: Implement CPU_SET(3) macros

2019-07-25 Thread Mark Geisert
Corinna Vinschen wrote: Hi Mark, On Jul 1 01:55, Mark Geisert wrote: Corinna Vinschen wrote: On Jun 30 15:59, Mark Geisert wrote: This patch supplies an implementation of the CPU_SET(3) processor affinity macros as documented on the relevant Linux man page. --- winsup/cygwin/include/sys

Re: [PATCH] Cygwin: Implement CPU_SET(3) macros

2019-07-30 Thread Mark Geisert
On Fri, 26 Jul 2019, Corinna Vinschen wrote: On Jul 25 14:15, Mark Geisert wrote: Corinna Vinschen wrote: Hi Mark, On Jul 1 01:55, Mark Geisert wrote: Corinna Vinschen wrote: On Jun 30 15:59, Mark Geisert wrote: This patch supplies an implementation of the CPU_SET(3) processor affinity

[PATCH v2] Cygwin: Implement CPU_SET(3) macros

2019-08-04 Thread Mark Geisert
This patch supplies an implementation of the CPU_SET(3) processor affinity macros as documented on the relevant Linux man page. There is a different implementation of cpusets under libc/sys/RTEMS that has FreeBSD compatibility and is built on top of FreeBSD bitsets. This implementation can be com

Re: [PATCH v2] Cygwin: Implement CPU_SET(3) macros

2019-08-04 Thread Mark Geisert
Sorry for the repetition... On Sun, 4 Aug 2019, Mark Geisert wrote: This patch supplies an implementation of the CPU_SET(3) processor affinity macros as documented on the relevant Linux man page. There is a different implementation of cpusets under libc/sys/RTEMS that has FreeBSD compatibility

[PATCH] Cygwin: ldd: Try harder to get dll names

2019-08-14 Thread Mark Geisert
Borrow a trick from strace to lessen occurrences of "??? => ???" in ldd output. Specifically, if the module name isn't found in the usual place in the mapped image, use the file handle we have to look up the name. --- winsup/utils/Makefile.in | 2 +- winsup/utils/ldd.cc | 44 ++

[PATCH] Cygwin: fix CPU_SET macro visibility

2019-09-13 Thread Mark Geisert
The CPU_SET macros defined in Cygwin's include/sys/cpuset.h must not be visible in an application's namespace unless _GNU_SOURCE has been #defined. Internally this means wrapping them in #if __GNU_VISIBLE. --- winsup/cygwin/include/sys/cpuset.h | 3 +++ 1 file changed, 3 insertions(+) diff --gi

[PATCH] Cygwin: Doc change to note stackdump limit patch

2019-11-07 Thread Mark Geisert
--- winsup/cygwin/release/3.1.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/release/3.1.0 b/winsup/cygwin/release/3.1.0 index 1b9d23615..345dd62a5 100644 --- a/winsup/cygwin/release/3.1.0 +++ b/winsup/cygwin/release/3.1.0 @@ -35,6 +35,9 @@ What changed: - Improve /proc/

[PATCH] Cygwin: Raise dumpstack frame limit to 32

2019-11-07 Thread Mark Geisert
Create a #define for the limit and raise it from 16 to 32. --- winsup/cygwin/exceptions.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 132fea427..3e7d7275c 100644 --- a/winsup/cygwin/exceptions.cc +++ b/w

[PATCH] Cygwin: Add missing Linux #define of CPU_SETSIZE

2019-12-22 Thread Mark Geisert
Though our implementation of cpu sets doesn't need it, software from Linux environments expects this definition to be present. It's documented on the Linux CPU_SET(3) man page but was left out due to oversight. Addresses https://cygwin.com/ml/cygwin/2019-12/msg00248.html --- winsup/cygwin/inclu

[Cygwin PATCH 1/9] tzcode resync: Makefile.in

2020-05-13 Thread Mark Geisert
Establish cygwin subdirectory tzcode to hold updates to imported NetBSD files. --- winsup/cygwin/Makefile.in | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index f273ba793..69aa2277e 100644 --- a/winsup/cygwin/Makefi

[Cygwin PATCH 4/9] tzcode resync: localtime.c.patched

2020-05-13 Thread Mark Geisert
Patched copy of NetBSD's localtime.c to hold changes that could not be accomplished in the wrapper file localtime.cc. It is this file that compilation of localtime.cc includes. --- winsup/cygwin/tzcode/localtime.c.patched | 2509 ++ 1 file changed, 2509 insertions(+) create

[Cygwin PATCH 5/9] tzcode resync: localtime.c

2020-05-13 Thread Mark Geisert
Imported NetBSD localtime.c, current as of 2020/05/13, version 1.122. --- winsup/cygwin/tzcode/localtime.c | 2493 ++ 1 file changed, 2493 insertions(+) create mode 100644 winsup/cygwin/tzcode/localtime.c diff --git a/winsup/cygwin/tzcode/localtime.c b/winsup/cygwin/

  1   2   3   >