unistd.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2005 by egnite Software GmbH. All rights reserved.
00003  *
00004  * Copyright (c) 1991 The Regents of the University of California.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. Neither the name of the University nor the names of its contributors
00016  *    may be used to endorse or promote products derived from this software
00017  *    without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00020  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00022  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00023  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00024  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00025  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00026  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00027  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00028  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00029  * SUCH DAMAGE.
00030  *
00031  * For additional information see http://www.ethernut.de/
00032  *
00033  */
00034 
00065 #ifndef _UNISTD_H_
00066 
00067 #include <compiler.h>  // required e.g. for CONST
00068 
00069 #ifndef _UNISTD_VIRTUAL_H_
00070 #define _UNISTD_VIRTUAL_H_
00071 
00072 /* use native version on unix emulation */
00073 #if defined(__linux__) || defined(__APPLE__)
00074 
00075 #include "unistd_orig.h"
00076 
00077 // prefix all unistd calls with NUT_
00078 #define access(...) NUT_access(__VA_ARGS__)
00079 #define lseek(...) NUT_lseek(__VA_ARGS__)
00080 #define rmdir(...) NUT_rmdir(__VA_ARGS__)
00081 #define unlink(...) NUT_unlink(__VA_ARGS__)
00082 
00083 /* assure _UNISTD_H_ is set */
00084 #undef  _UNISTD_H_
00085 #define _UNISTD_H_
00086 
00087 #define _UNISTD_H_
00088 
00089 #endif /* unix emulation */
00090 
00091 __BEGIN_DECLS
00092 /* */
00093 extern int access(CONST char *path, int what);
00094 extern long lseek(int fh, long pos, int whence);
00095 extern int rmdir(CONST char *path);
00096 extern int unlink(CONST char *path);
00097 __END_DECLS
00098 /* */
00099 
00100 
00101 #endif /* _UNISTD_VIRTUAL_H_ */
00102 
00103 #endif /* _UNISTD_H */

© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/