unexsol.c 651 Bytes
Newer Older
Richard M. Stallman's avatar
Richard M. Stallman committed
1 2 3
/* Trivial unexec for Solaris.  */

#include <config.h>
4 5
#include "unexec.h"

Richard M. Stallman's avatar
Richard M. Stallman committed
6
#include <dlfcn.h>
7
#include <setjmp.h>
Richard M. Stallman's avatar
Richard M. Stallman committed
8 9

#include "lisp.h"
10 11 12
#include "buffer.h"
#include "charset.h"
#include "coding.h"
Richard M. Stallman's avatar
Richard M. Stallman committed
13

14
void
15
unexec (const char *new_name, const char *old_name)
Richard M. Stallman's avatar
Richard M. Stallman committed
16
{
17 18
  Lisp_Object data;
  Lisp_Object errstring;
Richard M. Stallman's avatar
Richard M. Stallman committed
19

20
  if (! dldump (0, new_name, RTLD_MEMORY))
21
    return;
22 23 24 25 26 27

  data = Fcons (build_string (new_name), Qnil);
  synchronize_system_messages_locale ();
  errstring = code_convert_string_norecord (build_string (dlerror ()),
					    Vlocale_coding_system, 0);

Kim F. Storm's avatar
Kim F. Storm committed
28
  xsignal (Qfile_error,
29
	   Fcons (build_string ("Cannot unexec"), Fcons (errstring, data)));
Richard M. Stallman's avatar
Richard M. Stallman committed
30
}