Web lists-archives.com

Re: [Mingw-users] Missing pread, pwrite




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22/03/17 20:00, Antonio Diaz Diaz wrote:
> This has been asked before, but never answered AFAICT.

Really?  I could find only one reference:
https://sourceforge.net/p/mingw/mailman/mingw-users/thread/20050531173336.404d1004.mingw32@xxxxxxxxxxxxx/

That, (asked in one of those hideous fora which core MinGW developers 
detested, and mostly ignored), seeks advice on where to find pread() 
and pwrite() for MinGW, (which at the time was nowhere, because they 
don't exist within MSVCRT.DLL), or what alternatives might exist; it 
doesn't appear to explicitly ask:

> Please, could pread/pwrite be implemented in MinGW?

There is one reply to that forum posting: it offers a naive, untested, 
and fundamentally broken, (because of the race conditions it exposes), 
implementation for pread(); there is no evidence of any associated 
feature request, or of any actual code submission to MinGW.org, via 
any other channel.

pread() and pwrite() are POSIX.1 functions, implemented only as XSI 
options, prior to their incorporation into the base specification as 
of POSIX.1-2008.  Windows is not a POSIX conforming system, and MinGW 
does not aim to make it so.  At the time of that original posting, in 
2005, when these functions were specified only as XSI options, it is 
most unlikely that any request to support their incorporation into 
MinGW would have been favourably considered by the lead developers 
of that era; even today, when I have a more favourable attitude to 
adoption of POSIX.1 features, without a formal feature request, 
accompanied by a robust implementation, there may be no compelling 
incentive for MinGW developers to pursue this.

> The work is already done.  Hannes Domani implemented his own
> versions of the pread and pwrite functions in order to compile
> plzip on Windows using MinGW.  AFAIK, they have been working
> in plzip without problems for more than 3 years.

An implementation deployed only within the context of one application 
doesn't attest to its suitability for general adoption; in addition to 
a formal feature request[1], with accompanying implementation, we would 
require unit tests, (ideally implemented via autotest), to confirm its 
conformance to POSIX.1-2008, its immunity to race conditions when used 
in conjunction with open(), read(), and write() in distinct threads, 
and its proper handling of associated error conditions.

[1] https://sourceforge.net/p/mingw/bugs/new/  (set Type = "Feature").

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJY09u1AAoJEMCtNsY0flo/lYkQAMGLi1ATiqdrOzscZ3BODAQY
DLwYdahxVvt1tMA7K8dRHgB16BW6XXiYP7ze+m3fvdsySevzJVwfAAHTBKZ5lVG6
CrRj+2l9DB0Sx2wH8YqFGUzGEWvPnTbIRWXbGtfYknvCaON4IO39nzi9ETNXcbkB
FrrGgU02lXfzRkhdRFsUjMuExq7gdjDWM5hIth6jeuEo0ata1iFkMb2z61PAvOs+
XQ9KSufUA6kLYOjJL7CrUzoHu+ZaBCD8fNZUB6V9Ntt0i6jGmUl7xYFPSyhhVz91
YV5MytgOxG6KsR3Xbh6cUJiQhFmoVHwj3IOh/IbBGgbvBhIMZiTKHlWlmuyAVpeh
6DhYiarnUEM1gzXunGr9rcJLNuB3zxDjvtFW4XA3I3z3Nya/4uOeVrZNyNaY79Uf
XZSZTpMKJihoxEsXiddJ9+sOM6eAl192VjILj60rrggRp8o6dssuxYu8DttKbKRL
xPQP5Dn/u7rct35sYMoUqUbDXrrGtRUd4wuLzsxHTiPrRv5iZdewtFzqgP7rRokx
yxi0xiFDSBnlghQKm8XnXa/5/skxtfLRj2X73UsjWgoTuQbS08oQyYTl3LlH2Jhd
cBQaNShrYzs+h5ec/uAXdgrUWQCXb9aRydHO8+j4A2SC+KQaDJhNwYRJU00POmJZ
tAuDLTie1WpRQUwlVoMB
=Z/+T
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe