1.0.37.57: better DEFMETHOD pretty-printing
[sbcl/pkhuong.git] / src / runtime / darwin-os.c
blob95de32634e9ff1b41d9b9c805b02d6dfa26042d3
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 <limits.h>
22 #include <mach-o/dyld.h>
23 #include "bsd-os.h"
24 #include <errno.h>
26 char *
27 os_get_runtime_executable_path(int external)
29 char path[PATH_MAX + 1];
30 uint32_t size = sizeof(path);
32 if (_NSGetExecutablePath(path, &size) == -1)
33 return NULL;
34 else
35 path[size] = '\0';
37 return copied_string(path);