3
using System.Runtime.InteropServices;
9
public class EntryPoint
12
private static extern int prctl(int option, byte [] arg2, ulong arg3,
13
ulong arg4, ulong arg5);
15
private static void SetProcessName(string name) {
17
prctl(15 /* PR_SET_NAME */, Encoding.ASCII.GetBytes(name + "\0"), 0, 0, 0);
22
public static int Main (string[] args)
24
string configFile = null;
26
SetProcessName ("tangerine");
28
if (args.Length > 0) {
29
if (args[0] == "-h" || args[0] == "--help") {
30
Console.WriteLine ("Usage: tangerine [<config>]");
31
Console.WriteLine ("If no config file is specified, ~/.tangerine is used");
39
if (configFile != null) {
40
Daemon.ConfigPath = configFile;
43
Daemon.ParseConfig ();
44
} catch (Exception e) {
45
Console.Error.WriteLine ("Failed to parse configuration: " + e);