epoc32/include/stdapis/sys/mman.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/stdapis/sys/mman.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/sys/mman.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,125 @@
     1.4 -mman.h
     1.5 +/*-
     1.6 + * Copyright (c) 1982, 1986, 1993
     1.7 + *	The Regents of the University of California.  All rights reserved.
     1.8 + * © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
     1.9 + *
    1.10 + * Redistribution and use in source and binary forms, with or without
    1.11 + * modification, are permitted provided that the following conditions
    1.12 + * are met:
    1.13 + * 1. Redistributions of source code must retain the above copyright
    1.14 + *    notice, this list of conditions and the following disclaimer.
    1.15 + * 2. Redistributions in binary form must reproduce the above copyright
    1.16 + *    notice, this list of conditions and the following disclaimer in the
    1.17 + *    documentation and/or other materials provided with the distribution.
    1.18 + * 4. Neither the name of the University nor the names of its contributors
    1.19 + *    may be used to endorse or promote products derived from this software
    1.20 + *    without specific prior written permission.
    1.21 + *
    1.22 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    1.23 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.24 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.25 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    1.26 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.27 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.28 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.29 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.30 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.31 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.32 + * SUCH DAMAGE.
    1.33 + * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
    1.34 + *	@(#)mman.h	8.2 (Berkeley) 1/9/95
    1.35 + * $FreeBSD: src/sys/sys/mman.h,v 1.40 2005/04/02 12:33:31 das Exp $
    1.36 + */
    1.37 +
    1.38 +#ifndef _SYS_MMAN_H_
    1.39 +#define _SYS_MMAN_H_
    1.40 +#ifdef __cplusplus
    1.41 + extern "C" 
    1.42 + { 
    1.43 +  #endif
    1.44 +
    1.45 +#include <sys/cdefs.h>
    1.46 +#include <sys/_types.h>
    1.47 +
    1.48 +#if __BSD_VISIBLE
    1.49 +/*
    1.50 + * Inheritance for minherit()
    1.51 + */
    1.52 +#define INHERIT_SHARE	0
    1.53 +#define INHERIT_COPY	1
    1.54 +#define INHERIT_NONE	2
    1.55 +#endif
    1.56 +
    1.57 +/*
    1.58 + * Protections are chosen from these bits, or-ed together
    1.59 + */
    1.60 +#define	PROT_NONE	0x00	/* no permissions */
    1.61 +#define	PROT_READ	0x01	/* pages can be read */
    1.62 +#define	PROT_WRITE	0x02	/* pages can be written */
    1.63 +#define	PROT_EXEC	0x04	/* pages can be executed */
    1.64 +
    1.65 +/*
    1.66 + * Flags contain sharing type and options.
    1.67 + * Sharing types; choose one.
    1.68 + */
    1.69 +#define	MAP_SHARED	0x0001		/* share changes */
    1.70 +#define	MAP_PRIVATE	0x0002		/* changes are private */
    1.71 +#if __BSD_VISIBLE
    1.72 +#define	MAP_COPY	MAP_PRIVATE	/* Obsolete */
    1.73 +#endif
    1.74 +
    1.75 +/*
    1.76 + * Other flags
    1.77 + */
    1.78 +#define	MAP_FIXED	 0x0010	/* map addr must be exactly as requested */
    1.79 +
    1.80 +/*
    1.81 + * Error return from mmap()
    1.82 + */
    1.83 +#define MAP_FAILED	((void *)-1)
    1.84 +
    1.85 +/*
    1.86 + * msync() flags
    1.87 + */
    1.88 +#define	MS_SYNC		0x0000	/* msync synchronously */
    1.89 +#define MS_ASYNC	0x0001	/* return immediately */
    1.90 +#define MS_INVALIDATE	0x0002	/* invalidate all cached data */
    1.91 +
    1.92 +#ifndef _MODE_T_DECLARED
    1.93 +typedef	__mode_t	mode_t;
    1.94 +#define	_MODE_T_DECLARED
    1.95 +#endif
    1.96 +
    1.97 +#ifndef _OFF_T_DECLARED
    1.98 +typedef	__off_t		off_t;
    1.99 +#define	_OFF_T_DECLARED
   1.100 +#endif
   1.101 +
   1.102 +#ifndef _SIZE_T_DECLARED
   1.103 +typedef	__size_t	size_t;
   1.104 +#define	_SIZE_T_DECLARED
   1.105 +#endif
   1.106 +
   1.107 +#ifndef _KERNEL
   1.108 +
   1.109 +__BEGIN_DECLS
   1.110 +/*
   1.111 + * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
   1.112 + * posix_typed_mem_open().
   1.113 + */
   1.114 +#ifndef _MMAP_DECLARED
   1.115 +#define	_MMAP_DECLARED
   1.116 +IMPORT_C void *	mmap(void *, size_t, int, int, int, off_t);
   1.117 +#endif
   1.118 +IMPORT_C int	mprotect(const void *, size_t, int);
   1.119 +IMPORT_C int	msync(void *, size_t, int);
   1.120 +IMPORT_C int	munmap(void *, size_t);
   1.121 +__END_DECLS
   1.122 +
   1.123 +#endif /* !_KERNEL */
   1.124 +
   1.125 +#ifdef __cplusplus
   1.126 +}
   1.127 +#endif	//__cplusplus
   1.128 +
   1.129 +#endif /* !_SYS_MMAN_H_ */