/* Debugging */
#ifdef DEBUG
-#define dprintf(format, arg...) fprintf(stderr, format, ## arg)
+#include <syslog.h>
+#define dprintf(format, arg...) \
+ do { \
+ log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \
+ } while (0)
#else
#define dprintf(format, arg...) do { } while (0)
#endif
+extern int log_message (int level, const char *format, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+
#endif /* _SYSFS_H_ */