Nut/OS  4.10.3
API Reference
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 
00074 #ifndef _UNISTD_NUT_H_
00075 
00076 #include <compiler.h>  // required e.g. for CONST
00077 
00078 #ifndef _UNISTD_VIRTUAL_H_
00079 #define _UNISTD_VIRTUAL_H_
00080 
00081 /* use native version on unix emulation */
00082 #ifdef __NUT_EMULATION__
00083 
00084 #include "unistd_orig.h"
00085 
00086 // prefix all unistd calls with NUT_
00087 #define access(...) NUT_access(__VA_ARGS__)
00088 #define lseek(...) NUT_lseek(__VA_ARGS__)
00089 #define rmdir(...) NUT_rmdir(__VA_ARGS__)
00090 #define unlink(...) NUT_unlink(__VA_ARGS__)
00091 
00092 #define sleep(...) NUT_sleep(__VA_ARGS__)
00093 
00094 /* assure _UNISTD_H_ is set */
00095 #undef  _UNISTD_H_
00096 #define _UNISTD_H_
00097 
00098 #define _UNISTD_H_
00099 
00100 #else /* unix emulation */
00101 
00106 #define F_OK        0       
00107 #define X_OK        0x01    
00108 #define W_OK        0x02    
00109 #define R_OK        0x04    
00111 
00112 #endif /* unix emulation */
00113 
00114 __BEGIN_DECLS
00115 /* */
00116 extern int access(CONST char *path, int what);
00117 extern long lseek(int fh, long pos, int whence);
00118 extern int rmdir(CONST char *path);
00119 extern int unlink(CONST char *path);
00120 
00121 extern unsigned int sleep(unsigned int);
00122 __END_DECLS
00123 /* */
00124 
00125 
00126 #endif /* _UNISTD_VIRTUAL_H_ */
00127 
00128 #endif /* _UNISTD_H */