1.0.19.33: Improved interrupt handling on darwin/x86[-64]
[sbcl/eslaughter.git] / src / runtime / darwin-os.c
blob45738dfa0c1c2160bfc4c92ba00a3fbcf9bef7fb
1 /*
2 * This is the Darwin incarnation of OS-dependent routines. See also
3 * "bsd-os.c".
4 */
6 /*
7 * This software is part of the SBCL system. See the README file for
8 * more information.
10 * This software is derived from the CMU CL system, which was
11 * written at Carnegie Mellon University and released into the
12 * public domain. The software is in the public domain and is
13 * provided with absolutely no warranty. See the COPYING and CREDITS
14 * files for more information.
17 #include "sbcl.h"
18 #include "globals.h"
19 #include "runtime.h"
20 #include <signal.h>
21 #include <ucontext.h>
22 #include <limits.h>
23 #include <mach-o/dyld.h>
24 #include "bsd-os.h"
25 #include <errno.h>
27 char *
28 os_get_runtime_executable_path()
30 char path[PATH_MAX + 1];
31 uint32_t size = sizeof(path);
33 if (_NSGetExecutablePath(path, &size) == -1)
34 return NULL;
35 else
36 path[size] = '\0';
38 return copied_string(path);