sbin/newfs_msdos: sync with NetBSD-8
[minix3.git] / include / rmt.h
blob0b32b46699af29dadfb150cc4a2c17024109f24d
1 /* $NetBSD: rmt.h,v 1.7 2011/02/16 19:29:35 christos Exp $ */
3 /*
4 * rmt.h
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
12 * properly.
14 * -- Fred Fish (w/some changes by Arnold Robbins)
17 #ifndef _RMT_H_
18 #define _RMT_H_
20 #include <sys/cdefs.h>
22 #if _FORTIFY_SOURCE > 0
23 #define __ssp_weak_name(x) rmt ## x
24 #include <ssp/unistd.h>
25 #endif
27 __BEGIN_DECLS
28 int isrmt(int);
29 int rmtaccess(const char *, int);
30 int rmtclose(int);
31 int rmtcreat(const char *, mode_t);
32 int rmtdup(int);
33 int rmtfcntl(int, int, ...);
34 int rmtfstat(int, struct stat *);
35 int rmtioctl(int, unsigned long, ...);
36 int rmtisatty(int);
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);
43 __END_DECLS
45 #ifndef __RMTLIB_PRIVATE /* don't remap if building librmt */
46 #define access rmtaccess
47 #define close rmtclose
48 #define creat rmtcreat
49 #define dup rmtdup
50 #define fcntl rmtfcntl
51 #define fstat rmtfstat
52 #define ioctl rmtioctl
53 #define isatty rmtisatty
54 #define lseek rmtlseek
55 #define lstat rmtlstat
56 #define open rmtopen
57 #if __SSP_FORTIFY_LEVEL == 0
58 #define read rmtread
59 #endif
60 #define stat rmtstat
61 #define write rmtwrite
62 #endif /* __RMTLIB_PRIVATE */
64 #endif /* _RMT_H_ */