llvm-project/llvm/lib/Support/Unix
Jordan Rose 887d31ccee FileSystem: Check for DTTOIF alone, not _DIRENT_HAVE_D_TYPE
While 'd_type' is a non-standard extension to `struct dirent`, only
glibc signals its presence with a macro '_DIRENT_HAVE_D_TYPE'.
However, any platform with 'd_type' also includes a way to convert to
mode_t values using the macro 'DTTOIF', so we can check for that alone
and still be confident that the 'd_type' member exists.

(If this turns out to be wrong, I'll go back and set up an actual
CMake check.)

I couldn't think of how to write a test for this, because I couldn't
think of how to test that a 'stat' call doesn't happen without
controlling the filesystem or intercepting 'stat', and there's no good
cross-platform way to do that that I know of.

Follow-up (almost a year later) to r342089.

rdar://problem/50592673
https://reviews.llvm.org/D64940

llvm-svn: 366486
2019-07-18 20:05:11 +00:00
..
COM.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DynamicLibrary.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Host.inc Use AIX version detection at LLVM run-time 2019-03-13 00:12:43 +00:00
Memory.inc [PowerPC] Set PROT_READ flag for MF_EXEC to prevent segfaults on PPC machines 2019-06-03 16:20:59 +00:00
Mutex.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Path.inc FileSystem: Check for DTTOIF alone, not _DIRENT_HAVE_D_TYPE 2019-07-18 20:05:11 +00:00
Process.inc Fixes for builds that require strict X/Open and POSIX compatiblity 2019-05-16 14:02:13 +00:00
Program.inc posix_spawn should retry upon EINTR 2019-04-24 23:24:53 +00:00
README.txt
RWMutex.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Signals.inc Support for dumping current PrettyStackTrace on SIGINFO (Ctrl-T) 2019-07-12 16:05:09 +00:00
ThreadLocal.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Threading.inc [llvm][Support] Provide interface to set thread priorities 2019-04-16 14:32:43 +00:00
Unix.h Remove some autoconf references from docs and comments 2019-07-03 09:57:59 +00:00
Watchdog.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00

README.txt

llvm/lib/Support/Unix README
===========================

This directory provides implementations of the lib/System classes that
are common to two or more variants of UNIX. For example, the directory
structure underneath this directory could look like this:

Unix           - only code that is truly generic to all UNIX platforms
  Posix        - code that is specific to Posix variants of UNIX
  SUS          - code that is specific to the Single Unix Specification
  SysV         - code that is specific to System V variants of UNIX

As a rule, only those directories actually needing to be created should be
created. Also, further subdirectories could be created to reflect versions of
the various standards. For example, under SUS there could be v1, v2, and v3
subdirectories to reflect the three major versions of SUS.