1 /* $NetBSD: rmt.h,v 1.7 2011/02/16 19:29:35 christos Exp $ */
6 * Added routines to replace open(), close(), lseek(), ioctl(), etc.
7 * The preprocessor can be used to remap these the rmtopen(), etc
8 * thus minimizing source changes.
10 * This file must be included before <sys/stat.h>, since it redefines
11 * stat to be rmtstat, so that struct stat xyzzy; declarations work
14 * -- Fred Fish (w/some changes by Arnold Robbins)
20 #include <sys/cdefs.h>
22 #if _FORTIFY_SOURCE > 0
23 #define __ssp_weak_name(x) rmt ## x
24 #include <ssp/unistd.h>
29 int rmtaccess(const char *, int);
31 int rmtcreat(const char *, mode_t
);
33 int rmtfcntl(int, int, ...);
34 int rmtfstat(int, struct stat
*);
35 int rmtioctl(int, unsigned long, ...);
37 off_t
rmtlseek(int, off_t
, int);
38 int rmtlstat(const char *, struct stat
*);
39 int rmtopen(const char *, int, ...);
40 ssize_t
rmtread(int, void *, size_t);
41 int rmtstat(const char *, struct stat
*);
42 ssize_t
rmtwrite(int, const void *, size_t);
45 #ifndef __RMTLIB_PRIVATE /* don't remap if building librmt */
46 #define access rmtaccess
47 #define close rmtclose
48 #define creat rmtcreat
50 #define fcntl rmtfcntl
51 #define fstat rmtfstat
52 #define ioctl rmtioctl
53 #define isatty rmtisatty
54 #define lseek rmtlseek
55 #define lstat rmtlstat
57 #if __SSP_FORTIFY_LEVEL == 0
61 #define write rmtwrite
62 #endif /* __RMTLIB_PRIVATE */