正在加载此比较的其余部分。

Untitled diff

创建于 差异永不过期
18 删除
911 行
15 添加
908 行
PHARO-VM (unifdef -DPharoVM)
SQUEAK-VM (unifdef -UPharoVM)
/* sqUnixMain.c -- support for Unix.
/* sqUnixMain.c -- support for Unix.
*
*
* Copyright (C) 1996-2007 by Ian Piumarta and other authors/contributors
* Copyright (C) 1996-2007 by Ian Piumarta and other authors/contributors
* listed elsewhere in this file.
* listed elsewhere in this file.
* All rights reserved.
* All rights reserved.
*
*
* This file is part of Unix Squeak.
* This file is part of Unix Squeak.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* DEALINGS IN THE SOFTWARE.
*/
*/


/* Author: Ian Piumarta <ian.piumarta@squeakland.org>
/* Author: Ian Piumarta <ian.piumarta@squeakland.org>
* Merged with
* Merged with
* http://squeakvm.org/svn/squeak/trunk/platforms/unix/vm/sqUnixMain.c
* http://squeakvm.org/svn/squeak/trunk/platforms/unix/vm/sqUnixMain.c
* Revision: 2148
* Revision: 2148
* Last Changed Rev: 2132
* Last Changed Rev: 2132
* by eliot Wed Jan 20 10:57:26 PST 2010
* by eliot Wed Jan 20 10:57:26 PST 2010
*/
*/


#include "sq.h"
#include "sq.h"
#include "sqAssert.h"
#include "sqAssert.h"
#include "sqMemoryAccess.h"
#include "sqMemoryAccess.h"
#include "sqaio.h"
#include "sqaio.h"
#include "sqUnixCharConv.h"
#include "sqUnixCharConv.h"
#include "sqSCCSVersion.h"
#include "sqSCCSVersion.h"
#include "sqUnixMain.h"
#include "sqUnixMain.h"
#include "debug.h"
#include "debug.h"


#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <time.h>
#include <time.h>
#include <sys/time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/param.h>
#include <sys/utsname.h>
#include <sys/utsname.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <unistd.h>
#include <unistd.h>
#include <errno.h>
#include <errno.h>
#include <signal.h>
#include <signal.h>
#include <fcntl.h>
#include <fcntl.h>
#if !defined(NOEXECINFO)
#if !defined(NOEXECINFO)
# include <execinfo.h>
# include <execinfo.h>
# define BACKTRACE_DEPTH 64
# define BACKTRACE_DEPTH 64
#endif
#endif
#if __OpenBSD__
#if __OpenBSD__
# include <sys/signal.h>
# include <sys/signal.h>
#endif
#endif
#if __FreeBSD__
#if __FreeBSD__
# include <sys/ucontext.h>
# include <sys/ucontext.h>
#endif
#endif
# if __sun__
# if __sun__
# include <sys/ucontext.h>
# include <sys/ucontext.h>
# include <limits.h>
# include <limits.h>
# endif
# endif


#if defined(__alpha__) && defined(__osf__)
#if defined(__alpha__) && defined(__osf__)
# include <sys/sysinfo.h>
# include <sys/sysinfo.h>
# include <sys/proc.h>
# include <sys/proc.h>
#endif
#endif


#undef DEBUG_MODULES
#undef DEBUG_MODULES


#undef IMAGE_DUMP /* define to enable SIGHUP and SIGQUIT handling */
#undef IMAGE_DUMP /* define to enable SIGHUP and SIGQUIT handling */


#define IMAGE_NAME_SIZE MAXPATHLEN
#define IMAGE_NAME_SIZE MAXPATHLEN


#define DefaultHeapSize 20 /* megabytes BEYOND actual image size */
#define DefaultHeapSize 20 /* megabytes BEYOND actual image size */
#define DefaultMmapSize 1024 /* megabytes of virtual memory */
#define DefaultMmapSize 1024 /* megabytes of virtual memory */


char *documentName= 0; /* name if launced from document */
char *documentName= 0; /* name if launced from document */
char shortImageName[MAXPATHLEN+1]; /* image name */
char shortImageName[MAXPATHLEN+1]; /* image name */
char imageName[MAXPATHLEN+1]; /* full path to image */
char imageName[MAXPATHLEN+1]; /* full path to image */
static char vmName[MAXPATHLEN+1]; /* full path to vm */
static char vmName[MAXPATHLEN+1]; /* full path to vm */
char vmPath[MAXPATHLEN+1]; /* full path to image directory */
char vmPath[MAXPATHLEN+1]; /* full path to image directory */
static char vmLogDirA[PATH_MAX+1]; /* where to write crash.dmp */
static char vmLogDirA[PATH_MAX+1]; /* where to write crash.dmp */


char *exeName; /* short vm name, e.g. "squeak" */
char *exeName; /* short vm name, e.g. "squeak" */


int argCnt= 0; /* global copies for access from plugins */
int argCnt= 0; /* global copies for access from plugins */
char **argVec= 0;
char **argVec= 0;
char **envVec= 0;
char **envVec= 0;