rmt.h revision 1.8 1 1.8 dholland /* $NetBSD: rmt.h,v 1.8 2016/01/22 23:15:58 dholland Exp $ */
2 1.1 jtc
3 1.1 jtc /*
4 1.1 jtc * rmt.h
5 1.1 jtc *
6 1.1 jtc * Added routines to replace open(), close(), lseek(), ioctl(), etc.
7 1.1 jtc * The preprocessor can be used to remap these the rmtopen(), etc
8 1.1 jtc * thus minimizing source changes.
9 1.1 jtc *
10 1.1 jtc * This file must be included before <sys/stat.h>, since it redefines
11 1.1 jtc * stat to be rmtstat, so that struct stat xyzzy; declarations work
12 1.1 jtc * properly.
13 1.1 jtc *
14 1.1 jtc * -- Fred Fish (w/some changes by Arnold Robbins)
15 1.1 jtc */
16 1.1 jtc
17 1.2 jtc #ifndef _RMT_H_
18 1.2 jtc #define _RMT_H_
19 1.1 jtc
20 1.3 thorpej #include <sys/cdefs.h>
21 1.8 dholland #include <sys/types.h>
22 1.3 thorpej
23 1.7 christos #if _FORTIFY_SOURCE > 0
24 1.7 christos #define __ssp_weak_name(x) rmt ## x
25 1.7 christos #include <ssp/unistd.h>
26 1.7 christos #endif
27 1.7 christos
28 1.3 thorpej __BEGIN_DECLS
29 1.6 enami int isrmt(int);
30 1.5 perry int rmtaccess(const char *, int);
31 1.5 perry int rmtclose(int);
32 1.5 perry int rmtcreat(const char *, mode_t);
33 1.5 perry int rmtdup(int);
34 1.5 perry int rmtfcntl(int, int, ...);
35 1.5 perry int rmtfstat(int, struct stat *);
36 1.5 perry int rmtioctl(int, unsigned long, ...);
37 1.5 perry int rmtisatty(int);
38 1.5 perry off_t rmtlseek(int, off_t, int);
39 1.5 perry int rmtlstat(const char *, struct stat *);
40 1.5 perry int rmtopen(const char *, int, ...);
41 1.5 perry ssize_t rmtread(int, void *, size_t);
42 1.5 perry int rmtstat(const char *, struct stat *);
43 1.5 perry ssize_t rmtwrite(int, const void *, size_t);
44 1.3 thorpej __END_DECLS
45 1.3 thorpej
46 1.3 thorpej #ifndef __RMTLIB_PRIVATE /* don't remap if building librmt */
47 1.1 jtc #define access rmtaccess
48 1.1 jtc #define close rmtclose
49 1.1 jtc #define creat rmtcreat
50 1.1 jtc #define dup rmtdup
51 1.1 jtc #define fcntl rmtfcntl
52 1.1 jtc #define fstat rmtfstat
53 1.1 jtc #define ioctl rmtioctl
54 1.1 jtc #define isatty rmtisatty
55 1.1 jtc #define lseek rmtlseek
56 1.1 jtc #define lstat rmtlstat
57 1.1 jtc #define open rmtopen
58 1.7 christos #if __SSP_FORTIFY_LEVEL == 0
59 1.1 jtc #define read rmtread
60 1.7 christos #endif
61 1.1 jtc #define stat rmtstat
62 1.1 jtc #define write rmtwrite
63 1.3 thorpej #endif /* __RMTLIB_PRIVATE */
64 1.1 jtc
65 1.2 jtc #endif /* _RMT_H_ */
66