[patch] Split openFileForWrite into windows and unix versions

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Jul 19 05:36:19 PDT 2013


> If the caller wants to append, will this still cause appends to
> happen?  Or should we specify _O_APPEND here too?  Which brings up a
> similar question for the reading version of this API -- should we
> specify _O_RDONLY for that one?

* I added a test for append (test/MC/AsmParser/secure_log_unique.s)
and yes, we need  _O_APPEND. A new patch is attached.
* It looks like open in the crt uses  FILE_SHARE_READ |
FILE_SHARE_WRITE, so it is probably best to start with that.
* It looks like  _O_RDONLY is not used by _open_osfhandle. Open uses
it to decide if it should use GENERIC_WRITE, GENERIC_READ or both, but
_open_osfhandle gets an open file handle.
* I added the test for F_Binary, and it changes the output of (for
example) llc to use windows format. It would be really nice to add a
test for it. Any suggestion how to check for Carriage return in the
output?

> ~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 4991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130719/8501b0eb/attachment.obj>


More information about the llvm-commits mailing list