* @file statistics/gnunet-service-statistics.c
* @brief program that tracks statistics
* @author Christian Grothoff
+ *
+ * TODO:
+ * - use BIO for IO operations
*/
#include "platform.h"
#include "gnunet_disk_lib.h"
*/
static void
load (struct GNUNET_SERVER_Handle *server,
- struct GNUNET_CONFIGURATION_Handle *cfg)
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
char *fn;
struct GNUNET_DISK_FileHandle *fh;
GNUNET_free (fn);
return;
}
- fh = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ);
+ fh = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ,
+ GNUNET_DISK_PERM_NONE);
if (!fh)
{
GNUNET_free (fn);
return;
}
- buf = GNUNET_DISK_file_map (fh, &mh, GNUNET_DISK_MAP_READ, sb.st_size);
+ buf = GNUNET_DISK_file_map (fh, &mh, GNUNET_DISK_MAP_TYPE_READ, sb.st_size);
if (NULL == buf)
{
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "mmap", fn);
* @param cfg configuration to use
*/
static void
-save (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+save (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct StatsEntry *pos;
char *fn;
run (void *cls,
struct GNUNET_SCHEDULER_Handle *sched,
struct GNUNET_SERVER_Handle *server,
- struct GNUNET_CONFIGURATION_Handle *cfg)
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
GNUNET_SERVER_add_handlers (server, handlers);
load (server, cfg);