#ifndef __LIBCFS_POSIX_LIBCFS_H__
#define __LIBCFS_POSIX_LIBCFS_H__
+#include <errno.h>
#include <sys/errno.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <assert.h>
+#include <sys/ioctl.h>
#include <sys/signal.h>
#include <signal.h>
#include <sys/time.h>
#include <time.h>
+#include <getopt.h>
+#include <signal.h>
+#include <pwd.h>
+#include <sys/socket.h>
+#include <sys/utsname.h>
+#include <ctype.h>
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifdef HAVE_LIBPTHREAD
#include <pthread.h>
unsigned long index;
void *item;
};
-
+
#define RADIX_TREE_INIT(mask) { \
NOT_IMPLEMENTED \
}
node->index = idx;
node->item = item;
list_add_tail(&node->_node, &root->list);
- root->rnode = (void *)1001;
+ root->rnode = (void *)1001;
return 0;
}
if (list_empty(&root->list))
return NULL;
- list_for_each_entry(node, &root->list, _node)
+ cfs_list_for_each_entry_typed(node, &root->list,
+ struct radix_tree_node, _node)
if (node->index == idx)
return node;
typedef ssize_t (*read_actor_t)();
+#define CFS_IFSHIFT 12
+
+#define CFS_IFTODT(type) (((type) & S_IFMT) >> CFS_IFSHIFT)
+#define CFS_DTTOIF(dirtype) ((dirtype) << CFS_IFSHIFT)
+
#endif