1 /*===- OSInterface.h - Interface to query OS for functionality ---*- C -*--===*\
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 * This file defines the prototype interface that we will expect operating *
12 * systems to implement if they wish to support offline cachine. *
14 \*===----------------------------------------------------------------------===*/
16 #ifndef OS_INTERFACE_H
17 #define OS_INTERFACE_H
19 #include "Config/sys/types.h"
24 * llvmStat - equivalent to stat(3), except the key may not necessarily
25 * correspond to a file by that name, implementation is up to the OS.
26 * Values returned in buf are similar as they are in Unix.
28 void llvmStat(const char *key, struct stat *buf);
31 * llvmWriteFile - implements a 'save' of a file in the OS. 'key' may not
32 * necessarily map to a file of the same name.
37 int llvmWriteFile(const char *key, const void *data, size_t len);
40 * llvmLoadFile - tells the OS to load data corresponding to a particular key
41 * somewhere into memory.
44 * non-zero - address of loaded file
46 * Value of size is the length of data loaded into memory.
48 void* llvmReadFile(const char *key, size_t *size);
51 * llvmExecve - execute a file from cache. This is a temporary proof-of-concept
52 * because we do not relocate what we can read from disk.
54 int llvmExecve(const char *filename, char *const argv[], char *const envp[]);