+"The following runs show the results when employing other values for "
+"B<M_CHECK_ACTION>:"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:505
+#, no-wrap
+msgid ""
+"$ B<./a.out 1> # Diagnose error and continue\n"
+"main(): returned from first free() call\n"
+"*** glibc detected *** ./a.out: double free or corruption (top): 0x09cbe008 "
+"***\n"
+"main(): returned from second free() call\n"
+"$ B<./a.out 2> # Abort without error message\n"
+"main(): returned from first free() call\n"
+"Aborted (core dumped)\n"
+"$ B<./a.out 0> # Ignore error and continue\n"
+"main(): returned from first free() call\n"
+"main(): returned from second free() call\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:511
+msgid ""
+"The next run shows how to set the same parameter using the B<MALLOC_CHECK_> "
+"environment variable:"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:518
+#, no-wrap
+msgid ""
+"$ B<MALLOC_CHECK_=1 ./a.out>\n"
+"main(): returned from first free() call\n"
+"*** glibc detected *** ./a.out: free(): invalid pointer: 0x092c2008 ***\n"
+"main(): returned from second free() call\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:526
+#, no-wrap
+msgid ""
+"#include E<lt>malloc.hE<gt>\n"
+"#include E<lt>stdio.hE<gt>\n"
+"#include E<lt>stdlib.hE<gt>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:531 build/C/man3/mcheck.3:187
+#, no-wrap
+msgid ""
+"int\n"
+"main(int argc, char *argv[])\n"
+"{\n"
+" char *p;\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:538
+#, no-wrap
+msgid ""
+" if (argc E<gt> 1) {\n"
+" if (mallopt(M_CHECK_ACTION, atoi(argv[1])) != 1) {\n"
+" fprintf(stderr, \"mallopt() failed\");\n"
+" exit(EXIT_FAILURE);\n"
+" }\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:544
+#, no-wrap
+msgid ""
+" p = malloc(1000);\n"
+" if (p == NULL) {\n"
+" fprintf(stderr, \"malloc() failed\");\n"
+" exit(EXIT_FAILURE);\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:547
+#, no-wrap
+msgid ""
+" free(p);\n"
+" printf(\"main(): returned from first free() call\\en\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:550
+#, no-wrap
+msgid ""
+" free(p);\n"
+" printf(\"main(): returned from second free() call\\en\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mallopt.3:568
+msgid ""
+"B<mmap>(2), B<sbrk>(2), B<mallinfo>(3), B<malloc>(3), B<malloc_hook>(3), "
+"B<malloc_info>(3), B<malloc_stats>(3), B<malloc_trim>(3), B<mcheck>(3), "
+"B<mtrace>(3), B<posix_memalign>(3)"
+msgstr ""
+
+#. type: TH
+#: build/C/man3/mcheck.3:25
+#, no-wrap
+msgid "MCHECK"
+msgstr ""
+
+#. type: TH
+#: build/C/man3/mcheck.3:25
+#, no-wrap
+msgid "2014-01-11"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:28
+msgid ""
+"mcheck, mcheck_check_all, mcheck_pedantic, mprobe - heap consistency "
+"checking"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:31
+#, no-wrap
+msgid "B<#include E<lt>mcheck.hE<gt>>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:33
+#, no-wrap
+msgid "B<int mcheck(void (*>I<abortfunc>B<)(enum mcheck_status >I<mstatus>B<));>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:35
+#, no-wrap
+msgid ""
+"B<int mcheck_pedantic(void (*>I<abortfunc>B<)(enum mcheck_status "
+">I<mstatus>B<));>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:37
+#, no-wrap
+msgid "B<void mcheck_check_all(void);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:39
+#, no-wrap
+msgid "B<enum mcheck_status mprobe(void *>I<ptr>B<);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:51
+msgid ""
+"The B<mcheck>() function installs a set of debugging hooks for the "
+"B<malloc>(3) family of memory-allocation functions. These hooks cause "
+"certain consistency checks to be performed on the state of the heap. The "
+"checks can detect application errors such as freeing a block of memory more "
+"than once or corrupting the bookkeeping data structures that immediately "
+"precede a block of allocated memory."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:63
+msgid ""
+"To be effective, the B<mcheck>() function must be called before the first "
+"call to B<malloc>(3) or a related function. In cases where this is "
+"difficult to ensure, linking the program with I<-lmcheck> inserts an "
+"implicit call to B<mcheck>() (with a NULL argument) before the first call "
+"to a memory-allocation function."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:71
+msgid ""
+"The B<mcheck_pedantic>() function is similar to B<mcheck>(), but performs "
+"checks on all allocated blocks whenever one of the memory-allocation "
+"functions is called. This can be very slow!"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:78
+msgid ""
+"The B<mcheck_check_all>() function causes an immediate check on all "
+"allocated blocks. This call is effective only if B<mcheck>() is called "
+"beforehand."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:91
+msgid ""
+"If the system detects an inconsistency in the heap, the caller-supplied "
+"function pointed to by I<abortfunc> is invoked with a single argument "
+"argument, I<mstatus>, that indicates what type of inconsistency was "
+"detected. If I<abortfunc> is NULL, a default function prints an error "
+"message on I<stderr> and calls B<abort>(3)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:103
+msgid ""
+"The B<mprobe>() function performs a consistency check on the block of "
+"allocated memory pointed to by I<ptr>. The B<mcheck>() function should be "
+"called beforehand (otherwise B<mprobe>() returns B<MCHECK_DISABLED>)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:111
+msgid ""
+"The following list describes the values returned by B<mprobe>() or passed "
+"as the I<mstatus> argument when I<abortfunc> is invoked:"
+msgstr ""
+
+#. type: TP
+#: build/C/man3/mcheck.3:111
+#, no-wrap
+msgid "B<MCHECK_DISABLED> (B<mprobe>() only)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:116
+msgid ""
+"B<mcheck>() was not called before the first memory allocation function was "
+"called. Consistency checking is not possible."
+msgstr ""
+
+#. type: TP
+#: build/C/man3/mcheck.3:116
+#, no-wrap
+msgid "B<MCHECK_OK> (B<mprobe>() only)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:119
+msgid "No inconsistency detected."
+msgstr ""
+
+#. type: TP
+#: build/C/man3/mcheck.3:119
+#, no-wrap
+msgid "B<MCHECK_HEAD>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:122
+msgid "Memory preceding an allocated block was clobbered."
+msgstr ""
+
+#. type: TP
+#: build/C/man3/mcheck.3:122
+#, no-wrap
+msgid "B<MCHECK_TAIL>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:125
+msgid "Memory following an allocated block was clobbered."
+msgstr ""
+
+#. type: TP
+#: build/C/man3/mcheck.3:125
+#, no-wrap
+msgid "B<MCHECK_FREE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:129
+msgid "A block of memory was freed twice."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:134
+msgid "B<mcheck>() and B<mcheck_pedantic>() return 0 on success, or -1 on error."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:145
+msgid ""
+"The B<mcheck_pedantic>() and B<mcheck_check_all>() functions are available "
+"since glibc 2.2. The B<mcheck>() and B<mprobe>() functions are present "
+"since at least glibc 2.0"
+msgstr ""
+
+#. But is MALLOC_CHECK_ slower?
+#. type: Plain text
+#: build/C/man3/mcheck.3:159
+msgid ""
+"Linking a program with I<-lmcheck> and using the B<MALLOC_CHECK_> "
+"environment variable (described in B<mallopt>(3)) cause the same kinds of "
+"errors to be detected. But, using B<MALLOC_CHECK_> does not require the "
+"application to be relinked."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:165
+msgid ""
+"The program below calls B<mcheck>() with a NULL argument and then frees the "
+"same block of memory twice. The following shell session demonstrates what "
+"happens when running the program:"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:170
+#, no-wrap
+msgid ""
+"$B< ./a.out>\n"
+"About to free\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:174
+#, no-wrap
+msgid ""
+"About to free a second time\n"
+"block freed twice\n"
+"Aborted (core dumped)\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:182
+#, no-wrap
+msgid ""
+"#include E<lt>stdlib.hE<gt>\n"
+"#include E<lt>stdio.hE<gt>\n"
+"#include E<lt>mcheck.hE<gt>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:190
+#, no-wrap
+msgid ""
+" if (mcheck(NULL) != 0) {\n"
+" fprintf(stderr, \"mcheck() failed\\en\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:193
+#, no-wrap
+msgid ""
+" exit(EXIT_FAILURE);\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:195
+#, no-wrap
+msgid " p = malloc(1000);\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:200
+#, no-wrap
+msgid ""
+" fprintf(stderr, \"About to free\\en\");\n"
+" free(p);\n"
+" fprintf(stderr, \"\\enAbout to free a second time\\en\");\n"
+" free(p);\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man3/mcheck.3:208
+msgid "B<malloc>(3), B<mallopt>(3), B<mtrace>(3)"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mlock.2:26
+#, no-wrap
+msgid "MLOCK"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mlock.2:26
+#, no-wrap
+msgid "2014-04-14"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:29
+msgid "mlock, munlock, mlockall, munlockall - lock and unlock memory"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:32 build/C/man2/mmap.2:46 build/C/man2/mmap2.2:35 build/C/man2/mprotect.2:45 build/C/man2/mremap.2:38
+#, no-wrap
+msgid "B<#include E<lt>sys/mman.hE<gt>>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:35
+#, no-wrap
+msgid ""
+"B<int mlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
+"B<int munlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:38
+#, no-wrap
+msgid ""
+"B<int mlockall(int >I<flags>B<);>\n"
+"B<int munlockall(void);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:54
+msgid ""
+"B<mlock>() and B<mlockall>() respectively lock part or all of the calling "
+"process's virtual address space into RAM, preventing that memory from being "
+"paged to the swap area. B<munlock>() and B<munlockall>() perform the "
+"converse operation, respectively unlocking part or all of the calling "
+"process's virtual address space, so that pages in the specified virtual "
+"address range may once more to be swapped out if required by the kernel "
+"memory manager. Memory locking and unlocking are performed in units of "
+"whole pages."
+msgstr ""
+
+#. type: SS
+#: build/C/man2/mlock.2:54
+#, no-wrap
+msgid "mlock() and munlock()"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:64
+msgid ""
+"B<mlock>() locks pages in the address range starting at I<addr> and "
+"continuing for I<len> bytes. All pages that contain a part of the specified "
+"address range are guaranteed to be resident in RAM when the call returns "
+"successfully; the pages are guaranteed to stay in RAM until later unlocked."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:73
+msgid ""
+"B<munlock>() unlocks pages in the address range starting at I<addr> and "
+"continuing for I<len> bytes. After this call, all pages that contain a part "
+"of the specified memory range can be moved to external swap space again by "
+"the kernel."
+msgstr ""
+
+#. type: SS
+#: build/C/man2/mlock.2:73
+#, no-wrap
+msgid "mlockall() and munlockall()"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:83
+msgid ""
+"B<mlockall>() locks all pages mapped into the address space of the calling "
+"process. This includes the pages of the code, data and stack segment, as "
+"well as shared libraries, user space kernel data, shared memory, and "
+"memory-mapped files. All mapped pages are guaranteed to be resident in RAM "
+"when the call returns successfully; the pages are guaranteed to stay in RAM "
+"until later unlocked."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:88
+msgid ""
+"The I<flags> argument is constructed as the bitwise OR of one or more of the "
+"following constants:"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mlock.2:88
+#, no-wrap
+msgid "B<MCL_CURRENT>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:92
+msgid ""
+"Lock all pages which are currently mapped into the address space of the "
+"process."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mlock.2:92
+#, no-wrap
+msgid "B<MCL_FUTURE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:99
+msgid ""
+"Lock all pages which will become mapped into the address space of the "
+"process in the future. These could be for instance new pages required by a "
+"growing heap and stack as well as new memory-mapped files or shared memory "
+"regions."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:112
+msgid ""
+"If B<MCL_FUTURE> has been specified, then a later system call (e.g., "
+"B<mmap>(2), B<sbrk>(2), B<malloc>(3)), may fail if it would cause the number "
+"of locked bytes to exceed the permitted maximum (see below). In the same "
+"circumstances, stack growth may likewise fail: the kernel will deny stack "
+"expansion and deliver a B<SIGSEGV> signal to the process."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:116
+msgid ""
+"B<munlockall>() unlocks all pages mapped into the address space of the "
+"calling process."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:122
+msgid ""
+"On success these system calls return 0. On error, -1 is returned, I<errno> "
+"is set appropriately, and no changes are made to any locks in the address "
+"space of the process."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:131
+msgid ""
+"(Linux 2.6.9 and later) the caller had a nonzero B<RLIMIT_MEMLOCK> soft "
+"resource limit, but tried to lock more memory than the limit permitted. "
+"This limit is not enforced if the process is privileged (B<CAP_IPC_LOCK>)."
+msgstr ""
+
+#. In the case of mlock(), this check is somewhat buggy: it doesn't
+#. take into account whether the to-be-locked range overlaps with
+#. already locked pages. Thus, suppose we allocate
+#. (num_physpages / 4 + 1) of memory, and lock those pages once using
+#. mlock(), and then lock the *same* page range a second time.
+#. In the case, the second mlock() call will fail, since the check
+#. calculates that the process is trying to lock (num_physpages / 2 + 2)
+#. pages, which of course is not true. (MTK, Nov 04, kernel 2.4.28)
+#. type: Plain text
+#: build/C/man2/mlock.2:143
+msgid ""
+"(Linux 2.4 and earlier) the calling process tried to lock more than half of "
+"RAM."
+msgstr ""
+
+#. SVr4 documents an additional EAGAIN error code.
+#. type: Plain text
+#: build/C/man2/mlock.2:149
+msgid ""
+"The caller is not privileged, but needs privilege (B<CAP_IPC_LOCK>) to "
+"perform the requested operation."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:154
+msgid "For B<mlock>() and B<munlock>():"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:157
+msgid "Some or all of the specified address range could not be locked."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:164
+msgid ""
+"The result of the addition I<start>+I<len> was less than I<start> (e.g., the "
+"addition may have resulted in an overflow)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:169
+msgid "(Not on Linux) I<addr> was not a multiple of the page size."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:173
+msgid ""
+"Some of the specified address range does not correspond to mapped pages in "
+"the address space of the process."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:176
+msgid "For B<mlockall>():"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:179
+msgid "Unknown I<flags> were specified."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:182
+msgid "For B<munlockall>():"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:186
+msgid "(Linux 2.6.8 and earlier) The caller was not privileged (B<CAP_IPC_LOCK>)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:188
+msgid "POSIX.1-2001, SVr4."
+msgstr ""
+
+#. type: SH
+#: build/C/man2/mlock.2:188 build/C/man2/mmap.2:503 build/C/man2/msync.2:105
+#, no-wrap
+msgid "AVAILABILITY"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:200
+msgid ""
+"On POSIX systems on which B<mlock>() and B<munlock>() are available, "
+"B<_POSIX_MEMLOCK_RANGE> is defined in I<E<lt>unistd.hE<gt>> and the number "
+"of bytes in a page can be determined from the constant B<PAGESIZE> (if "
+"defined) in I<E<lt>limits.hE<gt>> or by calling I<sysconf(_SC_PAGESIZE)>."
+msgstr ""
+
+#. POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
+#. -1: unavailable, 0: ask using sysconf().
+#. glibc defines it to 1.
+#. type: Plain text
+#: build/C/man2/mlock.2:213
+msgid ""
+"On POSIX systems on which B<mlockall>() and B<munlockall>() are available, "
+"B<_POSIX_MEMLOCK> is defined in I<E<lt>unistd.hE<gt>> to a value greater "
+"than 0. (See also B<sysconf>(3).)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:231
+msgid ""
+"Memory locking has two main applications: real-time algorithms and "
+"high-security data processing. Real-time applications require deterministic "
+"timing, and, like scheduling, paging is one major cause of unexpected "
+"program execution delays. Real-time applications will usually also switch "
+"to a real-time scheduler with B<sched_setscheduler>(2). Cryptographic "
+"security software often handles critical bytes like passwords or secret keys "
+"as data structures. As a result of paging, these secrets could be "
+"transferred onto a persistent swap store medium, where they might be "
+"accessible to the enemy long after the security software has erased the "
+"secrets in RAM and terminated. (But be aware that the suspend mode on "
+"laptops and some desktop computers will save a copy of the system's RAM to "
+"disk, regardless of memory locks.)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:244
+msgid ""
+"Real-time processes that are using B<mlockall>() to prevent delays on page "
+"faults should reserve enough locked stack pages before entering the "
+"time-critical section, so that no page fault can be caused by function "
+"calls. This can be achieved by calling a function that allocates a "
+"sufficiently large automatic variable (an array) and writes to the memory "
+"occupied by this array in order to touch these stack pages. This way, "
+"enough pages will be mapped for the stack and can be locked into RAM. The "
+"dummy writes ensure that not even copy-on-write page faults can occur in the "
+"critical section."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:257
+msgid ""
+"Memory locks are not inherited by a child created via B<fork>(2) and are "
+"automatically removed (unlocked) during an B<execve>(2) or when the process "
+"terminates. The B<mlockall>() B<MCL_FUTURE> setting is not inherited by a "
+"child created via B<fork>(2) and is cleared during an B<execve>(2)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:261
+msgid ""
+"The memory lock on an address range is automatically removed if the address "
+"range is unmapped via B<munmap>(2)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:274
+msgid ""
+"Memory locks do not stack, that is, pages which have been locked several "
+"times by calls to B<mlock>() or B<mlockall>() will be unlocked by a single "
+"call to B<munlock>() for the corresponding range or by B<munlockall>(). "
+"Pages which are mapped to several locations or by several processes stay "
+"locked into RAM as long as they are locked at least at one location or by at "
+"least one process."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:285
+msgid ""
+"Under Linux, B<mlock>() and B<munlock>() automatically round I<addr> down "
+"to the nearest page boundary. However, POSIX.1-2001 allows an "
+"implementation to require that I<addr> is page aligned, so portable "
+"applications should ensure this."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:298
+msgid ""
+"The I<VmLck> field of the Linux-specific I</proc/PID/status> file shows how "
+"many kilobytes of memory the process with ID I<PID> has locked using "
+"B<mlock>(), B<mlockall>(), and B<mmap>(2) B<MAP_LOCKED>."
+msgstr ""
+
+#. type: SS
+#: build/C/man2/mlock.2:298
+#, no-wrap
+msgid "Limits and permissions"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:305
+msgid ""
+"In Linux 2.6.8 and earlier, a process must be privileged (B<CAP_IPC_LOCK>) "
+"in order to lock memory and the B<RLIMIT_MEMLOCK> soft resource limit "
+"defines a limit on how much memory the process may lock."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:311
+msgid ""
+"Since Linux 2.6.9, no limits are placed on the amount of memory that a "
+"privileged process can lock and the B<RLIMIT_MEMLOCK> soft resource limit "
+"instead defines a limit on how much memory an unprivileged process may lock."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:319
+msgid ""
+"In the 2.4 series Linux kernels up to and including 2.4.17, a bug caused the "
+"B<mlockall>() B<MCL_FUTURE> flag to be inherited across a B<fork>(2). This "
+"was rectified in kernel 2.4.18."
+msgstr ""
+
+#. See the following LKML thread:
+#. http://marc.theaimsgroup.com/?l=linux-kernel&m=113801392825023&w=2
+#. "Rationale for RLIMIT_MEMLOCK"
+#. 23 Jan 2006
+#. type: Plain text
+#: build/C/man2/mlock.2:336
+msgid ""
+"Since kernel 2.6.9, if a privileged process calls I<mlockall(MCL_FUTURE)> "
+"and later drops privileges (loses the B<CAP_IPC_LOCK> capability by, for "
+"example, setting its effective UID to a nonzero value), then subsequent "
+"memory allocations (e.g., B<mmap>(2), B<brk>(2)) will fail if the "
+"B<RLIMIT_MEMLOCK> resource limit is encountered."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mlock.2:343
+msgid ""
+"B<mmap>(2), B<setrlimit>(2), B<shmctl>(2), B<sysconf>(3), B<proc>(5), "
+"B<capabilities>(7)"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mmap.2:40
+#, no-wrap
+msgid "MMAP"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:43
+msgid "mmap, munmap - map or unmap files or devices into memory"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:51
+#, no-wrap
+msgid ""
+"B<void *mmap(void *>I<addr>B<, size_t >I<length>B<, int >I<prot>B<, int "
+">I<flags>B<,>\n"
+"B< int >I<fd>B<, off_t >I<offset>B<);>\n"
+"B<int munmap(void *>I<addr>B<, size_t >I<length>B<);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:54
+msgid "See NOTES for information on feature test macro requirements."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:63
+msgid ""
+"B<mmap>() creates a new mapping in the virtual address space of the calling "
+"process. The starting address for the new mapping is specified in I<addr>. "
+"The I<length> argument specifies the length of the mapping."
+msgstr ""
+
+#. Before Linux 2.6.24, the address was rounded up to the next page
+#. boundary; since 2.6.24, it is rounded down!
+#. type: Plain text
+#: build/C/man2/mmap.2:77
+msgid ""
+"If I<addr> is NULL, then the kernel chooses the address at which to create "
+"the mapping; this is the most portable method of creating a new mapping. If "
+"I<addr> is not NULL, then the kernel takes it as a hint about where to place "
+"the mapping; on Linux, the mapping will be created at a nearby page "
+"boundary. The address of the new mapping is returned as the result of the "
+"call."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:89
+msgid ""
+"The contents of a file mapping (as opposed to an anonymous mapping; see "
+"B<MAP_ANONYMOUS> below), are initialized using I<length> bytes starting at "
+"offset I<offset> in the file (or other object) referred to by the file "
+"descriptor I<fd>. I<offset> must be a multiple of the page size as returned "
+"by I<sysconf(_SC_PAGE_SIZE)>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:97
+msgid ""
+"The I<prot> argument describes the desired memory protection of the mapping "
+"(and must not conflict with the open mode of the file). It is either "
+"B<PROT_NONE> or the bitwise OR of one or more of the following flags:"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:97 build/C/man2/mprotect.2:74
+#, no-wrap
+msgid "B<PROT_EXEC>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:100
+msgid "Pages may be executed."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:100 build/C/man2/mprotect.2:68
+#, no-wrap
+msgid "B<PROT_READ>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:103
+msgid "Pages may be read."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:103 build/C/man2/mprotect.2:71
+#, no-wrap
+msgid "B<PROT_WRITE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:106
+msgid "Pages may be written."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:106 build/C/man2/mprotect.2:65
+#, no-wrap
+msgid "B<PROT_NONE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:109
+msgid "Pages may not be accessed."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:118
+msgid ""
+"The I<flags> argument determines whether updates to the mapping are visible "
+"to other processes mapping the same region, and whether updates are carried "
+"through to the underlying file. This behavior is determined by including "
+"exactly one of the following values in I<flags>:"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:118
+#, no-wrap
+msgid "B<MAP_SHARED>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:128
+msgid ""
+"Share this mapping. Updates to the mapping are visible to other processes "
+"that map this file, and are carried through to the underlying file. The "
+"file may not actually be updated until B<msync>(2) or B<munmap>() is "
+"called."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:128
+#, no-wrap
+msgid "B<MAP_PRIVATE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:137
+msgid ""
+"Create a private copy-on-write mapping. Updates to the mapping are not "
+"visible to other processes mapping the same file, and are not carried "
+"through to the underlying file. It is unspecified whether changes made to "
+"the file after the B<mmap>() call are visible in the mapped region."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:139
+msgid "Both of these flags are described in POSIX.1-2001."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:142
+msgid "In addition, zero or more of the following values can be ORed in I<flags>:"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:142
+#, no-wrap
+msgid "B<MAP_32BIT> (since Linux 2.4.20, 2.6)"
+msgstr ""
+
+#. See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08
+#. type: Plain text
+#: build/C/man2/mmap.2:158
+msgid ""
+"Put the mapping into the first 2 Gigabytes of the process address space. "
+"This flag is supported only on x86-64, for 64-bit programs. It was added to "
+"allow thread stacks to be allocated somewhere in the first 2GB of memory, so "
+"as to improve context-switch performance on some early 64-bit processors. "
+"Modern x86-64 processors no longer have this performance problem, so use of "
+"this flag is not required on those systems. The B<MAP_32BIT> flag is "
+"ignored when B<MAP_FIXED> is set."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:158
+#, no-wrap
+msgid "B<MAP_ANON>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:163
+msgid "Synonym for B<MAP_ANONYMOUS>. Deprecated."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:163
+#, no-wrap
+msgid "B<MAP_ANONYMOUS>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:185
+msgid ""
+"The mapping is not backed by any file; its contents are initialized to "
+"zero. The I<fd> and I<offset> arguments are ignored; however, some "
+"implementations require I<fd> to be -1 if B<MAP_ANONYMOUS> (or B<MAP_ANON>) "
+"is specified, and portable applications should ensure this. The use of "
+"B<MAP_ANONYMOUS> in conjunction with B<MAP_SHARED> is supported on Linux "
+"only since kernel 2.4."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:185
+#, no-wrap
+msgid "B<MAP_DENYWRITE>"
+msgstr ""
+
+#. Introduced in 1.1.36, removed in 1.3.24.
+#. type: Plain text
+#: build/C/man2/mmap.2:193
+msgid ""
+"This flag is ignored. (Long ago, it signaled that attempts to write to the "
+"underlying file should fail with B<ETXTBUSY>. But this was a source of "
+"denial-of-service attacks.)"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:193
+#, no-wrap
+msgid "B<MAP_EXECUTABLE>"
+msgstr ""
+
+#. Introduced in 1.1.38, removed in 1.3.24. Flag tested in proc_follow_link.
+#. (Long ago, it signaled that the underlying file is an executable.
+#. However, that information was not really used anywhere.)
+#. Linus talked about DOS related to MAP_EXECUTABLE, but he was thinking of
+#. MAP_DENYWRITE?
+#. type: Plain text
+#: build/C/man2/mmap.2:201
+msgid "This flag is ignored."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:201
+#, no-wrap
+msgid "B<MAP_FILE>"
+msgstr ""
+
+#. On some systems, this was required as the opposite of
+#. MAP_ANONYMOUS -- mtk, 1 May 2007
+#. type: Plain text
+#: build/C/man2/mmap.2:207
+msgid "Compatibility flag. Ignored."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:207
+#, no-wrap
+msgid "B<MAP_FIXED>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:225
+msgid ""
+"Don't interpret I<addr> as a hint: place the mapping at exactly that "
+"address. I<addr> must be a multiple of the page size. If the memory region "
+"specified by I<addr> and I<len> overlaps pages of any existing mapping(s), "
+"then the overlapped part of the existing mapping(s) will be discarded. If "
+"the specified address cannot be used, B<mmap>() will fail. Because "
+"requiring a fixed address for a mapping is less portable, the use of this "
+"option is discouraged."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:225
+#, no-wrap
+msgid "B<MAP_GROWSDOWN>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:230
+msgid ""
+"Used for stacks. Indicates to the kernel virtual memory system that the "
+"mapping should extend downward in memory."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:230
+#, no-wrap
+msgid "B<MAP_HUGETLB> (since Linux 2.6.32)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:236
+msgid ""
+"Allocate the mapping using \"huge pages.\" See the Linux kernel source file "
+"I<Documentation/vm/hugetlbpage.txt> for further information."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:236
+#, no-wrap
+msgid "B<MAP_LOCKED> (since Linux 2.5.37)"
+msgstr ""
+
+#. If set, the mapped pages will not be swapped out.
+#. type: Plain text
+#: build/C/man2/mmap.2:242
+msgid ""
+"Lock the pages of the mapped region into memory in the manner of "
+"B<mlock>(2). This flag is ignored in older kernels."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:242
+#, no-wrap
+msgid "B<MAP_NONBLOCK> (since Linux 2.5.46)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:257
+msgid ""
+"Only meaningful in conjunction with B<MAP_POPULATE>. Don't perform "
+"read-ahead: create page tables entries only for pages that are already "
+"present in RAM. Since Linux 2.6.23, this flag causes B<MAP_POPULATE> to do "
+"nothing. One day the combination of B<MAP_POPULATE> and B<MAP_NONBLOCK> may "
+"be reimplemented."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:257
+#, no-wrap
+msgid "B<MAP_NORESERVE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:272
+msgid ""
+"Do not reserve swap space for this mapping. When swap space is reserved, "
+"one has the guarantee that it is possible to modify the mapping. When swap "
+"space is not reserved one might get B<SIGSEGV> upon a write if no physical "
+"memory is available. See also the discussion of the file "
+"I</proc/sys/vm/overcommit_memory> in B<proc>(5). In kernels before 2.6, "
+"this flag had effect only for private writable mappings."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:272
+#, no-wrap
+msgid "B<MAP_POPULATE> (since Linux 2.5.46)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:279
+msgid ""
+"Populate (prefault) page tables for a mapping. For a file mapping, this "
+"causes read-ahead on the file. Later accesses to the mapping will not be "
+"blocked by page faults. B<MAP_POPULATE> is supported for private mappings "
+"only since Linux 2.6.23."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:279
+#, no-wrap
+msgid "B<MAP_STACK> (since Linux 2.6.27)"
+msgstr ""
+
+#. See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08
+#. commit cd98a04a59e2f94fa64d5bf1e26498d27427d5e7
+#. http://thread.gmane.org/gmane.linux.kernel/720412
+#. "pthread_create() slow for many threads; also time to revisit 64b
+#. context switch optimization?"
+#. type: Plain text
+#: build/C/man2/mmap.2:292
+msgid ""
+"Allocate the mapping at an address suitable for a process or thread stack. "
+"This flag is currently a no-op, but is used in the glibc threading "
+"implementation so that if some architectures require special treatment for "
+"stack allocations, support can later be transparently implemented for glibc."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:292
+#, no-wrap
+msgid "B<MAP_UNINITIALIZED> (since Linux 2.6.33)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:302
+msgid ""
+"Don't clear anonymous pages. This flag is intended to improve performance "
+"on embedded devices. This flag is honored only if the kernel was configured "
+"with the B<CONFIG_MMAP_ALLOW_UNINITIALIZED> option. Because of the security "
+"implications, that option is normally enabled only on embedded devices "
+"(i.e., devices where one has complete control of the contents of user "
+"memory)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:310
+msgid ""
+"Of the above flags, only B<MAP_FIXED> is specified in POSIX.1-2001. "
+"However, most systems also support B<MAP_ANONYMOUS> (or its synonym "
+"B<MAP_ANON>)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:317
+msgid ""
+"Some systems document the additional flags B<MAP_AUTOGROW>, "
+"B<MAP_AUTORESRV>, B<MAP_COPY>, and B<MAP_LOCAL>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:323
+msgid ""
+"Memory mapped by B<mmap>() is preserved across B<fork>(2), with the same "
+"attributes."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:331
+msgid ""
+"A file is mapped in multiples of the page size. For a file that is not a "
+"multiple of the page size, the remaining memory is zeroed when mapped, and "
+"writes to that region are not written out to the file. The effect of "
+"changing the size of the underlying file of a mapping on the pages that "
+"correspond to added or removed regions of the file is unspecified."
+msgstr ""
+
+#. type: SS
+#: build/C/man2/mmap.2:331
+#, no-wrap
+msgid "munmap()"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:341
+msgid ""
+"The B<munmap>() system call deletes the mappings for the specified address "
+"range, and causes further references to addresses within the range to "
+"generate invalid memory references. The region is also automatically "
+"unmapped when the process is terminated. On the other hand, closing the "
+"file descriptor does not unmap the region."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:351
+msgid ""
+"The address I<addr> must be a multiple of the page size. All pages "
+"containing a part of the indicated range are unmapped, and subsequent "
+"references to these pages will generate B<SIGSEGV>. It is not an error if "
+"the indicated range does not contain any mapped pages."
+msgstr ""
+
+#. type: SS
+#: build/C/man2/mmap.2:351
+#, no-wrap
+msgid "Timestamps changes for file-backed mappings"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:358
+msgid ""
+"For file-backed mappings, the I<st_atime> field for the mapped file may be "
+"updated at any time between the B<mmap>() and the corresponding unmapping; "
+"the first reference to a mapped page will update the field if it has not "
+"been already."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:375
+msgid ""
+"The I<st_ctime> and I<st_mtime> field for a file mapped with B<PROT_WRITE> "
+"and B<MAP_SHARED> will be updated after a write to the mapped region, and "
+"before a subsequent B<msync>(2) with the B<MS_SYNC> or B<MS_ASYNC> flag, if "
+"one occurs."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:392
+msgid ""
+"On success, B<mmap>() returns a pointer to the mapped area. On error, the "
+"value B<MAP_FAILED> (that is, I<(void\\ *)\\ -1>) is returned, and I<errno> "
+"is set appropriately. On success, B<munmap>() returns 0, on failure -1, "
+"and I<errno> is set (probably to B<EINVAL>)."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:393 build/C/man2/mprotect.2:85 build/C/man3/shm_open.3:187 build/C/man3/shm_open.3:192 build/C/man2/shmctl.2:306 build/C/man2/shmget.2:192 build/C/man2/shmop.2:188
+#, no-wrap
+msgid "B<EACCES>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:411
+msgid ""
+"A file descriptor refers to a non-regular file. Or a file mapping was "
+"requested, but I<fd> is not open for reading. Or B<MAP_SHARED> was "
+"requested and B<PROT_WRITE> is set, but I<fd> is not open in read/write "
+"(B<O_RDWR>) mode. Or B<PROT_WRITE> is set, but the file is append-only."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:415
+msgid ""
+"The file has been locked, or too much memory has been locked (see "
+"B<setrlimit>(2))."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:421
+msgid "I<fd> is not a valid file descriptor (and B<MAP_ANONYMOUS> was not set)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:429
+msgid ""
+"We don't like I<addr>, I<length>, or I<offset> (e.g., they are too large, or "
+"not aligned on a page boundary)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:434
+msgid "(since Linux 2.6.12) I<length> was 0."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:442
+msgid ""
+"I<flags> contained neither B<MAP_PRIVATE> or B<MAP_SHARED>, or contained "
+"both of these values."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:442 build/C/man3/shm_open.3:229 build/C/man2/shmget.2:221 build/C/man2/memfd_create.2:149
+#, no-wrap
+msgid "B<ENFILE>"
+msgstr ""
+
+#. [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp()
+#. type: Plain text
+#: build/C/man2/mmap.2:450 build/C/man2/shmget.2:225
+msgid "The system limit on the total number of open files has been reached."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:454
+msgid ""
+"The underlying filesystem of the specified file does not support memory "
+"mapping."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:458
+msgid ""
+"No memory is available, or the process's maximum number of mappings would "
+"have been exceeded."
+msgstr ""
+
+#. (Since 2.4.25 / 2.6.0.)
+#. type: Plain text
+#: build/C/man2/mmap.2:467
+msgid ""
+"The I<prot> argument asks for B<PROT_EXEC> but the mapped area belongs to a "
+"file on a filesystem that was mounted no-exec."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:477
+msgid ""
+"B<MAP_DENYWRITE> was set but the object specified by I<fd> is open for "
+"writing."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:477 build/C/man2/shmctl.2:348
+#, no-wrap
+msgid "B<EOVERFLOW>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:489
+msgid ""
+"On 32-bit architecture together with the large file extension (i.e., using "
+"64-bit I<off_t>): the number of pages used for I<length> plus number of "
+"pages used for I<offset> would overflow I<unsigned long> (32 bits)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:491
+msgid "Use of a mapped region can result in these signals:"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:491
+#, no-wrap
+msgid "B<SIGSEGV>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:494
+msgid "Attempted write into a region mapped as read-only."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mmap.2:494
+#, no-wrap
+msgid "B<SIGBUS>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:499
+msgid ""
+"Attempted access to a portion of the buffer that does not correspond to the "
+"file (for example, beyond the end of the file, including the case where "
+"another process has truncated the file)."
+msgstr ""
+
+#. SVr4 documents additional error codes ENXIO and ENODEV.
+#. SUSv2 documents additional error codes EMFILE and EOVERFLOW.
+#. type: Plain text
+#: build/C/man2/mmap.2:503
+msgid "SVr4, 4.4BSD, POSIX.1-2001."
+msgstr ""
+
+#. POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
+#. -1: unavailable, 0: ask using sysconf().
+#. glibc defines it to 1.
+#. type: Plain text
+#: build/C/man2/mmap.2:517
+msgid ""
+"On POSIX systems on which B<mmap>(), B<msync>(2), and B<munmap>() are "
+"available, B<_POSIX_MAPPED_FILES> is defined in I<E<lt>unistd.hE<gt>> to a "
+"value greater than 0. (See also B<sysconf>(3).)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:530
+msgid ""
+"On some hardware architectures (e.g., i386), B<PROT_WRITE> implies "
+"B<PROT_READ>. It is architecture dependent whether B<PROT_READ> implies "
+"B<PROT_EXEC> or not. Portable programs should always set B<PROT_EXEC> if "
+"they intend to execute code in the new mapping."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:545
+msgid ""
+"The portable way to create a mapping is to specify I<addr> as 0 (NULL), and "
+"omit B<MAP_FIXED> from I<flags>. In this case, the system chooses the "
+"address for the mapping; the address is chosen so as not to conflict with "
+"any existing mapping, and will not be 0. If the B<MAP_FIXED> flag is "
+"specified, and I<addr> is 0 (NULL), then the mapped address will be 0 "
+"(NULL)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:575
+msgid ""
+"Certain I<flags> constants are defined only if either B<_BSD_SOURCE> or "
+"B<_SVID_SOURCE> is defined. (Requiring B<_GNU_SOURCE> also suffices, and "
+"requiring that macro specifically would have been more logical, since these "
+"flags are all Linux-specific.) The relevant flags are: B<MAP_32BIT>, "
+"B<MAP_ANONYMOUS> (and the synonym B<MAP_ANON>), B<MAP_DENYWRITE>, "
+"B<MAP_EXECUTABLE>, B<MAP_FILE>, B<MAP_GROWSDOWN>, B<MAP_HUGETLB>, "
+"B<MAP_LOCKED>, B<MAP_NONBLOCK>, B<MAP_NORESERVE>, B<MAP_POPULATE>, and "
+"B<MAP_STACK>."
+msgstr ""
+
+#. type: SS
+#: build/C/man2/mmap.2:575
+#, no-wrap
+msgid "C library/kernel ABI differences"
+msgstr ""
+
+#. Since around glibc 2.1/2.2, depending on the platform.
+#. type: Plain text
+#: build/C/man2/mmap.2:590
+msgid ""
+"This page describes the interface provided by the glibc B<mmap>() wrapper "
+"function. Originally, this function invoked a system call of the same "
+"name. Since kernel 2.4, that system call has been superseded by "
+"B<mmap2>(2), and nowadays the glibc B<mmap>() wrapper function invokes "
+"B<mmap2>(2) with a suitably adjusted value for I<offset>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:595
+msgid ""
+"On Linux there are no guarantees like those suggested above under "
+"B<MAP_NORESERVE>. By default, any process can be killed at any moment when "
+"the system runs out of memory."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:602
+msgid ""
+"In kernels before 2.6.7, the B<MAP_POPULATE> flag has effect only if I<prot> "
+"is specified as B<PROT_NONE>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:617
+msgid ""
+"SUSv3 specifies that B<mmap>() should fail if I<length> is 0. However, in "
+"kernels before 2.6.12, B<mmap>() succeeded in this case: no mapping was "
+"created and the call returned I<addr>. Since kernel 2.6.12, B<mmap>() "
+"fails with the error B<EINVAL> for this case."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:633
+msgid ""
+"POSIX specifies that the system shall always zero fill any partial page at "
+"the end of the object and that system will never write any modification of "
+"the object beyond its end. On Linux, when you write data to such partial "
+"page after the end of the object, the data stays in the page cache even "
+"after the file is closed and unmapped and even though the data is never "
+"written to the file itself, subsequent mappings may see the modified "
+"content. In some cases, this could be fixed by calling B<msync>(2) before "
+"the unmap takes place; however, this doesn't work on tmpfs (for example, "
+"when using POSIX shared memory interface documented in B<shm_overview>(7))."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:645
+msgid ""
+"The following program prints part of the file specified in its first "
+"command-line argument to standard output. The range of bytes to be printed "
+"is specified via offset and length values in the second and third "
+"command-line arguments. The program creates a memory mapping of the "
+"required pages of the file and then uses B<write>(2) to output the desired "
+"bytes."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:653
+#, no-wrap
+msgid ""
+"#include E<lt>sys/mman.hE<gt>\n"
+"#include E<lt>sys/stat.hE<gt>\n"
+"#include E<lt>fcntl.hE<gt>\n"
+"#include E<lt>stdio.hE<gt>\n"
+"#include E<lt>stdlib.hE<gt>\n"
+"#include E<lt>unistd.hE<gt>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:656 build/C/man2/mprotect.2:177
+#, no-wrap
+msgid ""
+"#define handle_error(msg) \\e\n"
+" do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:666
+#, no-wrap
+msgid ""
+"int\n"
+"main(int argc, char *argv[])\n"
+"{\n"
+" char *addr;\n"
+" int fd;\n"
+" struct stat sb;\n"
+" off_t offset, pa_offset;\n"
+" size_t length;\n"
+" ssize_t s;\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:671
+#, no-wrap
+msgid ""
+" if (argc E<lt> 3 || argc E<gt> 4) {\n"
+" fprintf(stderr, \"%s file offset [length]\\en\", argv[0]);\n"
+" exit(EXIT_FAILURE);\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:675
+#, no-wrap
+msgid ""
+" fd = open(argv[1], O_RDONLY);\n"
+" if (fd == -1)\n"
+" handle_error(\"open\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:678
+#, no-wrap
+msgid ""
+" if (fstat(fd, &sb) == -1) /* To obtain file size */\n"
+" handle_error(\"fstat\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:682
+#, no-wrap
+msgid ""
+" offset = atoi(argv[2]);\n"
+" pa_offset = offset & ~(sysconf(_SC_PAGE_SIZE) - 1);\n"
+" /* offset for mmap() must be page aligned */\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:687
+#, no-wrap
+msgid ""
+" if (offset E<gt>= sb.st_size) {\n"
+" fprintf(stderr, \"offset is past end of file\\en\");\n"
+" exit(EXIT_FAILURE);\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:693
+#, no-wrap
+msgid ""
+" if (argc == 4) {\n"
+" length = atoi(argv[3]);\n"
+" if (offset + length E<gt> sb.st_size)\n"
+" length = sb.st_size - offset;\n"
+" /* Can\\(aqt display bytes past end of file */\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:697
+#, no-wrap
+msgid ""
+" } else { /* No length arg ==E<gt> display to end of file */\n"
+" length = sb.st_size - offset;\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:702
+#, no-wrap
+msgid ""
+" addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
+" MAP_PRIVATE, fd, pa_offset);\n"
+" if (addr == MAP_FAILED)\n"
+" handle_error(\"mmap\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:707
+#, no-wrap
+msgid ""
+" s = write(STDOUT_FILENO, addr + offset - pa_offset, length);\n"
+" if (s != length) {\n"
+" if (s == -1)\n"
+" handle_error(\"write\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:711
+#, no-wrap
+msgid ""
+" fprintf(stderr, \"partial write\");\n"
+" exit(EXIT_FAILURE);\n"
+" }\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:729
+msgid ""
+"B<getpagesize>(2), B<memfd_create>(2), B<mincore>(2), B<mlock>(2), "
+"B<mmap2>(2), B<mprotect>(2), B<mremap>(2), B<msync>(2), "
+"B<remap_file_pages>(2), B<setrlimit>(2), B<shmat>(2), B<shm_open>(3), "
+"B<shm_overview>(7)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:736
+msgid ""
+"The descriptions of the following files in B<proc>(5): I</proc/[pid]/maps>, "
+"I</proc/[pid]/map_files>, and I</proc/[pid]/smaps>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap.2:741 build/C/man2/msync.2:151
+msgid "B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391."
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mmap2.2:29
+#, no-wrap
+msgid "MMAP2"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mmap2.2:29
+#, no-wrap
+msgid "2014-02-25"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:32
+msgid "mmap2 - map files or devices into memory"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:38
+#, no-wrap
+msgid ""
+"B<void *mmap2(void *>I<addr>B<, size_t >I<length>B<, int >I<prot>B<,>\n"
+"B< int >I<flags>B<, int >I<fd>B<, off_t >I<pgoffset>B<);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:43
+msgid ""
+"This is probably not the system call that you are interested in; instead, "
+"see B<mmap>(2), which describes the glibc wrapper function that invokes this "
+"system call."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:54
+msgid ""
+"The B<mmap2>() system call provides the same interface as B<mmap>(2), "
+"except that the final argument specifies the offset into the file in "
+"4096-byte units (instead of bytes, as is done by B<mmap>(2)). This enables "
+"applications that use a 32-bit I<off_t> to map large files (up to 2^44 "
+"bytes)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:61
+msgid ""
+"On success, B<mmap2>() returns a pointer to the mapped area. On error, -1 "
+"is returned and I<errno> is set appropriately."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:65
+msgid "Problem with getting the data from user space."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:70
+msgid ""
+"(Various platforms where the page size is not 4096 bytes.) I<offset\\ *\\ "
+"4096> is not a multiple of the system page size."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:74
+msgid "B<mmap2>() can also return any of the errors described in B<mmap>(2)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:77
+msgid "B<mmap2>() is available since Linux 2.3.31."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:79 build/C/man2/subpage_prot.2:98
+msgid "This system call is Linux-specific."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:86
+msgid ""
+"On architectures where this system call is present, the glibc B<mmap>() "
+"wrapper function invokes this system call rather than the B<mmap>(2) system "
+"call."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:88
+msgid "This system call does not exist on x86-64."
+msgstr ""
+
+#. ia64 can have page sizes ranging from 4kB to 64kB.
+#. On cris, it looks like the unit might also be the page size,
+#. which is 8192 bytes. -- mtk, June 2007
+#. type: Plain text
+#: build/C/man2/mmap2.2:95
+msgid ""
+"On ia64, the unit for I<offset> is actually the system page size, rather "
+"than 4096 bytes."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mmap2.2:101
+msgid "B<getpagesize>(2), B<mmap>(2), B<mremap>(2), B<msync>(2), B<shm_open>(3)"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mprotect.2:39
+#, no-wrap
+msgid "MPROTECT"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mprotect.2:39
+#, no-wrap
+msgid "2014-01-05"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:42
+msgid "mprotect - set protection on a region of memory"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:47
+#, no-wrap
+msgid "B<int mprotect(void *>I<addr>B<, size_t >I<len>B<, int >I<prot>B<);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:55
+msgid ""
+"B<mprotect>() changes protection for the calling process's memory page(s) "
+"containing any part of the address range in the interval [I<addr>,\\ "
+"I<addr>+I<len>-1]. I<addr> must be aligned to a page boundary."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:60
+msgid ""
+"If the calling process tries to access memory in a manner that violates the "
+"protection, then the kernel generates a B<SIGSEGV> signal for the process."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:65
+msgid ""
+"I<prot> is either B<PROT_NONE> or a bitwise-or of the other values in the "
+"following list:"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:68
+msgid "The memory cannot be accessed at all."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:71
+msgid "The memory can be read."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:74
+msgid "The memory can be modified."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:77
+msgid "The memory can be executed."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:84
+msgid ""
+"On success, B<mprotect>() returns zero. On error, -1 is returned, and "
+"I<errno> is set appropriately."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:94
+msgid ""
+"The memory cannot be given the specified access. This can happen, for "
+"example, if you B<mmap>(2) a file to which you have read-only access, then "
+"ask B<mprotect>() to mark it B<PROT_WRITE>."
+msgstr ""
+
+#. Or: both PROT_GROWSUP and PROT_GROWSDOWN were specified in 'prot'.
+#. type: Plain text
+#: build/C/man2/mprotect.2:99
+msgid "I<addr> is not a valid pointer, or not a multiple of the system page size."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:102
+msgid "Internal kernel structures could not be allocated."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:112
+msgid ""
+"Addresses in the range [I<addr>, I<addr>+I<len>-1] are invalid for the "
+"address space of the process, or specify one or more pages that are not "
+"mapped. (Before kernel 2.4.19, the error B<EFAULT> was incorrectly produced "
+"for these cases.)"
+msgstr ""
+
+#. SVr4 defines an additional error
+#. code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's.
+#. type: Plain text
+#: build/C/man2/mprotect.2:121
+msgid ""
+"SVr4, POSIX.1-2001. POSIX says that the behavior of B<mprotect>() is "
+"unspecified if it is applied to a region of memory that was not obtained via "
+"B<mmap>(2)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:128
+msgid ""
+"On Linux it is always permissible to call B<mprotect>() on any address in a "
+"process's address space (except for the kernel vsyscall area). In "
+"particular it can be used to change existing code mappings to be writable."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:138
+msgid ""
+"Whether B<PROT_EXEC> has any effect different from B<PROT_READ> is "
+"architecture- and kernel version-dependent. On some hardware architectures "
+"(e.g., i386), B<PROT_WRITE> implies B<PROT_READ>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:147
+msgid ""
+"POSIX.1-2001 says that an implementation may permit access other than that "
+"specified in I<prot>, but at a minimum can allow write access only if "
+"B<PROT_WRITE> has been set, and must not allow any access if B<PROT_NONE> "
+"has been set."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:153
+msgid ""
+"The program below allocates four pages of memory, makes the third of these "
+"pages read-only, and then executes a loop that walks upward through the "
+"allocated region modifying bytes."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:156
+msgid "An example of what we might see when running the program is the following:"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:162
+#, no-wrap
+msgid ""
+"$B< ./a.out>\n"
+"Start of region: 0x804c000\n"
+"Got SIGSEGV at address: 0x804e000\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:174
+#, no-wrap
+msgid ""
+"#include E<lt>unistd.hE<gt>\n"
+"#include E<lt>signal.hE<gt>\n"
+"#include E<lt>stdio.hE<gt>\n"
+"#include E<lt>malloc.hE<gt>\n"
+"#include E<lt>stdlib.hE<gt>\n"
+"#include E<lt>errno.hE<gt>\n"
+"#include E<lt>sys/mman.hE<gt>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:179
+#, no-wrap
+msgid "static char *buffer;\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:187
+#, no-wrap
+msgid ""
+"static void\n"
+"handler(int sig, siginfo_t *si, void *unused)\n"
+"{\n"
+" printf(\"Got SIGSEGV at address: 0x%lx\\en\",\n"
+" (long) si-E<gt>si_addr);\n"
+" exit(EXIT_FAILURE);\n"
+"}\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:194
+#, no-wrap
+msgid ""
+"int\n"
+"main(int argc, char *argv[])\n"
+"{\n"
+" char *p;\n"
+" int pagesize;\n"
+" struct sigaction sa;\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:200
+#, no-wrap
+msgid ""
+" sa.sa_flags = SA_SIGINFO;\n"
+" sigemptyset(&sa.sa_mask);\n"
+" sa.sa_sigaction = handler;\n"
+" if (sigaction(SIGSEGV, &sa, NULL) == -1)\n"
+" handle_error(\"sigaction\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:204
+#, no-wrap
+msgid ""
+" pagesize = sysconf(_SC_PAGE_SIZE);\n"
+" if (pagesize == -1)\n"
+" handle_error(\"sysconf\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:207
+#, no-wrap
+msgid ""
+" /* Allocate a buffer aligned on a page boundary;\n"
+" initial protection is PROT_READ | PROT_WRITE */\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:211
+#, no-wrap
+msgid ""
+" buffer = memalign(pagesize, 4 * pagesize);\n"
+" if (buffer == NULL)\n"
+" handle_error(\"memalign\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:213
+#, no-wrap
+msgid " printf(\"Start of region: 0x%lx\\en\", (long) buffer);\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:217
+#, no-wrap
+msgid ""
+" if (mprotect(buffer + pagesize * 2, pagesize,\n"
+" PROT_READ) == -1)\n"
+" handle_error(\"mprotect\");\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:220
+#, no-wrap
+msgid ""
+" for (p = buffer ; ; )\n"
+" *(p++) = \\(aqa\\(aq;\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:224
+#, no-wrap
+msgid ""
+" printf(\"Loop completed\\en\"); /* Should never happen */\n"
+" exit(EXIT_SUCCESS);\n"
+"}\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mprotect.2:228
+msgid "B<mmap>(2), B<sysconf>(3)"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mremap.2:30
+#, no-wrap
+msgid "MREMAP"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/mremap.2:30
+#, no-wrap
+msgid "2010-06-10"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:33
+msgid "mremap - remap a virtual memory address"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:36
+#, no-wrap
+msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:41
+#, no-wrap
+msgid ""
+"B<void *mremap(void *>I<old_address>B<, size_t >I<old_size>B<,>\n"
+"B< size_t >I<new_size>B<, int >I<flags>B<, ... /* void "
+"*>I<new_address>B< */);>\n"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:47
+msgid ""
+"B<mremap>() expands (or shrinks) an existing memory mapping, potentially "
+"moving it at the same time (controlled by the I<flags> argument and the "
+"available virtual address space)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:61
+msgid ""
+"I<old_address> is the old address of the virtual memory block that you want "
+"to expand (or shrink). Note that I<old_address> has to be page aligned. "
+"I<old_size> is the old size of the virtual memory block. I<new_size> is the "
+"requested size of the virtual memory block after the resize. An optional "
+"fifth argument, I<new_address>, may be provided; see the description of "
+"B<MREMAP_FIXED> below."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:73
+msgid ""
+"In Linux the memory is divided into pages. A user process has (one or) "
+"several linear virtual memory segments. Each virtual memory segment has one "
+"or more mappings to real memory pages (in the page table). Each virtual "
+"memory segment has its own protection (access rights), which may cause a "
+"segmentation violation if the memory is accessed incorrectly (e.g., writing "
+"to a read-only segment). Accessing virtual memory outside of the segments "
+"will also cause a segmentation violation."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:81
+msgid ""
+"B<mremap>() uses the Linux page table scheme. B<mremap>() changes the "
+"mapping between virtual addresses and memory pages. This can be used to "
+"implement a very efficient B<realloc>(3)."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:83
+msgid "The I<flags> bit-mask argument may be 0, or include the following flag:"
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mremap.2:83
+#, no-wrap
+msgid "B<MREMAP_MAYMOVE>"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:95
+msgid ""
+"By default, if there is not sufficient space to expand a mapping at its "
+"current location, then B<mremap>() fails. If this flag is specified, then "
+"the kernel is permitted to relocate the mapping to a new virtual address, if "
+"necessary. If the mapping is relocated, then absolute pointers into the old "
+"mapping location become invalid (offsets relative to the starting address of "
+"the mapping should be employed)."
+msgstr ""
+
+#. type: TP
+#: build/C/man2/mremap.2:95
+#, no-wrap
+msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:117
+msgid ""
+"This flag serves a similar purpose to the B<MAP_FIXED> flag of B<mmap>(2). "
+"If this flag is specified, then B<mremap>() accepts a fifth argument, "
+"I<void\\ *new_address>, which specifies a page-aligned address to which the "
+"mapping must be moved. Any previous mapping at the address range specified "
+"by I<new_address> and I<new_size> is unmapped. If B<MREMAP_FIXED> is "
+"specified, then B<MREMAP_MAYMOVE> must also be specified."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:127
+msgid ""
+"If the memory segment specified by I<old_address> and I<old_size> is locked "
+"(using B<mlock>(2) or similar), then this lock is maintained when the "
+"segment is resized and/or relocated. As a consequence, the amount of memory "
+"locked by the process may change."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:135
+msgid ""
+"On success B<mremap>() returns a pointer to the new virtual memory area. "
+"On error, the value B<MAP_FAILED> (that is, I<(void\\ *)\\ -1>) is returned, "
+"and I<errno> is set appropriately."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:142
+msgid ""
+"The caller tried to expand a memory segment that is locked, but this was not "
+"possible without exceeding the B<RLIMIT_MEMLOCK> resource limit."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:151
+msgid ""
+"\"Segmentation fault.\" Some address in the range I<old_address> to "
+"I<old_address>+I<old_size> is an invalid virtual memory address for this "
+"process. You can also get B<EFAULT> even if there exist mappings that cover "
+"the whole address space requested, but those mappings are of different "
+"types."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:179
+msgid ""
+"An invalid argument was given. Possible causes are: I<old_address> was not "
+"page aligned; a value other than B<MREMAP_MAYMOVE> or B<MREMAP_FIXED> was "
+"specified in I<flags>; I<new_size> was zero; I<new_size> or I<new_address> "
+"was invalid; or the new address range specified by I<new_address> and "
+"I<new_size> overlapped the old address range specified by I<old_address> and "
+"I<old_size>; or B<MREMAP_FIXED> was specified without also specifying "
+"B<MREMAP_MAYMOVE>."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:185
+msgid ""
+"The memory area cannot be expanded at the current virtual address, and the "
+"B<MREMAP_MAYMOVE> flag is not set in I<flags>. Or, there is not enough "
+"(virtual) memory available."
+msgstr ""
+
+#. 4.2BSD had a (never actually implemented)
+#. .BR mremap (2)
+#. call with completely different semantics.
+#. type: Plain text
+#: build/C/man2/mremap.2:191
+msgid ""
+"This call is Linux-specific, and should not be used in programs intended to "
+"be portable."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:199
+msgid ""
+"Prior to version 2.4, glibc did not expose the definition of "
+"B<MREMAP_FIXED>, and the prototype for B<mremap>() did not allow for the "
+"I<new_address> argument."
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:208
+msgid ""
+"B<brk>(2), B<getpagesize>(2), B<getrlimit>(2), B<mlock>(2), B<mmap>(2), "
+"B<sbrk>(2), B<malloc>(3), B<realloc>(3)"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/mremap.2:214
+msgid ""
+"Your favorite text book on operating systems for more information on paged "
+"memory (e.g., I<Modern Operating Systems> by Andrew S. Tanenbaum, I<Inside "
+"Linux> by Randolf Bentson, I<The Design of the UNIX Operating System> by "
+"Maurice J. Bach)"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/msync.2:25
+#, no-wrap
+msgid "MSYNC"
+msgstr ""
+
+#. type: TH
+#: build/C/man2/msync.2:25
+#, no-wrap
+msgid "2014-04-20"
+msgstr ""
+
+#. type: Plain text
+#: build/C/man2/msync.2:28
+msgid "msync - synchronize a file with a memory map"