2003-11-14 16:54:54 +01:00
|
|
|
/***********************************************************
|
|
|
|
|
|
|
|
Copyright 1987, 1998 The Open Group
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
the above copyright notice appear in all copies and that both that
|
|
|
|
copyright notice and this permission notice appear in supporting
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 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 DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
Except as contained in this notice, the name of The Open Group shall not be
|
|
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
|
|
in this Software without prior written authorization from The Open Group.
|
|
|
|
|
|
|
|
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
2014-10-31 00:45:12 +01:00
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
2003-11-14 16:54:54 +01:00
|
|
|
provided that the above copyright notice appear in all copies and that
|
2014-10-31 00:45:12 +01:00
|
|
|
both that copyright notice and this permission notice appear in
|
2003-11-14 16:54:54 +01:00
|
|
|
supporting documentation, and that the name of Digital not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
2014-10-31 00:45:12 +01:00
|
|
|
software without specific, written prior permission.
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
|
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
|
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
|
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
SOFTWARE.
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <stdio.h>
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "os.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "osdep.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/Xos.h>
|
2009-03-09 21:22:57 +01:00
|
|
|
#include <signal.h>
|
|
|
|
#include <errno.h>
|
2009-03-27 07:04:24 +01:00
|
|
|
#ifdef HAVE_DLFCN_H
|
2012-03-21 20:55:09 +01:00
|
|
|
#include <dlfcn.h>
|
2009-03-27 07:04:24 +01:00
|
|
|
#endif
|
2009-08-20 21:28:57 +02:00
|
|
|
#ifdef HAVE_BACKTRACE
|
|
|
|
#include <execinfo.h>
|
|
|
|
#endif
|
|
|
|
|
2011-03-09 01:17:27 +01:00
|
|
|
#include "misc.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "dixstruct.h"
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#if !defined(SYSV) && !defined(WIN32)
|
2003-11-14 17:49:22 +01:00
|
|
|
#include <sys/resource.h>
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ADMPATH
|
|
|
|
#define ADMPATH "/usr/adm/X%smsgs"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern char *display;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef RLIMIT_DATA
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int limitDataSpace = -1;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RLIMIT_STACK
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int limitStackSpace = -1;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RLIMIT_NOFILE
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int limitNoFile = -1;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
|
2009-03-09 21:22:57 +01:00
|
|
|
static OsSigWrapperPtr OsSigWrapper = NULL;
|
|
|
|
|
|
|
|
OsSigWrapperPtr
|
|
|
|
OsRegisterSigWrapper(OsSigWrapperPtr newSigWrapper)
|
|
|
|
{
|
|
|
|
OsSigWrapperPtr oldSigWrapper = OsSigWrapper;
|
|
|
|
|
|
|
|
OsSigWrapper = newSigWrapper;
|
|
|
|
|
|
|
|
return oldSigWrapper;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* OsSigHandler --
|
|
|
|
* Catch unexpected signals and exit or continue cleanly.
|
|
|
|
*/
|
2012-04-20 14:46:21 +02:00
|
|
|
#if !defined(WIN32) || defined(__CYGWIN__)
|
2009-03-09 21:22:57 +01:00
|
|
|
static void
|
|
|
|
#ifdef SA_SIGINFO
|
2012-03-21 20:55:09 +01:00
|
|
|
OsSigHandler(int signo, siginfo_t * sip, void *unused)
|
2009-03-09 21:22:57 +01:00
|
|
|
#else
|
|
|
|
OsSigHandler(int signo)
|
|
|
|
#endif
|
|
|
|
{
|
2009-03-27 07:04:24 +01:00
|
|
|
#ifdef RTLD_DI_SETSIGNAL
|
2012-03-21 20:55:09 +01:00
|
|
|
const char *dlerr = dlerror();
|
2009-03-27 07:04:24 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (dlerr) {
|
2012-04-09 17:23:32 +02:00
|
|
|
LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr);
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
|
|
|
#endif /* RTLD_DI_SETSIGNAL */
|
2009-03-27 07:04:24 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (OsSigWrapper != NULL) {
|
|
|
|
if (OsSigWrapper(signo) == 0) {
|
|
|
|
/* ddx handled signal and wants us to continue */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2009-03-09 21:22:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* log, cleanup, and abort */
|
|
|
|
xorg_backtrace();
|
2009-03-09 21:22:57 +01:00
|
|
|
|
|
|
|
#ifdef SA_SIGINFO
|
2012-03-21 20:55:09 +01:00
|
|
|
if (sip->si_code == SI_USER) {
|
2012-10-08 06:18:02 +02:00
|
|
|
ErrorFSigSafe("Received signal %u sent by process %u, uid %u\n", signo,
|
2012-04-09 17:23:32 +02:00
|
|
|
sip->si_pid, sip->si_uid);
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
switch (signo) {
|
|
|
|
case SIGSEGV:
|
|
|
|
case SIGBUS:
|
|
|
|
case SIGILL:
|
|
|
|
case SIGFPE:
|
2012-04-09 17:23:32 +02:00
|
|
|
ErrorFSigSafe("%s at address %p\n", strsignal(signo), sip->si_addr);
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
|
|
|
}
|
2009-03-09 21:22:57 +01:00
|
|
|
#endif
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
FatalError("Caught signal %d (%s). Server aborting\n",
|
|
|
|
signo, strsignal(signo));
|
2009-03-09 21:22:57 +01:00
|
|
|
}
|
2012-04-20 14:46:21 +02:00
|
|
|
#endif /* !WIN32 || __CYGWIN__ */
|
2009-03-09 21:22:57 +01:00
|
|
|
|
2013-11-03 22:12:40 +01:00
|
|
|
#include "busfault.h"
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-25 20:29:01 +01:00
|
|
|
OsInit(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
static Bool been_here = FALSE;
|
2012-03-21 20:55:09 +01:00
|
|
|
static const char *devnull = "/dev/null";
|
2003-11-14 16:54:54 +01:00
|
|
|
char fname[PATH_MAX];
|
|
|
|
|
|
|
|
if (!been_here) {
|
2012-04-20 14:46:21 +02:00
|
|
|
#if !defined(WIN32) || defined(__CYGWIN__)
|
2012-03-21 20:55:09 +01:00
|
|
|
struct sigaction act, oact;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
|
|
|
|
SIGSYS,
|
|
|
|
SIGXCPU,
|
|
|
|
SIGXFSZ,
|
2009-03-09 21:22:57 +01:00
|
|
|
#ifdef SIGEMT
|
2012-03-21 20:55:09 +01:00
|
|
|
SIGEMT,
|
2009-03-09 21:22:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
0 /* must be last */
|
|
|
|
};
|
|
|
|
sigemptyset(&act.sa_mask);
|
2009-03-09 21:22:57 +01:00
|
|
|
#ifdef SA_SIGINFO
|
2012-03-21 20:55:09 +01:00
|
|
|
act.sa_sigaction = OsSigHandler;
|
|
|
|
act.sa_flags = SA_SIGINFO;
|
2009-04-25 07:38:54 +02:00
|
|
|
#else
|
|
|
|
act.sa_handler = OsSigHandler;
|
|
|
|
act.sa_flags = 0;
|
2009-03-09 21:22:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; siglist[i] != 0; i++) {
|
|
|
|
if (sigaction(siglist[i], &act, &oact)) {
|
|
|
|
ErrorF("failed to install signal handler for signal %d: %s\n",
|
|
|
|
siglist[i], strerror(errno));
|
|
|
|
}
|
|
|
|
}
|
2012-04-20 14:46:21 +02:00
|
|
|
#endif /* !WIN32 || __CYGWIN__ */
|
2013-11-03 22:12:40 +01:00
|
|
|
#ifdef BUSFAULT
|
|
|
|
busfault_init();
|
|
|
|
#endif
|
2012-04-20 14:46:21 +02:00
|
|
|
|
2009-08-20 21:28:57 +02:00
|
|
|
#ifdef HAVE_BACKTRACE
|
2012-03-21 20:55:09 +01:00
|
|
|
/*
|
|
|
|
* initialize the backtracer, since the ctor calls dlopen(), which
|
|
|
|
* calls malloc(), which isn't signal-safe.
|
|
|
|
*/
|
|
|
|
do {
|
|
|
|
void *array;
|
|
|
|
|
|
|
|
backtrace(&array, 1);
|
|
|
|
} while (0);
|
2009-08-20 21:28:57 +02:00
|
|
|
#endif
|
2009-03-09 21:22:57 +01:00
|
|
|
|
2009-03-27 07:04:24 +01:00
|
|
|
#ifdef RTLD_DI_SETSIGNAL
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Tell runtime linker to send a signal we can catch instead of SIGKILL
|
|
|
|
* for failures to load libraries/modules at runtime so we can clean up
|
|
|
|
* after ourselves.
|
|
|
|
*/
|
|
|
|
int failure_signal = SIGQUIT;
|
|
|
|
|
|
|
|
dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal);
|
2009-03-27 07:04:24 +01:00
|
|
|
#endif
|
|
|
|
|
2013-12-07 10:14:37 +01:00
|
|
|
#if !defined(XQUARTZ) /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */
|
|
|
|
# if defined(__APPLE__)
|
|
|
|
int devnullfd = open(devnull, O_RDWR, 0);
|
|
|
|
assert(devnullfd > 2);
|
|
|
|
|
|
|
|
dup2(devnullfd, STDIN_FILENO);
|
|
|
|
dup2(devnullfd, STDOUT_FILENO);
|
|
|
|
close(devnullfd);
|
|
|
|
# elif !defined(__CYGWIN__)
|
2012-03-21 20:55:09 +01:00
|
|
|
fclose(stdin);
|
|
|
|
fclose(stdout);
|
2013-12-07 10:14:37 +01:00
|
|
|
# endif
|
2014-10-31 00:45:12 +01:00
|
|
|
/*
|
|
|
|
* If a write of zero bytes to stderr returns non-zero, i.e. -1,
|
|
|
|
* then writing to stderr failed, and we'll write somewhere else
|
2012-03-21 20:55:09 +01:00
|
|
|
* instead. (Apparently this never happens in the Real World.)
|
|
|
|
*/
|
|
|
|
if (write(2, fname, 0) == -1) {
|
|
|
|
FILE *err;
|
|
|
|
|
|
|
|
if (strlen(display) + strlen(ADMPATH) + 1 < sizeof fname)
|
|
|
|
snprintf(fname, sizeof(fname), ADMPATH, display);
|
|
|
|
else
|
|
|
|
strcpy(fname, devnull);
|
|
|
|
/*
|
|
|
|
* uses stdio to avoid os dependencies here,
|
|
|
|
* a real os would use
|
|
|
|
* open (fname, O_WRONLY|O_APPEND|O_CREAT, 0666)
|
|
|
|
*/
|
|
|
|
if (!(err = fopen(fname, "a+")))
|
|
|
|
err = fopen(devnull, "w");
|
|
|
|
if (err && (fileno(err) != 2)) {
|
|
|
|
dup2(fileno(err), 2);
|
|
|
|
fclose(err);
|
|
|
|
}
|
2007-06-29 00:59:05 +02:00
|
|
|
#if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
static char buf[BUFSIZ];
|
|
|
|
|
|
|
|
setvbuf(stderr, buf, _IOLBF, BUFSIZ);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
setlinebuf(stderr);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
2013-12-07 10:14:37 +01:00
|
|
|
#endif /* !XQUARTZ */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-11-04 01:25:57 +01:00
|
|
|
#if !defined(WIN32) || defined(__CYGWIN__)
|
2012-03-21 20:55:09 +01:00
|
|
|
if (getpgrp() == 0)
|
|
|
|
setpgid(0, 0);
|
2011-11-04 01:25:57 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
#ifdef RLIMIT_DATA
|
2012-03-21 20:55:09 +01:00
|
|
|
if (limitDataSpace >= 0) {
|
|
|
|
struct rlimit rlim;
|
|
|
|
|
|
|
|
if (!getrlimit(RLIMIT_DATA, &rlim)) {
|
|
|
|
if ((limitDataSpace > 0) && (limitDataSpace < rlim.rlim_max))
|
|
|
|
rlim.rlim_cur = limitDataSpace;
|
|
|
|
else
|
|
|
|
rlim.rlim_cur = rlim.rlim_max;
|
|
|
|
(void) setrlimit(RLIMIT_DATA, &rlim);
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RLIMIT_STACK
|
2012-03-21 20:55:09 +01:00
|
|
|
if (limitStackSpace >= 0) {
|
|
|
|
struct rlimit rlim;
|
|
|
|
|
|
|
|
if (!getrlimit(RLIMIT_STACK, &rlim)) {
|
|
|
|
if ((limitStackSpace > 0) && (limitStackSpace < rlim.rlim_max))
|
|
|
|
rlim.rlim_cur = limitStackSpace;
|
|
|
|
else
|
|
|
|
rlim.rlim_cur = rlim.rlim_max;
|
|
|
|
(void) setrlimit(RLIMIT_STACK, &rlim);
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RLIMIT_NOFILE
|
2012-03-21 20:55:09 +01:00
|
|
|
if (limitNoFile >= 0) {
|
|
|
|
struct rlimit rlim;
|
|
|
|
|
|
|
|
if (!getrlimit(RLIMIT_NOFILE, &rlim)) {
|
|
|
|
if ((limitNoFile > 0) && (limitNoFile < rlim.rlim_max))
|
|
|
|
rlim.rlim_cur = limitNoFile;
|
|
|
|
else
|
|
|
|
rlim.rlim_cur = rlim.rlim_max;
|
|
|
|
(void) setrlimit(RLIMIT_NOFILE, &rlim);
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
LockServer();
|
|
|
|
been_here = TRUE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
TimerInit();
|
|
|
|
OsVendorInit();
|
2012-07-10 01:34:39 +02:00
|
|
|
OsResetSignals();
|
2003-11-25 20:29:01 +01:00
|
|
|
/*
|
|
|
|
* No log file by default. OsVendorInit() should call LogInit() with the
|
|
|
|
* log file name if logging to a file is desired.
|
|
|
|
*/
|
|
|
|
LogInit(NULL, NULL);
|
2012-03-21 20:55:09 +01:00
|
|
|
SmartScheduleInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-25 20:29:01 +01:00
|
|
|
OsCleanup(Bool terminating)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (terminating) {
|
|
|
|
UnlockServer();
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|