• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

include/posix/sys/mman.h

00001 /*
00002  * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef _XENO_POSIX_SYS_MMAN_H
00020 #define _XENO_POSIX_SYS_MMAN_H
00021 
00022 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00023 
00024 #include <nucleus/xenomai.h>
00025 
00026 #ifdef __KERNEL__
00027 #include <asm/mman.h>
00028 #endif /* __KERNEL__ */
00029 
00030 #ifdef __XENO_SIM__
00031 #include_next <sys/mman.h>
00032 #include <posix_overrides.h>
00033 #endif /* __XENO_SIM__ */
00034 
00035 #define MAP_FAILED ((void *) -1)
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 int shm_open(const char *name, int oflag, mode_t mode);
00042 
00043 int shm_unlink(const char *name);
00044 
00045 void *mmap(void *addr, size_t len, int prot, int flags,
00046            int fildes, off_t off);
00047 
00048 int munmap(void *addr, size_t len);
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053 
00054 #else /* !(__KERNEL__ || __XENO_SIM__) */
00055 
00056 #include_next <sys/mman.h>
00057 
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif
00061 
00062 int __real_shm_open(const char *name, int oflag, mode_t mode);
00063 
00064 int __real_shm_unlink(const char *name);
00065 
00066 void *__real_mmap(void *addr,
00067                   size_t len,
00068                   int prot,
00069                   int flags,
00070                   int fildes,
00071                   long off);
00072 
00073 #if defined(_LARGEFILE64_SOURCE) \
00074         || defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
00075 void *__real_mmap64(void *addr,
00076                     size_t len,
00077                     int prot,
00078                     int flags,
00079                     int fildes,
00080                     long long off);
00081 #endif
00082 
00083 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
00084 #define __real_mmap __real_mmap64
00085 #endif
00086 
00087 int __real_munmap(void *addr, size_t len);
00088 
00089 #ifdef __cplusplus
00090 }
00091 #endif
00092 
00093 #endif /* !(__KERNEL__ || __XENO_SIM__) */
00094 
00095 #endif /* _XENO_POSIX_SYS_MMAN_H */

Generated on Wed Jan 23 2013 13:24:01 for Xenomai API by  doxygen 1.7.1