Distributed Hash Table File System for Linux








utils.c File Reference

#include "magma.h"

Defines

#define GRPBUFLEN   4096

Typedefs

typedef union net64int net64int_t

Functions

void chomp (char *in, size_t len)
int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y)
int xwrite (int fd, const void *buf, size_t size)
int catpath (char **buffer,...)
char * get_regerror (int errcode, regex_t *compiled)
uint64_t magma_htonll (uint64_t from_host)
uint64_t magma_ntohll (uint64_t from_net)
gid_t * get_user_groups (uid_t uid)
void clean_group_cache ()

Variables

group_cache_t * gcache = NULL
pthread_mutex_t gcache_mutex = PTHREAD_MUTEX_INITIALIZER

Define Documentation

#define GRPBUFLEN   4096


Typedef Documentation

typedef union net64int net64int_t


Function Documentation

int catpath ( char **  buffer,
  ... 
)

concatenate path components passed as variable length NULL terminated list...

void chomp ( char *  in,
size_t  len 
)

void clean_group_cache (  ) 

char* get_regerror ( int  errcode,
regex_t *  compiled 
)

gid_t* get_user_groups ( uid_t  uid  ) 

return a list of group id for userid uid

Parameters:
@uid the UID of the user

uint64_t magma_htonll ( uint64_t  from_host  ) 

uint64_t magma_ntohll ( uint64_t  from_net  ) 

int timeval_subtract ( struct timeval *  result,
struct timeval *  x,
struct timeval *  y 
)

int xwrite ( int  fd,
const void *  buf,
size_t  size 
)

guarantee that all provided buffer will be written on filedescriptor

Parameters:
@fd the filedescriptor
@buf the buffer to be written
@size buffer size to be written


Variable Documentation

group_cache_t* gcache = NULL

pthread_mutex_t gcache_mutex = PTHREAD_MUTEX_INITIALIZER

This file last modified Wednesday, 09-Jan-2008 20:02:23 CET