summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
Commit message (Collapse)AuthorAgeFilesLines
...
* Make the removal of files use Path::eraseFromDisk just like it does forReid Spencer2006-08-071-4/+5
| | | | | | | | | | | the removal of directories. Using std::remove is indiscriminate and can lead to the removal of things like /dev/null if run as root. The Path::eraseFromDisk method ensures that we only ever remove regular files or directories, but never character or block special nodes. This should clear up the problem with usage like: llvm-as -o /dev/null which is used in the llvm-test makefiles. llvm-svn: 29540
* Add a note about how the "isFile" check in Path::eraseFromDisk preventsReid Spencer2006-08-071-0/+5
| | | | | | the erasure of non-file paths like /dev/null. llvm-svn: 29539
* Remove some now-dead methods. Use getFileStatus instead.Chris Lattner2006-08-011-34/+0
| | | | llvm-svn: 29447
* Use getFileStatus instead of Path::isDirectory().Chris Lattner2006-08-011-7/+6
| | | | llvm-svn: 29443
* elimiante some syscallsChris Lattner2006-08-011-15/+12
| | | | llvm-svn: 29442
* Modify setStatusInfoOnDisk to not throw an exception.Chris Lattner2006-07-281-4/+4
| | | | llvm-svn: 29402
* Modify Path::eraseFromDisk to not throw an exception.Chris Lattner2006-07-281-24/+29
| | | | llvm-svn: 29400
* Change Path::getStatusInfo to return a boolean and error string on an errorChris Lattner2006-07-281-15/+15
| | | | | | | | instead of throwing an exception. This reduces the amount of code that is exposed to exceptions (e.g. FileUtilities), though it is clearly only one step along the way. llvm-svn: 29395
* simple optimization: don't bother calling "exists" (which calls the syscallChris Lattner2006-07-181-3/+0
| | | | | | | "access"). Instead, just let the open call fail if the file doesn't exist. This reduces the # syscalls executed. llvm-svn: 29173
* Remove a dead conditional: info_ can only be allocated if FD is good. ImproveChris Lattner2006-07-181-5/+4
| | | | | | spacing llvm-svn: 29172
* The only entry in the stat buf this code cares about is the size. Keep justChris Lattner2006-07-181-14/+14
| | | | | | the size, not the whole stat buffer. llvm-svn: 29171
* Reduce code in the error path by only allocating info_ if everything looksChris Lattner2006-07-181-10/+8
| | | | | | good. llvm-svn: 29170
* Unindent some codeChris Lattner2006-07-181-25/+24
| | | | llvm-svn: 29169
* Turn an if into an else if.Chris Lattner2006-07-121-2/+2
| | | | llvm-svn: 29129
* no need to do a stat then an lstat. lstat will tell us if normal files ↵Chris Lattner2006-07-071-7/+4
| | | | | | don't exist. llvm-svn: 29068
* Change AllocateRWX/DeallocateRWX to not throw an exception.Chris Lattner2006-07-072-31/+61
| | | | llvm-svn: 29058
* Only print the stack trace if it was requested. Previously, any call intoReid Spencer2006-06-161-1/+5
| | | | | | | | the Signals module that registered the handlers would cause the stack trace to be generated. Now, you must explicitly call PrintStackTraceOnErrorSignal in order for that to happen. llvm-svn: 28810
* Don't pull in environ, not always safe. Global variables are bad anyway.Evan Cheng2006-06-091-8/+4
| | | | | | | Use execve when explicit environment variables ptr is available. Otherwise just use execv. llvm-svn: 28740
* For PR787:Reid Spencer2006-06-071-0/+8
| | | | | | | | | | | | Provide new llvm::sys::Program facilities for converting the stdout and stdin to binary mode. There is no standard way to do this and the available mechanisms are platform specific. Adjust the bytecode reader and writer to use these methods when their input is stdin or output is stdout. THis avoids the problem with \n writing CRLF to a bytecode file on windows. Patch Contributed by Michael Smith. llvm-svn: 28722
* This function is not documented as throwing an exception and callers don'tChris Lattner2006-05-141-3/+1
| | | | | | handle it. Just silently fail. llvm-svn: 28291
* Fix accidentally committed patch.Chris Lattner2006-05-121-1/+1
| | | | llvm-svn: 28260
* Fix iterator invalidation bug, identified by Coverity.Chris Lattner2006-05-121-1/+1
| | | | llvm-svn: 28257
* For PR351:Reid Spencer2005-12-221-7/+12
| | | | | | | | * Allow the ExecuteAndWait to return negative values if a signal is detected as the reason for the child termination. This is needed to support bugpoint detecting bad things in its child processes. llvm-svn: 24960
* Implement a generic polled Alarm function. This merely removes the systemReid Spencer2005-12-221-0/+68
| | | | | | | dependent portion of the lib/Support/SlowOperationTimer code into the lib/System implementation where it can be ported to different platforms. llvm-svn: 24937
* instead of using mstats, use malloc_zone_statistics which returns numbersChris Lattner2005-11-141-4/+8
| | | | | | that actually make sense. llvm-svn: 24352
* Teach -track-memory to work on darwin. Looking at sbrk doesn't work becauseChris Lattner2005-11-141-10/+12
| | | | | | the default allocator uses mmap. llvm-svn: 24349
* Implement sys::SetInterruptFunction on Unix, stub it on win32 so that theChris Lattner2005-08-021-2/+18
| | | | | | build will not fail llvm-svn: 22578
* support near allocations for the JITAndrew Lenharth2005-07-291-3/+9
| | | | llvm-svn: 22554
* Fix a problem in getDirectoryContents where sub-directory names wereReid Spencer2005-07-281-6/+14
| | | | | | | | | appended to a path string that didn't end in a slash, yielding invalid path names. Path contribute by Nicholas Riley. llvm-svn: 22539
* For PR540:Reid Spencer2005-07-121-0/+46
| | | | | | | | | Add a Mutex class for thread synchronization in a platform-independent way. The current implementation only supports pthreads. Win32 use of Critical Sections will be added later. The design permits other threading models to be used if (and only if) pthreads is not available. llvm-svn: 22403
* 1. Fix bug in getBaseName where it mishandles suffixesJeff Cohen2005-07-091-2/+6
| | | | | | 2. Fix bug in eraseSuffix where it allows /path/.suffix to become /path/ llvm-svn: 22362
* Ensure that functions like isDirectory don't fail if the file doesn'tReid Spencer2005-07-081-1/+13
| | | | | | exist but just return false instead. llvm-svn: 22361
* Two changes:Reid Spencer2005-07-081-7/+11
| | | | | | | | | | 1. Use isValid() to check validity of the resulting path name in the eraseSuffix even though we can't think of a case where eraseSuffix could possibly cause an invalid path name. 2. Rewrite isValid() to not use the deprecated realpath function any more. It now just uses isascii to make sure all the characters are legit. llvm-svn: 22359
* Stamp out tabsJeff Cohen2005-07-081-1/+1
| | | | llvm-svn: 22357
* Fix eraseSuffix()Jeff Cohen2005-07-081-10/+6
| | | | llvm-svn: 22355
* Final Changes For PR495:Reid Spencer2005-07-082-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This chagne just renames some sys::Path methods to ensure they are not misused. The Path documentation now divides methods into two dimensions: Path/Disk and accessor/mutator. Path accessors and mutators only operate on the Path object itself without making any disk accesses. Disk accessors and mutators will also access or modify the file system. Because of the potentially destructive nature of disk mutators, it was decided that all such methods should end in the work "Disk" to ensure the user recognizes that the change will occur on the file system. This patch makes that change. The method name changes are: makeReadable -> makeReadableOnDisk makeWriteable -> makeWriteableOnDisk makeExecutable -> makeExecutableOnDisk setStatusInfo -> setStatusInfoOnDisk createDirectory -> createDirectoryOnDisk createFile -> createFileOnDisk createTemporaryFile -> createTemporaryFileOnDisk destroy -> eraseFromDisk rename -> renamePathOnDisk These changes pass the Linux Deja Gnu tests. llvm-svn: 22354
* For PR495:Reid Spencer2005-07-073-134/+83
| | | | | | | | | | | | | | | | | | | | | Get rid of the difference between file paths and directory paths. The Path class now simply stores a path that can refer to either a file or a directory. This required various changes in the implementation and interface of the class with the corresponding impact to its users. Doxygen comments were also updated to reflect these changes. Interface changes are: appendDirectory -> appendComponent appendFile -> appendComponent elideDirectory -> eraseComponent elideFile -> eraseComponent elideSuffix -> eraseSuffix renameFile -> rename setDirectory -> set setFile -> set Changes pass Dejagnu and llvm-test/SingleSource tests. llvm-svn: 22349
* For PR495:Reid Spencer2005-07-072-9/+9
| | | | | | | | | | | Change interface to Path class: readable -> canRead writable -> canWrite executable -> canExecute More (incremental) changes coming to close 495. llvm-svn: 22345
* Put in a hack for Cygwin that prevents mkdtemp from being used sinceReid Spencer2005-06-021-0/+5
| | | | | | configure seems to find it on Cygwin but linking against it fails. llvm-svn: 22189
* comment the hpux bitDuraid Madina2005-05-161-0/+1
| | | | llvm-svn: 22081
* Remove vim settings from source code; people should use llvm/utils/vim/vimrcMisha Brukman2005-05-058-8/+0
| | | | llvm-svn: 21704
* Silence gcc-4.0.0 warnings.Alkis Evlogimenos2005-04-221-4/+4
| | | | llvm-svn: 21453
* Remove trailing whitespaceMisha Brukman2005-04-212-9/+9
| | | | llvm-svn: 21422
* Provide an implementation of the GetCurrentUserId and GetCurrentGroupIdReid Spencer2005-04-211-0/+10
| | | | | | methods that were recently added to the interface. llvm-svn: 21401
* For Bug 543:Reid Spencer2005-04-211-24/+24
| | | | | | | | Standardize the error messages to be in "path: what failed: why" format. Also attempt to use the correct errno to ThrowErrno in situations where the errno value is erased by subsequent system calls. llvm-svn: 21385
* For Bug 543:Reid Spencer2005-04-211-6/+8
| | | | | | | Allow the ThrowErrno function to optionally accept an error number parameter so that callers can specify the error number to be used. llvm-svn: 21384
* Add FIXME by Markus Oberhumer from bug 545: not checking for "." in $PATH mayMisha Brukman2005-04-201-0/+2
| | | | | | result in returning executable files that won't be runnable. llvm-svn: 21378
* Do not mark directories as `executable', we only want program filesMisha Brukman2005-04-201-0/+4
| | | | | | Patch by Markus Oberhumer. llvm-svn: 21377
* Ignore dangling symlinks in getDirectoryContents()Misha Brukman2005-04-201-3/+8
| | | | | | Thanks to Markus Oberhumer for the patch! llvm-svn: 21370
* Be slightly more accurate in an error message.Reid Spencer2005-03-021-1/+1
| | | | llvm-svn: 20397
OpenPOWER on IntegriCloud