diff options
Diffstat (limited to 'util/nvmutil/include/common.h')
| -rw-r--r-- | util/nvmutil/include/common.h | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/util/nvmutil/include/common.h b/util/nvmutil/include/common.h index f9a4ba1c..8e8ee96c 100644 --- a/util/nvmutil/include/common.h +++ b/util/nvmutil/include/common.h @@ -7,13 +7,9 @@ #ifndef COMMON_H #define COMMON_H -/* keep SYS_RENAME 1 to - * use libc rename() - * recommended - */ -#ifndef SYS_RENAME -#define SYS_RENAME 1 -#endif +#include <sys/types.h> +#include <sys/stat.h> +#include <limits.h> #define items(x) (sizeof((x)) / sizeof((x)[0])) @@ -39,7 +35,7 @@ int fchmod(int fd, mode_t mode); #define MAX_CMD_LEN 50 #ifndef PATH_LEN -#define PATH_LEN 1024 +#define PATH_LEN 4096 #endif #define OFF_ERR 0 @@ -63,10 +59,6 @@ int fchmod(int fd, mode_t mode); #define HAVE_REAL_PREAD_PWRITE 0 #endif -#ifndef MAX_EAGAIN_RETRIES -#define MAX_EAGAIN_RETRIES 100000 -#endif - #ifndef LOOP_EAGAIN #define LOOP_EAGAIN 1 #endif @@ -412,7 +404,7 @@ int check_file(int fd, struct stat *st); long rw_over_nrw(long r, unsigned long nrw); #if !defined(HAVE_REAL_PREAD_PWRITE) || \ HAVE_REAL_PREAD_PWRITE < 1 -off_t lseek_loop(int fd, off_t off, +off_t lseek_on_eintr(int fd, off_t off, int whence, int loop_eagain, int loop_eintr); #endif int try_err(int loop_err, int errval); @@ -429,16 +421,10 @@ const char *getnvmprogname(void); */ char *new_tmpfile(int *fd, int local, const char *path); -int x_i_mkstemp(char *template); -char *x_c_strrchr(const char *s, int c); -int x_i_rename(const char *src, const char *dst); +int mkstemp_n(char *template); char *x_c_tmpdir(void); -int x_i_close(int fd); -void *x_v_memcpy(void *dst, - const void *src, unsigned long n); -int x_i_memcmp(const void *a, - const void *b, unsigned long n); -int x_i_fsync(int fd); +int close_on_eintr(int fd); +int fsync_on_eintr(int fd); /* asserts */ |
