Index: internal.h
===================================================================
--- internal.h	(revision 192106)
+++ internal.h	(working copy)
@@ -56,6 +56,12 @@
 # endif
 #endif
 
+#ifdef __FreeBSD__
+# define DEFAULT_PROCESS_FILENAME "/proc/curproc/file"
+#else
+# define DEFAULT_PROCESS_FILENAME "/proc/self/exe"
+#endif
+
 #ifndef HAVE_SYNC_FUNCTIONS
 
 /* Define out the sync functions.  These should never be called if
Index: fileline.c
===================================================================
--- fileline.c	(revision 192106)
+++ fileline.c	(working copy)
@@ -82,7 +82,8 @@
   if (state->filename != NULL)
     descriptor = backtrace_open (state->filename, error_callback, data);
   else
-    descriptor = backtrace_open ("/proc/self/exe", error_callback, data);
+    descriptor = backtrace_open (DEFAULT_PROCESS_FILENAME, error_callback,
+				 data);
   if (descriptor < 0)
     failed = 1;
 
Index: print.c
===================================================================
--- print.c	(revision 192106)
+++ print.c	(working copy)
@@ -73,7 +73,7 @@
 
   name = pdata->state->filename;
   if (name == NULL)
-    name = "/proc/self/exe";
+    name = DEFAULT_PROCESS_FILENAME;
   fprintf (stderr, "%s: libbacktrace: %s", name, msg);
   if (errnum > 0)
     fprintf (stderr, ": %s", strerror (errnum));
