27 #include <sys/locking.h> 36 #define _SC_PAGESIZE 1 37 #define _SC_PAGE_SIZE _SC_PAGESIZE 38 #define _SC_NPROCESSORS_ONLN 2 39 #define _SC_NPROCESSORS_CONF 2 43 #define STDIN_FILENO 0 44 #define STDOUT_FILENO 1 45 #define STDERR_FILENO 2 55 #define F_LOCK _LK_LOCK 56 #define F_ULOCK _LK_UNLCK 59 namespace portability {
61 int access(
char const* fn,
int am);
62 int chdir(
const char* path);
65 int dup2(
int fhs,
int fhd);
67 int ftruncate(
int fd, off_t len);
68 char* getcwd(
char* buf,
int sz);
75 int lockf(
int fd,
int cmd, off_t len);
76 off_t lseek(
int fh, off_t off,
int orig);
77 ssize_t
read(
int fh,
void* buf,
size_t mcc);
78 int rmdir(
const char* path);
80 ssize_t pread(
int fd,
void* buf,
size_t count, off_t offset);
81 ssize_t pwrite(
int fd,
const void* buf,
size_t count, off_t offset);
82 ssize_t readlink(
const char* path,
char* buf,
size_t buflen);
83 void* sbrk(intptr_t
i);
84 unsigned int sleep(
unsigned int seconds);
86 int truncate(
const char* path, off_t len);
87 int usleep(
unsigned int ms);
88 ssize_t
write(
int fh,
void const* buf,
size_t count);
93 using namespace folly::portability::unistd;
void write(const T &in, folly::io::Appender &appender)
Future< Unit > sleep(Duration dur, Timekeeper *tk)
—— Concurrent Priority Queue Implementation ——
size_t read(T &out, folly::io::Cursor &cursor)
int close(NetworkSocket s)
void pipe(CPUExecutor cpu, IOExecutor io)