Something went wrong. Try again.
Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
C
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980/*This file is part of Darling.
Copyright (C) 2016 Lubos Dolezel
Darling is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.
Darling is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.
You should have received a copy of the GNU General Public Licensealong with Darling. If not, see <http://www.gnu.org/licenses/>.*/
#include <sys/types.h>
#ifndef _DARLING_H_#define _DARLING_H_
void showHelp(const char* argv0);void showVersion(const char* argv0);
// Reports that this executable is not setuid rootvoid missingSetuidRoot(void);
// Returns ~/.darling with ~ expandedchar* defaultPrefixPath(void);
void setupWorkdir(void);
void setupPrefix(void);
int checkPrefixDir(void);
// Creates the given directory, exit()ing if not possiblevoid createDir(const char* path);
int connectToShellspawn(void);void setupShellspawnEnv(int shellspawnFD);void setupWorkingDir(int shellspawnFD);void setupIDs(int shellspawnFD);void setupFDs(int fds[3], int* master);void spawnGo(int shellspawnFD, int fds[3], int master);void spawnShell(const char** argv);void spawnBinary(const char* binary, const char** argv);
// Set up some environment variables// As well as the working directory// Called in the child processvoid setupChild(const char *curPath);
// Returns the PID of the init process in prefix (in our namespace)// Returns 0 if no init is runningpid_t getInitProcess(void);
pid_t spawnInitProcess(void);
void putInitPid(pid_t pidInit);void mapUids(pid_t pid);
void spawnLaunchd(void);void darlingPreInit(void);
void checkPrefixOwner(void);
int isModuleLoaded(void);
void loadKernelModule(void);void joinNamespace(pid_t pid, int type, const char* typeName);
void setupCoredumpPattern(void);void setupUserHome(void);
#endif