Mail Archives: cygwin/2012/08/13/15:12:40
--------------enigC4011383DCFF71FC938CCD3F
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On 8/13/12 11:56 AM, Christopher Faylor wrote:
> On Mon, Aug 13, 2012 at 07:56:52PM +0200, Pawel Jasinski wrote:
>> hi guys,
>>
>> is that what we talking about (see patch below)?
>=20
> Thanks for the patch but I wasn't looking for a simple patch to do this.
> I said I'd make the change if someone could suggest a better errno.
>=20
> When I suggested a patch, it was to somehow change the way Cygwin
> reported errors so that Windows errors could be exposed to programs that
> aren't expecting them. I was willing to look at an implementation if
> someone was going to take the time to add the non-trivial amount of code
> this would take.
I like the way the Windows CRT solves this problem. It provides a
traditional errno with the traditionally restricted set of error
codes, but also provides something called "_doserrno" that holds the
OS-level error code that generated the last errno. If Cygwin were to
provide a similar facility, Someone could patch high-visibility
programs like bash so that they'd display the Windows-level
information instead of the familiar strerror(errno) message. Granted,
not all errno-errors come from Win32 errors, so to avoid confusion,
you'd want to set _doserrno to zero every time you set errno, then (in
select places inside Cygwin) set _doserrno.
Looking at the bash code, I think the change there would involve
mechanically replacing all the uses of strerror (errno) with some
xstrerror (errno, _doserrno), and having xstrerror do the right thing.
--------------enigC4011383DCFF71FC938CCD3F
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org
iEYEARECAAYFAlApUYkACgkQ17c2LVA10VsMiQCdG2W3bbbcCNpmznFhbSN+YVUO
51AAoOmotei3cdpJ1f7j1udgM8xbSI9Y
=zLBT
-----END PGP SIGNATURE-----
--------------enigC4011383DCFF71FC938CCD3F--
- Raw text -