CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
platform_osx.h File Reference
#include <alloca.h>
#include <dirent.h>
#include <fcntl.h>
#include <libkern/OSAtomic.h>
#include <mach-o/dyld.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <signal.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <sys/ucred.h>
#include <sys/xattr.h>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include "file_watcher_kqueue.h"
#include "smalloc.h"
Include dependency graph for platform_osx.h:

Go to the source code of this file.

Macros

#define MSG_NOSIGNAL   SO_NOSIGPIPE
 
#define HOST_NAME_MAX   _POSIX_HOST_NAME_MAX
 
#define platform_sighandler_t   sig_t
 
#define strdupa(s)
 

Typedefs

typedef OSSpinLock platform_spinlock
 
typedef struct dirent platform_dirent64
 
typedef struct stat platform_stat64
 

Functions

std::vector< std::string > platform_mountlist ()
 
bool platform_umount (const char *mountpoint, const bool lazy)
 
int platform_umount_lazy (const char *mountpoint)
 
int platform_spinlock_init (platform_spinlock *lock, int)
 
int platform_spinlock_destroy (platform_spinlock *)
 
int platform_spinlock_trylock (platform_spinlock *lock)
 
void platform_spinlock_unlock (platform_spinlock *lock)
 
thread_port_t platform_gettid ()
 
int platform_sigwait (const int signum)
 
bool platform_allow_ptrace (const pid_t pid)
 
platform_dirent64platform_readdir (DIR *dirp)
 
int platform_stat (const char *path, platform_stat64 *buf)
 
int platform_lstat (const char *path, platform_stat64 *buf)
 
int platform_fstat (int filedes, platform_stat64 *buf)
 
bool platform_getxattr (const std::string &path, const std::string &name, std::string *value)
 
bool platform_setxattr (const std::string &path, const std::string &name, const std::string &value)
 
bool platform_lsetxattr (const std::string &path, const std::string &name, const std::string &value)
 
ssize_t platform_lgetxattr (const char *path, const char *name, void *value, size_t size)
 
ssize_t platform_llistxattr (const char *path, char *list, size_t size)
 
void platform_disable_kcache (int filedes)
 
void platform_invalidate_kcache (const int fd, const off_t offset, const off_t length)
 
ssize_t platform_readahead (int filedes)
 
bool read_line (FILE *f, std::string *line)
 
uint64_t platform_monotonic_time ()
 
uint64_t platform_monotonic_time_ns ()
 
uint64_t platform_realtime_ns ()
 
std::string platform_libname (const std::string &base_name)
 
std::string platform_getexepath ()
 
uint64_t platform_memsize ()
 
file_watcher::FileWatcherplatform_file_watcher ()
 

Macro Definition Documentation

#define HOST_NAME_MAX   _POSIX_HOST_NAME_MAX

HOST_NAME_MAX does on exist on OS X

Definition at line 58 of file platform_osx.h.

#define MSG_NOSIGNAL   SO_NOSIGPIPE

This file is part of the CernVM File System.

Mac OS X specific system/library calls. UNIX domain sockets: MSG_NOSIGNAL prevents send() from sending SIGPIPE and EPIPE is return instead, where supported. MSG_NOSIGNAL is Linux specific, SO_NOSIGPIPE is the Mac OS X equivalent.

Definition at line 53 of file platform_osx.h.

Referenced by TalkManager::Answer(), loader::loader_talk::MainTalk(), and SendMsg2Socket().

#define platform_sighandler_t   sig_t

Definition at line 60 of file platform_osx.h.

#define strdupa (   s)

Typedef Documentation

typedef struct dirent platform_dirent64

File system functions, Mac OS X has 64bit functions by default.

Definition at line 154 of file platform_osx.h.

typedef OSSpinLock platform_spinlock

Spinlocks on OS X are not in pthread but in OS X specific APIs.

Definition at line 107 of file platform_osx.h.

typedef struct stat platform_stat64

