#define _BSD_SOURCE
#endif
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
#include <stdio.h>
#endif
#include <stdlib.h>
-#ifdef _BSD_SOURCE
+#if defined(_BSD_SOURCE) || defined(SYSIO_TRACING)
#include <sys/syscall.h>
#endif
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
#include <stdarg.h>
#endif
#include <limits.h>
#include "sysio.h"
#include "xtio.h"
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
#include "native.h"
#endif
#include "inode.h"
#include "stdfd.h"
#endif
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
/*
* Tracing callback record.
(__tcb)->f = (__f); \
(__tcb)->data = (__d); \
(__tcb)->destructor = (__destroy); \
- } while (0);
+ } while (0)
/*
* Trace queue head record.
extern int _sysio_sockets_init(void);
#endif
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
/*
* Initialize tracing callback queues.
*/
_sysio_unmount_all() == 0))
abort();
-#if ZERO_SUM_MEMORY
+#ifdef ZERO_SUM_MEMORY
_sysio_fd_shutdown();
_sysio_i_shutdown();
_sysio_fssw_shutdown();
_sysio_access_shutdown();
-#if SYSIO_TRACING
+ free(incore_dir_template);
+#ifdef SYSIO_TRACING
{
struct trace_callback *tcb;
#endif
}
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
#if !(defined(_HAVE_ASPRINTF) && _HAVE_ASPRINTF)
/*
return -EINVAL;
}
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
/*
* Set/Unset tracing.
*/
if (err)
break;
}
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
if (err)
_sysio_cprintf("+NS init+ failed at expr %u (last = %s): %s\n",
count,
return err;
}
-#if DEFER_INIT_CWD
+#ifdef DEFER_INIT_CWD
/*
* Set deferred initial working directory.
*/
/*
* Given an identifier and it's arguments, perform optional initializations.
*/
-int
+int
_sysio_boot(const char *opt, const char *arg)
{
struct option_value_info vec[] = {
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
{ "trace", NULL }, /* tracing? */
#endif
{ "namespace", NULL }, /* init namespace? */
-#if DEFER_INIT_CWD
+#ifdef DEFER_INIT_CWD
{ "cwd", NULL }, /* init working dir */
#endif
{ NULL, NULL }
struct option_value_info *v;
unsigned u;
static int (*f[])(const char *) = {
-#if SYSIO_TRACING
+#ifdef SYSIO_TRACING
_sysio_boot_tracing,
#endif
_sysio_boot_namespace,
-#if DEFER_INIT_CWD
+#ifdef DEFER_INIT_CWD
_sysio_boot_cwd,
#endif
NULL /* can't happen */