summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/include/common.h')
-rw-r--r--util/libreboot-utils/include/common.h38
1 files changed, 3 insertions, 35 deletions
diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h
index a08dec08..d08828df 100644
--- a/util/libreboot-utils/include/common.h
+++ b/util/libreboot-utils/include/common.h
@@ -13,18 +13,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
-#include <errno.h>
-
-/* for linux getrandom
- */
-#if defined(__linux__)
-#include <sys/random.h>
-#include <sys/syscall.h>
-#endif
-
-#ifdef __OpenBSD__ /* for pledge */
-#include <unistd.h>
-#endif
/* dangerously cool macros:
*/
@@ -46,11 +34,6 @@
#define items(x) (sizeof((x)) / sizeof((x)[0]))
-/* system prototypes
- */
-
-int fchmod(int fd, mode_t mode);
-
#define MKHTEMP_RETRY_MAX 512
#define MKHTEMP_SPIN_THRESHOLD 32
@@ -100,10 +83,6 @@ int fchmod(int fd, mode_t mode);
#error "Unexpected bit layout"
#endif
-#ifndef MAX_ZERO_RW_RETRY
-#define MAX_ZERO_RW_RETRY 5
-#endif
-
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
@@ -478,25 +457,14 @@ ssize_t rw_gbe_file_exact(int fd, unsigned char *mem, size_t nrw,
*/
int fsync_dir(const char *path);
-ssize_t rw_file_exact(int fd, unsigned char *mem, size_t len,
- off_t off, int rw_type, size_t max_retries);
+ssize_t rw_exact(int fd, unsigned char *mem, size_t len,
+ off_t off, int rw_type);
ssize_t rw(int fd, void *mem, size_t nrw,
off_t off, int rw_type);
int io_args(int fd, void *mem, size_t nrw,
off_t off, int rw_type);
int check_file(int fd, struct stat *st);
ssize_t rw_over_nrw(ssize_t r, size_t nrw);
-off_t lseek_on_eintr(int fd, off_t off,
- int whence);
-ssize_t read_on_eintr(int fd,
- void *buf, size_t count);
-ssize_t write_on_eintr(int fd,
- void *buf, size_t count);
-ssize_t pread_on_eintr(int fd,
- void *buf, size_t count, off_t off);
-ssize_t pwrite_on_eintr(int fd,
- void *buf, size_t count, off_t off);
-int off_retry(int saved_errno, off_t rval);
int sys_retry(int saved_errno, long rval);
int fs_retry(int saved_errno, int rval);
int rw_retry(int saved_errno, ssize_t rval);
@@ -554,7 +522,7 @@ int secure_file(int *fd,
int check_seek,
int do_lock,
mode_t mode);
-void close_on_eintr(int *fd);
+void xclose(int *fd);
int fsync_on_eintr(int fd);
int fs_rename_at(int olddirfd, const char *old,
int newdirfd, const char *new);