Definition at line 158 of file platform_osx.h.

Function Documentation

bool platform_allow_ptrace ( const pid_t  pid)
inline

See platform_linux.h

Definition at line 146 of file platform_osx.h.

void platform_disable_kcache ( int  filedes)
inline

Definition at line 225 of file platform_osx.h.

file_watcher::FileWatcher* platform_file_watcher ( )
inline

Definition at line 312 of file platform_osx.h.

int platform_fstat ( int  filedes,
platform_stat64 buf 
)
inline

Definition at line 168 of file platform_osx.h.

std::string platform_getexepath ( )
inline

Definition at line 293 of file platform_osx.h.

thread_port_t platform_gettid ( )
inline

pthread_self() is not necessarily an unsigned long.

Definition at line 129 of file platform_osx.h.

bool platform_getxattr ( const std::string &  path,
const std::string &  name,
std::string *  value 
)
inline

Definition at line 172 of file platform_osx.h.

void platform_invalidate_kcache ( const int  fd,
const off_t  offset,
const off_t  length 
)
inline

Definition at line 230 of file platform_osx.h.

ssize_t platform_lgetxattr ( const char *  path,
const char *  name,
void *  value,
size_t  size 
)
inline

Definition at line 216 of file platform_osx.h.

std::string platform_libname ( const std::string &  base_name)
inline

Definition at line 289 of file platform_osx.h.

ssize_t platform_llistxattr ( const char *  path,
char *  list,
size_t  size 
)
inline

Definition at line 221 of file platform_osx.h.

bool platform_lsetxattr ( const std::string &  path,
const std::string &  name,
const std::string &  value 
)
inline

Definition at line 203 of file platform_osx.h.

int platform_lstat ( const char *  path,
platform_stat64 buf 
)
inline

Definition at line 164 of file platform_osx.h.

uint64_t platform_memsize ( )
inline

sysconf() is broken on OSX

Definition at line 300 of file platform_osx.h.

Here is the call graph for this function:

uint64_t platform_monotonic_time ( )
inline

Definition at line 256 of file platform_osx.h.

uint64_t platform_monotonic_time_ns ( )
inline

Definition at line 265 of file platform_osx.h.

std::vector<std::string> platform_mountlist ( )
inline

Definition at line 62 of file platform_osx.h.

ssize_t platform_readahead ( int  filedes)
inline

Definition at line 236 of file platform_osx.h.

platform_dirent64* platform_readdir ( DIR *  dirp)
inline

Definition at line 156 of file platform_osx.h.

uint64_t platform_realtime_ns ( )
inline

Definition at line 274 of file platform_osx.h.

Here is the call graph for this function:

bool platform_setxattr ( const std::string &  path,
const std::string &  name,
const std::string &  value 
)
inline

Definition at line 196 of file platform_osx.h.

int platform_sigwait ( const int  signum)
inline

Definition at line 131 of file platform_osx.h.

Here is the call graph for this function:

int platform_spinlock_destroy ( platform_spinlock )
inline

Definition at line 114 of file platform_osx.h.

int platform_spinlock_init ( platform_spinlock lock,
int   
)
inline

Definition at line 109 of file platform_osx.h.

int platform_spinlock_trylock ( platform_spinlock lock)
inline

Definition at line 116 of file platform_osx.h.

void platform_spinlock_unlock ( platform_spinlock lock)
inline

Definition at line 120 of file platform_osx.h.

int platform_stat ( const char *  path,
platform_stat64 buf 
)
inline

Definition at line 160 of file platform_osx.h.

bool platform_umount ( const char *  mountpoint,
const bool  lazy 
)
inline

Definition at line 72 of file platform_osx.h.

int platform_umount_lazy ( const char *  mountpoint)
inline

Definition at line 79 of file platform_osx.h.

bool read_line ( FILE *  f,
std::string *  line 
)
inline

Definition at line 241 of file platform_osx.h.