Reid Spencer | 27dafe1 | 2004-09-11 04:56:56 +0000 | [diff] [blame] | 1 | //===- Unix/Process.cpp - Unix Process Implementation --------- -*- 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 provides the generic Unix implementation of the Process class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include <unistd.h> |
| 15 | |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | //=== WARNING: Implementation here must contain only generic UNIX code that |
| 18 | //=== is guaranteed to work on *all* UNIX variants. |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | |
| 21 | namespace llvm { |
| 22 | using namespace sys; |
| 23 | |
| 24 | unsigned |
| 25 | Process::GetPageSize() { |
| 26 | // NOTE: The getpagesize function doesn't exist in POSIX 1003.1 and is |
| 27 | // "deprecated" in SUSv2. Platforms including this implementation should |
| 28 | // consider sysconf(_SC_PAGE_SIZE) if its available. |
| 29 | static const int page_size = getpagesize(); |
| 30 | return static_cast<unsigned>(page_size); |
| 31 | } |
| 32 | |
| 33 | } |
| 34 | // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab |