Re: [Mingw-users] Missing pread, pwrite
-----BEGIN PGP SIGNED MESSAGE-----
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:
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, 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.
 https://sourceforge.net/p/mingw/bugs/new/ (set Type = "Feature").
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)
-----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
This list observes the Etiquette found at
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: