rmt.h revision 1.5 1 1.5 perry /* $NetBSD: rmt.h,v 1.5 2005/02/03 04:39:32 perry 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.3 thorpej
22 1.3 thorpej __BEGIN_DECLS
23 1.5 perry int rmtaccess(const char *, int);
24 1.5 perry int rmtclose(int);
25 1.5 perry int rmtcreat(const char *, mode_t);
26 1.5 perry int rmtdup(int);
27 1.5 perry int rmtfcntl(int, int, ...);
28 1.5 perry int rmtfstat(int, struct stat *);
29 1.5 perry int rmtioctl(int, unsigned long, ...);
30 1.5 perry int rmtisatty(int);
31 1.5 perry off_t rmtlseek(int, off_t, int);
32 1.5 perry int rmtlstat(const char *, struct stat *);
33 1.5 perry int rmtopen(const char *, int, ...);
34 1.5 perry ssize_t rmtread(int, void *, size_t);
35 1.5 perry int rmtstat(const char *, struct stat *);
36 1.5 perry ssize_t rmtwrite(int, const void *, size_t);
37 1.3 thorpej __END_DECLS
38 1.3 thorpej
39 1.3 thorpej #ifndef __RMTLIB_PRIVATE /* don't remap if building librmt */
40 1.1 jtc #define access rmtaccess
41 1.1 jtc #define close rmtclose
42 1.1 jtc #define creat rmtcreat
43 1.1 jtc #define dup rmtdup
44 1.1 jtc #define fcntl rmtfcntl
45 1.1 jtc #define fstat rmtfstat
46 1.1 jtc #define ioctl rmtioctl
47 1.1 jtc #define isatty rmtisatty
48 1.1 jtc #define lseek rmtlseek
49 1.1 jtc #define lstat rmtlstat
50 1.1 jtc #define open rmtopen
51 1.1 jtc #define read rmtread
52 1.1 jtc #define stat rmtstat
53 1.1 jtc #define write rmtwrite
54 1.3 thorpej #endif /* __RMTLIB_PRIVATE */
55 1.1 jtc
56 1.2 jtc #endif /* _RMT_H_ */
57