Dennis de Champeaux | 18 Feb 17:51 2013

Qsort defects (in C-library)

// I hope this is the proper mailing list

Qsort defects

Qsort was described in a 1993 paper by Bentley & McIlroy.

Let me start with the good news.
Someone replaced a 2nd recursive call at the bottom by tail recursion.

Here the bad news.
Someone modified the code with an "improvement", which has seriously
damaged the performance.
The idea of the "improvement" was to keep track of whether during
partitioning a swap had occurred.  If not it was deemed good to call
up insertion sort with:

       if (swap_cnt == 0) {  /* Switch to insertion sort */
        for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
            for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
                 pl -= es)
                swap(pl, pl - es);

This causes qsort to descend in quadratic explosions on around 3% of
the 630 problems of the Bentley-test bench (described in the paper).

The fix: remove this code fragment and remove the stuff involving
(Continue reading)

Yaakov | 17 Feb 11:46 2013

[PATCH 64bit] Fix speclib for x86_64

Attachment (cygwin-speclib-64bit.patch): text/x-patch, 2598 bytes
Yaakov | 15 Feb 09:02 2013

[PATCH 64bit] utils: port dumper to 64bit

I just uploaded cygwin64-libiconv, cygwin64-gettext, and
cygwin64-libbfd to Ports, so that dumper.exe could be built.  It
appears it hasn't been ported yet, so here's a first attempt.  Comments

Yaakov | 15 Feb 03:09 2013

[PATCH 64bit] lsaauth: skip 32bit DLL on 64bit target

Attachment (lsaauth-64bit.patch): text/x-patch, 1020 bytes
Thomas Wolff | 11 Jan 09:33 2013

Console modes: cursor style

The attached patch adds two escape control sequences to the Cygwin Console:

  * Show/Hide Cursor (DECTCEM)
  * Set cursor style (DECSCUSR): block vs. underline cursor, or
    arbitrary size (as an extension, using values > 4)


2013-01-13  Thomas Wolff  <towo <at>>

	* fhandler.h (class dev_console): Flag for expanded control sequence.
	* (char_command): Supporting cursor style modes.

diff -rup sav/fhandler.h ./fhandler.h
--- sav/fhandler.h	2012-10-13 14:34:17.000000000 +0200
+++ ./fhandler.h	2013-01-08 16:02:54.601269200 +0100
 <at>  <at>  -1246,6 +1246,7  <at>  <at>  class dev_console
   unsigned rarg;
   bool saw_question_mark;
   bool saw_greater_than_sign;
+  bool saw_space;
   bool vt100_graphics_mode_G0;
   bool vt100_graphics_mode_G1;
   bool iso_2022_G1;
diff -rup sav/ ./
--- sav/	2012-08-17 17:57:30.000000000 +0200
(Continue reading)

Yaakov (Cygwin/X | 6 Dec 06:20 2012

[PATCH] waitpid(2) WAIT_* macros

WAIT_ANY and WAIT_MYPGRP are defined by glibc[1] as symbolic constants
for special values in the first argument to waitpid(2).  Patch attached.


Attachment (wait-macros.patch): text/x-patch, 634 bytes
Yaakov (Cygwin/X | 21 Nov 11:54 2012

[PATCH] add cfsetspeed

This patchset adds cfsetspeed(3), a BSD extension also available in

Per the description, cfsetspeed() is the equivalent of cfsetospeed() and
cfsetispeed() with the same baud rate.  Patch for winsup/cygwin


Attachment (cygwin-cfsetspeed.patch): text/x-patch, 3424 bytes
Christopher Faylor | 12 Nov 21:02 2012

[WIP] mingw64 related changes to Cygwin configure and other assorted files with departed w32api/mingw

I decided over the weekend to port over configury changes that I made to
Cygwin's now-out-of-date GIT repository.

These changes basically just cleaned up some of the configure scripts
and made it easier to pinpoint where windows headers and libraries come
from by adding a --with-windows-headers and --with-windows-libs options.
However, some of the assumptions made for the git repository weren't
really valid for the CVS repository so there was a fair amount of work

I thought that I'd do this so I could easily get up-and-running with the
MinGW64 stuff but I ran into some problems building things with gentoo's
MinGW64 implementation.  So, I switched to using the files from the
Cygwin release.

As I mentioned in cygwin-developers, getting the most recent version of
mingw64 stuff working required making some changes to some Cygwin source
files.  Most of the changes just involved #undef'ing constants defined
in Windows headers.  Still, I was surprised that these hadn't already
been handled since I thought I was behind the times by still using the
Mingw32 stuff.

Anyway, is a summary of the changes I've made to files is below.  I'll
be doing appropriate ChangeLogs too, of course.  I've also attached the

This is a heads up in case this conflicted materially with any of the
w64 development.

(Continue reading)

Yaakov (Cygwin/X | 5 Nov 03:41 2012

[PATCH] additional sys/termios.h defines

The attached patch adds a few defines to <sys/termios.h> to make it
compatible with Linux and *BSD.


Attachment (ttydefaults.patch): text/x-patch, 1500 bytes
Kai Tietz | 26 Oct 22:13 2012

[patch cygwin]: Rename strechr to strchrnul


this patch replaces strechr by strchrnul symbol-name.  The strchrnul
name is that one also present in new-libc for this function behavior.

2012-10-26  Kai Tietz

	* (quoted): Renamed strechr to strchrnul.
	* (environ_init): Likewise.
	* (aclfromtext32): Likewise.
	* (extract_nt_dom_user): Likewise.
	* (pwdgrp::next_str): Likewise.
	* string.h (strechr): Likewise.

Ok for apply?


RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.434
diff -p -u -r1.434
---	9 Aug 2012 19:58:52 -0000	1.434
+++	26 Oct 2012 20:06:23 -0000
 <at>  <at>  -162,7 +162,7  <at>  <at>  quoted (char *cmd, int winshell)
       char *p;
(Continue reading)

Corinna Vinschen | 24 Oct 15:42 2012

[toplevel patch] Simplify FLAGS_FOR_TARGET for Cygwin

Hi guys,

I just applied the below patch to the sourceware src repo.  The reason
for the patch is that Cygwin won't be using the in-tree mingw and w32api
any longer, but instead it requires an external installation of a
Mingw64 based w32api, and a Mingw64 build environment to build the
native Windows utilities.  Additionally the FLAGS_FOR_TARGET contains
one dir which doesn't contain any libs (winsup) and one dir which doesn't
exist (winsup/include).  The below patch only changes FLAGS_FOR_TARGET

Could somebody with toplevel checkin rights in the gcc repo please apply
this patch there, too?


2012-10-24  Corinna Vinschen  <corinna AT vinschen DOT de>

	* (FLAGS_FOR_TARGET,target=cygwin): Fix for building
	against Mingw64 w32api.
	* configure: Regenerate.

RCS file: /cvs/src/src/,v
retrieving revision 1.176
diff -u -p -r1.176
---	23 Oct 2012 23:02:33 -0000	1.176
+++	24 Oct 2012 13:39:56 -0000
(Continue reading)