[PATCH] D44771: [lit] Test /dev/null support on Windows.

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 22 13:57:50 PDT 2018


amccarth added a comment.

In https://reviews.llvm.org/D44771#1046003, @rnk wrote:

> I have a feeling if you just say `open("NUL", mode)` you will create a file called "NUL" in the cwd. It's not something you can feed to generic filesystem APIs.


No, it won't create a file named NUL.  The special file names are handled at a relatively low level in the Windows stack (below _open).  You would have to use a namespace escape like `\\?\` to avoid having Windows treat your special file name as a regular name.  The special names are: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.


Repository:
  rL LLVM

https://reviews.llvm.org/D44771





More information about the llvm-commits mailing list