Commit a896ed39 authored by Tudor Bosman's avatar Tudor Bosman Committed by Owen Yamauchi

add openNoInt, truncateNoInt, ftruncateNoInt

Test Plan: it compiles

Reviewed By: soren@fb.com

FB internal diff: D825286
parent 2ba26b05
......@@ -24,6 +24,10 @@ namespace folly {
using namespace fileutil_detail;
int openNoInt(const char* name, int flags, mode_t mode) {
return wrapNoInt(open, name, flags, mode);
}
int closeNoInt(int fd) {
int r = close(fd);
// Ignore EINTR. On Linux, close() may only return EINTR after the file
......@@ -49,6 +53,14 @@ int fdatasyncNoInt(int fd) {
return wrapNoInt(fdatasync, fd);
}
int ftruncateNoInt(int fd, off_t len) {
return wrapNoInt(ftruncate, fd, len);
}
int truncateNoInt(const char* path, off_t len) {
return wrapNoInt(truncate, path, len);
}
ssize_t readNoInt(int fd, void* buf, size_t count) {
return wrapNoInt(read, fd, buf, count);
}
......
......@@ -19,7 +19,10 @@
#include "folly/Portability.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <fcntl.h>
#include <unistd.h>
namespace folly {
......@@ -30,9 +33,12 @@ namespace folly {
* until all data is written. Note that *Full wrappers weaken the thread
* semantics of underlying system calls.
*/
int openNoInt(const char* name, int flags, mode_t mode=0644);
int closeNoInt(int fd);
int fsyncNoInt(int fd);
int fdatasyncNoInt(int fd);
int ftruncateNoInt(int fd, off_t len);
int truncateNoInt(const char* path, off_t len);
ssize_t readNoInt(int fd, void* buf, size_t n);
ssize_t preadNoInt(int fd, void* buf, size_t n, off_t offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment