unexsol.c 604 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 7 8
#include <dlfcn.h>

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

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

18
  if (! dldump (0, new_name, RTLD_MEMORY))
19
    return;
20

21
  data = list1 (build_string (new_name));
22 23 24 25
  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
26
  xsignal (Qfile_error,
27
	   Fcons (build_string ("Cannot unexec"), Fcons (errstring, data)));
Richard M. Stallman's avatar
Richard M. Stallman committed
28
}