[BACK]Return to rmt.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / include

Annotation of src/include/rmt.h, Revision 1.8

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

CVSweb <webmaster@jp.NetBSD.org>