Use <> for system #include files
[oota-llvm.git] / lib / System / Unix / SysConfig.cpp
1 //===- SysConfig.cpp - Generic UNIX System Configuration --------*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Reid Spencer and is distributed under the 
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines some functions for managing system configuration on Unix
11 // systems.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "Unix.h"
16 #include <sys/resource.h>
17
18 namespace llvm {
19
20 // Some LLVM programs such as bugpoint produce core files as a normal part of
21 // their operation. To prevent the disk from filling up, this configuration item
22 // does what's necessary to prevent their generation.
23 void sys::PreventCoreFiles() {
24   struct rlimit rlim;
25   rlim.rlim_cur = rlim.rlim_max = 0;
26   int res = setrlimit(RLIMIT_CORE, &rlim);
27   if (res != 0)
28     ThrowErrno("Can't prevent core file generation");
29 }
30
31 }
32
33 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab