+
SUBDIRS := linux posix util
if DARWIN
SUBDIRS += darwin
DIST_SUBDIRS := $(SUBDIRS)
EXTRA_DIST := curproc.h libcfs_private.h libcfs.h list.h lltrace.h \
- portals_utils.h user-lock.h user-prim.h user-time.h \
+ user-lock.h user-prim.h user-time.h \
user-tcpip.h user-bitops.h bitmap.h user-mem.h\
libcfs_prim.h libcfs_private.h libcfs_hash.h libcfs_time.h \
libcfs_debug.h libcfsutil.h libcfs_ioctl.h
#define __USE_FILE_OFFSET64
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <unistd.h>
-
-
#include <libcfs/libcfsutil.h>
#include <lnet/api-support.h>
#include <lnet/lnetctl.h>
-#include <libcfs/portals_utils.h>
-
static ioc_handler_t do_ioctl; /* forward ref */
static ioc_handler_t *current_ioc_handler = &do_ioctl;
#endif
#ifndef __CYGWIN__
- fd = syscall(SYS_open, dump_file, O_RDONLY);
+ fd = open(dump_file, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "couldn't open %s: %s\n", dump_file,
strerror(errno));
#define _GNU_SOURCE
#endif
-#include <stdio.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifndef _IOWR
-#include "ioctl.h"
-#endif
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <assert.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/utsname.h>
-
#include <libcfs/libcfsutil.h>
#include <lnet/lnetctl.h>
-#include <libcfs/portals_utils.h>
-#include <time.h>
+#include <sys/utsname.h>
static char rawbuf[8192];
static char *buf = rawbuf;
static int jt_dbg_modules_2_4(int argc, char **argv)
{
-#ifdef HAVE_LINUX_VERSION_H
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- struct mod_paths *mp;
- char *path = "";
- char *kernel = "linux";
-
- if (argc >= 2)
- path = argv[1];
- if (argc == 3)
- kernel = argv[2];
- if (argc > 3) {
- printf("%s [path] [kernel]\n", argv[0]);
- return 0;
- }
-
- for (mp = mod_paths; mp->name != NULL; mp++) {
- struct module_info info;
- int rc;
- size_t crap;
- int query_module(const char *name, int which, void *buf,
- size_t bufsize, size_t *ret);
-
- rc = query_module(mp->name, QM_INFO, &info, sizeof(info),
- &crap);
- if (rc < 0) {
- if (errno != ENOENT)
- printf("query_module(%s) failed: %s\n",
- mp->name, strerror(errno));
- } else {
- printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path,
- path[0] ? "/" : "", mp->path, mp->name,
- info.addr + sizeof(struct module));
- }
- }
-
- return 0;
-#endif // Headers are 2.6-only
-#endif // !HAVE_LINUX_VERSION_H
return -EINVAL;
}