Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ././../../../../../../usr/man/man2/mprotect.2
Real path: /usr/share/man/man2/mprotect.2
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 1992, The X/Open Company Ltd. All rights reserved. .\" Portions Copyright (c) 1996, 2023, Oracle and/or its affiliates. .\" Oracle gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH mprotect 2 "30 Jan 2023" "Oracle Solaris 11.4" "System Calls" .SH NAME mprotect \- set protection of memory mapping .SH SYNOPSIS .LP .nf #include <sys/mman.h> \fBint\fR \fBmprotect\fR(\fBvoid *\fR\fIaddr\fR, \fBsize_t\fR \fIlen\fR, \fBint\fR \fIprot\fR); .fi .SH DESCRIPTION .sp .LP The \fBmprotect()\fR function changes the access protections on the mappings specified by the range [\fIaddr, addr + len\fR\|), rounding \fIlen\fR up to the next multiple of the page size as returned by \fBsysconf\fR(3C), to be that specified by \fIprot\fR. The \fIaddr\fR argument must be a multiple of the pagesize as returned by \fBsysconf\fR(3C). Legitimate values for \fIprot\fR are the same as those permitted for \fBmmap\fR(2) and are defined in <\fBsys/mman.h\fR> as: .sp .ne 2 .mk .na \fB\fBPROT_READ\fR\fR .ad .RS 14n .rt \fB/* page can be read */\fR .RE .sp .ne 2 .mk .na \fB\fBPROT_WRITE\fR\fR .ad .RS 14n .rt \fB/* page can be written */\fR .RE .sp .ne 2 .mk .na \fB\fBPROT_EXEC\fR\fR .ad .RS 14n .rt \fB/* page can be executed */\fR .RE .sp .ne 2 .mk .na \fB\fBPROT_NONE\fR\fR .ad .RS 14n .rt \fB/* page can not be accessed */\fR .RE .sp .LP When \fBmprotect()\fR fails for reasons other than \fBEINVAL\fR, the protections on some of the pages in the range [\fIaddr, addr + len\fR) may have been changed. If the error occurs on some page at \fIaddr2\fR, then the protections of all whole pages in the range [\fIaddr, addr2\fR] will have been modified. .SH RETURN VALUES .sp .LP Upon successful completion, \fBmprotect()\fR returns \fB0\fR. Otherwise, it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error. .SH ERRORS .sp .LP The \fBmprotect()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEACCES\fR\fR .ad .RS 10n .rt The \fIprot\fR argument specifies a protection that violates the access permission the process has to the underlying memory object. .sp There are addresses in the range [\fIaddr, addr + len\fR) which are part of a \fBshmget_osm\fR(2) created shared memory segment, and the \fIprot\fR argument would change the permissions of the segment. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIlen\fR argument has a value equal to 0, or \fIaddr\fR is not a multiple of the page size as returned by \fBsysconf\fR(3C). .RE .sp .ne 2 .mk .na \fB\fBENOMEM\fR\fR .ad .RS 10n .rt Addresses in the range [\fIaddr, addr + len\fR) are invalid for the address space of a process, or specify one or more pages which are not mapped. .RE .sp .LP The \fBmprotect()\fR function may fail if: .sp .ne 2 .mk .na \fB\fBEAGAIN\fR\fR .ad .RS 10n .rt The address range [\fIaddr, addr + len\fR) includes one or more pages that have been locked in memory and that were mapped \fBMAP_PRIVATE\fR; \fIprot\fR includes \fBPROT_WRITE\fR; and the system has insufficient resources to reserve memory for the private pages that may be created. These private pages may be created by store operations in the now-writable address range. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ Standard See \fBstandards\fR(7). .TE .sp .SH SEE ALSO .sp .LP \fBmmap\fR(2), \fBmemcntl\fR(2), \fBmlock\fR(3C), \fBmlockall\fR(3C), \fBplock\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(7), \fBstandards\fR(7) .SH HISTORY .sp .LP The \fBmprotect()\fR function has been included in all Sun and Oracle releases of Solaris.