Home | History | Annotate | Line # | Download | only in include
rmt.h revision 1.7
      1  1.7  christos /*	$NetBSD: rmt.h,v 1.7 2011/02/16 19:29:35 christos 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.7  christos #if _FORTIFY_SOURCE > 0
     23  1.7  christos #define __ssp_weak_name(x)	rmt ## x
     24  1.7  christos #include <ssp/unistd.h>
     25  1.7  christos #endif
     26  1.7  christos 
     27  1.3   thorpej __BEGIN_DECLS
     28  1.6     enami int	isrmt(int);
     29  1.5     perry int	rmtaccess(const char *, int);
     30  1.5     perry int	rmtclose(int);
     31  1.5     perry int	rmtcreat(const char *, mode_t);
     32  1.5     perry int	rmtdup(int);
     33  1.5     perry int	rmtfcntl(int, int, ...);
     34  1.5     perry int	rmtfstat(int, struct stat *);
     35  1.5     perry int	rmtioctl(int, unsigned long, ...);
     36  1.5     perry int	rmtisatty(int);
     37  1.5     perry off_t	rmtlseek(int, off_t, int);
     38  1.5     perry int	rmtlstat(const char *, struct stat *);
     39  1.5     perry int	rmtopen(const char *, int, ...);
     40  1.5     perry ssize_t	rmtread(int, void *, size_t);
     41  1.5     perry int	rmtstat(const char *, struct stat *);
     42  1.5     perry ssize_t	rmtwrite(int, const void *, size_t);
     43  1.3   thorpej __END_DECLS
     44  1.3   thorpej 
     45  1.3   thorpej #ifndef __RMTLIB_PRIVATE	/* don't remap if building librmt */
     46  1.1       jtc #define access rmtaccess
     47  1.1       jtc #define close rmtclose
     48  1.1       jtc #define creat rmtcreat
     49  1.1       jtc #define dup rmtdup
     50  1.1       jtc #define fcntl rmtfcntl
     51  1.1       jtc #define fstat rmtfstat
     52  1.1       jtc #define ioctl rmtioctl
     53  1.1       jtc #define isatty rmtisatty
     54  1.1       jtc #define lseek rmtlseek
     55  1.1       jtc #define lstat rmtlstat
     56  1.1       jtc #define open rmtopen
     57  1.7  christos #if __SSP_FORTIFY_LEVEL == 0
     58  1.1       jtc #define read rmtread
     59  1.7  christos #endif
     60  1.1       jtc #define stat rmtstat
     61  1.1       jtc #define write rmtwrite
     62  1.3   thorpej #endif /* __RMTLIB_PRIVATE */
     63  1.1       jtc 
     64  1.2       jtc #endif /* _RMT_H_ */
     65