source: rtems/cpukit/posix/src/mprotect.c

Last change on this file was 0a645dad, checked in by Joel Sherrill <joel@…>, on 02/16/22 at 22:31:50

cpukit/posix/src/[a-o]*.c: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup POSIXAPI
7 *
8 * @brief Change Memory Protection
9 *
10 * 12.2.3 Change Memory Protection, P1003.1b-1996, p. 277.
11 *
12 * This is not a functional version of mprotect() but the SPARC backend
13 * for at least gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to
14 * be there and return 0.
15 *
16 * As of gcc 4.2.2, the gcc SPARC backend doesn't appear to have a
17 * way to call this for RTEMS anymore but it doesn't hurt to leave it.
18 */
19
20/*
21 *  COPYRIGHT (c) 1989-2014.
22 *  On-Line Applications Research Corporation (OAR).
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 * 1. Redistributions of source code must retain the above copyright
28 *    notice, this list of conditions and the following disclaimer.
29 * 2. Redistributions in binary form must reproduce the above copyright
30 *    notice, this list of conditions and the following disclaimer in the
31 *    documentation and/or other materials provided with the distribution.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
34 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
37 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
38 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
39 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
41 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43 * POSSIBILITY OF SUCH DAMAGE.
44 */
45
46#ifdef HAVE_CONFIG_H
47#include "config.h"
48#endif
49
50#include <unistd.h>
51#include <sys/mman.h>
52
53int mprotect(
54#ifdef HAVE_MPROTECT_CONST
55  const void *addr,
56#else
57  void *addr,
58#endif
59  size_t len,
60  int prot
61)
62{
63  (void) addr;
64  (void) len;
65  (void) prot;
66  return 0;
67}
Note: See TracBrowser for help on using the repository browser.