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

File: [cvs.NetBSD.org] / src / include / rmt.h (download)

Revision 1.8, Fri Jan 22 23:15:58 2016 UTC (4 years, 5 months ago) by dholland
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, HEAD
Changes since 1.7: +2 -1 lines

Needs sys/types.h for mode_t, off_t, ssize_t, and others.

/*	$NetBSD: rmt.h,v 1.8 2016/01/22 23:15:58 dholland Exp $	*/

 *	rmt.h
 *	Added routines to replace open(), close(), lseek(), ioctl(), etc.
 *	The preprocessor can be used to remap these the rmtopen(), etc
 *	thus minimizing source changes.
 *	This file must be included before <sys/stat.h>, since it redefines
 *	stat to be rmtstat, so that struct stat xyzzy; declarations work
 *	properly.
 *	-- Fred Fish (w/some changes by Arnold Robbins)

#ifndef _RMT_H_
#define _RMT_H_

#include <sys/cdefs.h>
#include <sys/types.h>

#define __ssp_weak_name(x)	rmt ## x
#include <ssp/unistd.h>

int	isrmt(int);
int	rmtaccess(const char *, int);
int	rmtclose(int);
int	rmtcreat(const char *, mode_t);
int	rmtdup(int);
int	rmtfcntl(int, int, ...);
int	rmtfstat(int, struct stat *);
int	rmtioctl(int, unsigned long, ...);
int	rmtisatty(int);
off_t	rmtlseek(int, off_t, int);
int	rmtlstat(const char *, struct stat *);
int	rmtopen(const char *, int, ...);
ssize_t	rmtread(int, void *, size_t);
int	rmtstat(const char *, struct stat *);
ssize_t	rmtwrite(int, const void *, size_t);

#ifndef __RMTLIB_PRIVATE	/* don't remap if building librmt */
#define access rmtaccess
#define close rmtclose
#define creat rmtcreat
#define dup rmtdup
#define fcntl rmtfcntl
#define fstat rmtfstat
#define ioctl rmtioctl
#define isatty rmtisatty
#define lseek rmtlseek
#define lstat rmtlstat
#define open rmtopen
#define read rmtread
#define stat rmtstat
#define write rmtwrite
#endif /* __RMTLIB_PRIVATE */

#endif /* _RMT_H_ */