version 1.8, 2025/04/02 03:02:42
|
version 1.20, 2025/05/18 18:15:38
|
Line 24
|
Line 24
|
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
* $Log$ |
* $Log$ |
|
* Revision 1.20 2025/05/18 18:15:38 snw |
|
* Add ZEDIT command for editing routines |
|
* |
|
* Revision 1.19 2025/05/16 13:22:58 snw |
|
* Bump version to account for shared memory changes |
|
* |
|
* Revision 1.18 2025/05/16 04:42:02 snw |
|
* Fix macOS port |
|
* |
|
* Revision 1.17 2025/05/05 04:46:35 snw |
|
* Documentation fixes; make FreeM more standards compliant |
|
* |
|
* Revision 1.16 2025/04/30 17:19:16 snw |
|
* Improve backtraces in debugger |
|
* |
|
* Revision 1.15 2025/04/30 14:41:03 snw |
|
* Further debugger work |
|
* |
|
* Revision 1.14 2025/04/28 19:38:55 snw |
|
* Add trace mode |
|
* |
|
* Revision 1.13 2025/04/17 14:34:27 snw |
|
* Further logging improvements |
|
* |
|
* Revision 1.12 2025/04/16 17:36:12 snw |
|
* Add FreeBSD shm cleanup script |
|
* |
|
* Revision 1.11 2025/04/13 04:22:43 snw |
|
* Fix snprintf calls |
|
* |
|
* Revision 1.10 2025/04/10 01:24:38 snw |
|
* Remove C++ style comments |
|
* |
|
* Revision 1.9 2025/04/03 01:41:02 snw |
|
* New features frozen; prepare 0.63.0-rc1 |
|
* |
* Revision 1.8 2025/04/02 03:02:42 snw |
* Revision 1.8 2025/04/02 03:02:42 snw |
* Stop requiring users to pass -e to fmadm when -u or -g are passed |
* Stop requiring users to pass -e to fmadm when -u or -g are passed |
* |
* |
Line 52
|
Line 88
|
#include <string.h> |
#include <string.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/wait.h> |
#include <sys/wait.h> |
|
#include <errno.h> |
#include "transact.h" |
#include "transact.h" |
#include "locktab.h" |
#include "locktab.h" |
#include <errno.h> |
#include "log.h" |
|
|
#ifdef LIBFREEM |
#ifdef LIBFREEM |
# include "errmsg.h" |
# include "errmsg.h" |
Line 419 char config_file[4096]; /* path
|
Line 456 char config_file[4096]; /* path
|
char env_config_file[4096]; /* path to environment config file */ |
char env_config_file[4096]; /* path to environment config file */ |
char env_user[255]; |
char env_user[255]; |
char env_group[255]; |
char env_group[255]; |
|
char env_enabled[10]; |
char shm_env[255]; /* shared memory environment */ |
char shm_env[255]; /* shared memory environment */ |
|
|
short fp_mode = 0; /* set to 0 for fixed-point math, 1 for IEEE754 floating point */ |
short fp_mode = 0; /* set to 0 for fixed-point math, 1 for IEEE754 floating point */ |
Line 529 char curdir[256] = "."; /* curre
|
Line 567 char curdir[256] = "."; /* curre
|
char startuprou[PATHLEN] = "\201"; /* start up routine from cmdline*/ |
char startuprou[PATHLEN] = "\201"; /* start up routine from cmdline*/ |
|
|
char zcommds[256] = |
char zcommds[256] = |
" za zas zb zd zg zh zi zj zl zn zp zq zr zs zt zwr zbreak \ |
" za zb zc ze zg zh zi zj zl zm zn zp zq zr zs zth ztr zwa zwi zwr zassert zbreak \ |
zgo zhalt zinsert zjob zload znamespace zprint zquit zremove zsave ztrap zwrite \201"; /* intrinsic z-commands */ |
zconst zedit zgo zhalt zinsert zjob zload zmap znamespace zprint zquit zremove zsave zthrow ztrap zunmap zwatch zwith zwrite \201"; /* intrinsic z-commands */ |
char zfunctions[256] = /* intrinsic z-functions */ |
char zfunctions[256] = /* intrinsic z-functions */ |
" zb zc zd ze zh zht zk zl zm zn zo zp zr zs zt zboolean zcall zcr zcrc zdata zdate zedit zhorolog \ |
" zb zc zd ze zh zht zk zl zm zn zo zp zr zs zt zboolean zcall zcr zcrc zdata zdate zedit zhorolog \ |
zkey zlength zlsd zname znext zorder zpiece zprevious zreplace zsyntax zsort ztime \201"; |
zkey zlength zlsd zname znext zorder zpiece zprevious zreplace zsyntax zsort ztime \201"; |
Line 607 short sigint_in_for = FALSE;
|
Line 645 short sigint_in_for = FALSE;
|
short direct_mode = TRUE; /* are we in direct mode? */ |
short direct_mode = TRUE; /* are we in direct mode? */ |
|
|
short extr_types[NESTLEVLS + 1]; /* return types of extrinsic functions */ |
short extr_types[NESTLEVLS + 1]; /* return types of extrinsic functions */ |
char destructors[MAX_DESTRUCTORS][50]; |
char destructors[MAX_DESTRUCTORS][OBJ_DSTRSIZE]; |
int destructor_ct; |
int destructor_ct; |
char private_keys[MAX_PRIVATE_KEYS][255]; |
char private_keys[MAX_PRIVATE_KEYS][255]; |
|
|
Line 639 short ipc_pending = 0; /* 1 if an inco
|
Line 677 short ipc_pending = 0; /* 1 if an inco
|
|
|
int strict_mode = 0; |
int strict_mode = 0; |
|
|
short first_process = FALSE; |
int trace_mode = 0; |
size_t shm_init_size = 16777216; |
short debug_mode = FALSE; |
|
int lasterr[NESTLEVLS + 1]; |
|
|
|
short first_process = FALSE; |
|
size_t shm_init_size = 16777216; /* initial size of SysV shared memory segment (16M + overhead); |
|
requires a kernel shmmax (or equivalent) parameter of at least |
|
17002496 */ |
short inrpt_after_async = FALSE; |
short inrpt_after_async = FALSE; |
|
|
//#ifdef USE_SIGACTION |
|
// struct sigaction act = {0}; /* signals stuff */ |
|
//#endif/*USE_SIGACTION*/ |
|
|
|
void unnew (void) |
void unnew (void) |
{ |
{ |
char *xptr; |
char *xptr; |
Line 728 void m_fatal(char *s)
|
Line 767 void m_fatal(char *s)
|
|
|
|
|
if (tp_level) { |
if (tp_level) { |
fprintf (stderr, "freem [FATAL]: memory allocation failure in %s; rolling back %d transactions [errno %d %s]\n", s, tp_level, errno_sav, strerror (errno_sav)); |
/* TODO: make this FM_LOG_FATAL (logger will need to do a tp_trollback) */ |
|
logprintf (FM_LOG_ERROR, "freem: memory allocation failure in %s; rolling back %d transactions (error code %d [%s])", s, tp_level, errno_sav, strerror (errno_sav)); |
tp_trollback (tp_level); |
tp_trollback (tp_level); |
} |
} |
else { |
else { |
fprintf (stderr, "freem [FATAL]: memory allocation failure in %s [errno %d %s]\n", s, errno_sav, strerror (errno_sav)); |
logprintf (FM_LOG_FATAL, "freem: memory allocation failure in %s (error code %d [%s])", s, errno_sav, strerror (errno_sav)); |
} |
} |
|
|
exit (3); |
exit (3); |