projects
/
hashcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d3d212
)
implement get_exec_path for FreeBSD
author
Nikolai Lifanov
<lifanov@mail.lifanov.com>
Tue, 5 Jul 2016 19:43:03 +0000
(15:43 -0400)
committer
Nikolai Lifanov
<lifanov@mail.lifanov.com>
Tue, 5 Jul 2016 19:43:03 +0000
(15:43 -0400)
src/shared.c
patch
|
blob
|
history
diff --git
a/src/shared.c
b/src/shared.c
index
30f1f81
..
c2e7db8
100644
(file)
--- a/
src/shared.c
+++ b/
src/shared.c
@@
-4371,6
+4371,20
@@
char *get_exec_path ()
const int len = strlen (exec_path);
+ #elif __FreeBSD__
+
+ #include <sys/sysctl.h>
+
+ int mib[4];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = -1;
+
+ size_t size = sizeof(exec_path);
+
+ const int len = sysctl(mib, 4, exec_path, &size, NULL, 0);
+
#else
#error Your Operating System is not supported or detected
#endif