1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/lib/Support/Unix
Pavel Labath 757587cb21 [Support] Improve readNativeFile(Slice) interface
Summary:
There was a subtle, but pretty important difference between the Slice
and regular versions of this function. The Slice function was
zero-initializing the rest of the buffer when the read syscall returned
less bytes than expected, while the regular function did not.

This patch removes the inconsistency by making both functions *not*
zero-initialize the buffer. The zeroing code is moved to the
MemoryBuffer class, which is currently the only user of this code. This
makes the API more consistent, and the code shorter.

While in there, I also refactor the functions to return the number of
bytes through the regular return value (via Expected<size_t>) instead of
a separate by-ref argument.

Reviewers: aganea, rnk

Subscribers: kristina, Bigcheese, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66471

llvm-svn: 369627
2019-08-22 08:13:30 +00:00
..
COM.inc
DynamicLibrary.inc
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
Path.inc [Support] Improve readNativeFile(Slice) interface 2019-08-22 08:13:30 +00:00
Process.inc [Support] Replace sys::Mutex with their standard equivalents. 2019-08-19 19:49:57 +00:00
Program.inc [Support][NFC] Fix error message for posix_spawn_file_actions_addopen failed call 2019-08-14 18:30:18 +00:00
README.txt
Signals.inc Replace llvm::MutexGuard/UniqueLock with their standard equivalents 2019-08-07 10:57:25 +00:00
Threading.inc [llvm][Support] Provide interface to set thread priorities 2019-04-16 14:32:43 +00:00
ThreadLocal.inc
Unix.h Remove some autoconf references from docs and comments 2019-07-03 09:57:59 +00:00
Watchdog.inc

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.