summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/mmap.2
Commit message (Collapse)AuthorAgeFilesLines
* Remove sysctl vm.max_proc_mmap used to protect from KVA space exhaustion.pluknet2011-02-241-3/+0
| | | | | | | | | | | | | | As it was pointed out by Alan Cox, that no longer serves its purpose with the modern UMA allocator compared to the old one used in 4.x days. The removal of sysctl eliminates max_proc_mmap type overflow leading to the broken mmap(2) seen with large amount of physical memory on arches with factually unbound KVA space (such as amd64). It was found that slightly less than 256GB of physmem was enough to trigger the overflow. Reviewed by: alc, kib Approved by: avg (mentor) MFC after: 2 months
* Add the MAP_PREFAULT_READ option to mmap(2).alc2010-08-281-1/+14
| | | | Reviewed by: jhb, kib
* Reject attempts to create a MAP_ANON mapping with a non-zero offset.jhb2010-03-231-1/+6
| | | | | | PR: kern/71258 Submitted by: Alexander Best MFC after: 2 weeks
* Add MAP_ANONYMOUS.ed2009-11-061-1/+5
| | | | | | | | Many operating systems also provide MAP_ANONYMOUS. It's not hard to support this ourselves, we'd better add it to make it more likely for applications to work out of the box. Reviewed by: alc (mman.h)
* Eliminate a stale paragraph from the BUGS section. This "bug" wasalc2009-07-261-8/+1
| | | | | | eliminated in r195693. Approved by: re (kensmith)
* - Change mmap() to fail requests with EINVAL that pass a length of 0. Thisjhb2009-07-141-2/+2
| | | | | | | | | | | | behavior is mandated by POSIX. - Do not fail requests that pass a length greater than SSIZE_MAX (such as > 2GB on 32-bit platforms). The 'len' parameter is actually an unsigned 'size_t' so negative values don't really make sense. Submitted by: Alexander Best alexbestms at math.uni-muenster.de Reviewed by: alc Approved by: re (kib) MFC after: 1 week
* Finish what revision 1.40 started. Revision 1.40 removed a false statementalc2008-10-241-8/+6
| | | | | | | from the description but not the errors section. This revision removes it from the errors statement. Add a statement about the non-portability of non-page-aligned offsets.
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Markup fixes.ru2006-09-171-1/+2
|
* Update for rev 1.205 of vm_mmap.c.trhodes2006-04-211-7/+6
| | | | Submitted by: fanf
* Document that the documented 2GB mmap limit is actually apeter2006-03-231-22/+8
| | | | | | | | documentation bug. We switched to page indexes some time around FreeBSD 2.2. The actual 'len' limit is the maximum file size or what will fit in your address space, whichever comes first. It should be possible to make 1TB files on 32 bit systems, but of course address space runs out long before then.
* -mdoc sweep.ru2005-11-171-2/+5
|
* Document the fact that if MAP_FIXED request has been successful itsobomax2005-07-151-0/+7
| | | | | | replaces any previous mapping to the same address. Obtained from: IEEE Std 1003.1, 2004 Edition
* Mechanically kill hard sentence breaks.ru2004-07-021-1/+1
|
* Document POSIX stupidity: Attempts to mmap zero bytes will succeed (andcperciva2004-04-181-0/+7
| | | | have no effect), while attempts to munmap zero bytes will fail.
* Spelling: s/then/than/ where appropriate.ru2002-12-241-3/+3
|
* mdoc(7) police: "The .Fa argument.".ru2002-12-191-9/+19
|
* mdoc(7) police: Tidy up the syscall language.ru2002-12-181-4/+6
| | | | | | | | | | Stop calling system calls "function calls". Use "The .Fn system call" a-la "The .Nm utility". When referring to a non-BSD implementation in the HISTORY section, call syscall a function, to be safe.
* Uniformly refer to a file system as "file system".ru2002-12-121-5/+5
| | | | Approved by: re
* Note that <sys/types.h> in no longer a prerequisite for <utime.h> andmike2002-08-241-1/+0
| | | | <sys/mman.h>.
* mdoc(7) police: hard sentence breaks, whitespace at EOL, contractions.ru2002-03-151-10/+18
|
* Don't make it seem like vm.max_proc_mmap only affects MAP_FIXED.dd2002-02-101-4/+4
| | | | | | PR: 34005 Submitted by: Steven Grady <grady@digitaldeck..com>, Hiten Pandya <hitmaster2k@yahoo.com>
* The VM_STACK option is long dead. MAP_STACK is available everywhere.peter2001-12-211-12/+0
|
* Remove a sentence from the BUGS section that claims non page-alignediedowse2001-11-181-3/+1
| | | | | | | | offsets don't work. It should really be documented that the returned pointer can be in the middle of a fully-valid page when the offset is not page-aligned, but I couldn't come up with suitable wording. PR: kern/22754
* mdoc(7) police: Use the new .In macro for #include statements.ru2001-10-011-2/+2
|
* Add Xref to make.conf(5).alex2001-08-301-1/+2
|
* mdoc(7) police: removed whitespace at EOL, sorted SEE ALSO xrefs.ru2001-08-271-2/+2
|
* Update the mmap.2 and minherit.2 manual pages. Add a short explanation anddillon2001-08-241-0/+6
| | | | | | | | referal from mmap to minherit for MAP_INHERIT. Fully document the minherit.2 manual page (because frankly, my dear, however you think it currently works is almost certainly wrong!). I may soon re-implement MAP_COPY because I believe we can support it properly now, but I will have to call it something else and that is for a later time.
* Killed reference to MAP_INHERIT which is not supported in FreeBSD.dg2001-08-231-4/+0
|
* Remove whitespace at EOL.dd2001-07-151-13/+13
|
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-101-1/+1
|
* Sort PROT_* and MAP_* lists, logically and alphabetically respectively.ru2001-02-121-44/+68
| | | | | | Suggested by: bde General mdoc(7) cleanup.
* Mention PROT_NONE in the list of possible protections.nik2001-02-111-0/+2
| | | | Pointed out by: kris
* Note that mmap(2) can allocate memory, as well as mapping existing files,nik2001-02-111-1/+1
| | | | | | in the .Nd. Reviewed by: hackers
* Prepare for mdoc(7)NG.ru2000-12-291-1/+2
|
* mdoc(7) police: fix formatting errors in rev 1.27.ru2000-12-041-13/+27
|
* Add warning on file-fragmentation issues related to MAP_NOSYNCdillon2000-12-031-0/+15
|
* Use Fx macro wherever possible.ru2000-11-141-3/+3
|
* Repair a cross-reference to sync(1) that should refer to sync(8).chris2000-06-231-1/+1
|
* Replace .Va, .Ar and .Nm with .Fa or .Va where necessary, examples:chris2000-06-231-1/+1
| | | | | | ``.Ar errno'' -> ``.Va errno'' ``.Nm ops'' -> ``.Fa ops'' ``.Va fd'' -> ``.Fa fd''
* Introduce ".Lb" macro to libc manpages.phantom2000-04-211-0/+2
| | | | More libraries manpages updates following.
* Remove single-space hard sentence breaks. These degrade the qualitysheldonh2000-03-021-6/+12
| | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc.
* Add MAP_NOCORE to mmap(2), and MADV_NOCORE and MADV_CORE to madvise(2).ps2000-02-281-0/+2
| | | | | | | | | | | | This This feature allows you to specify if mmap'd data is included in an application's corefile. Change the type of eflags in struct vm_map_entry from u_char to vm_eflags_t (an unsigned int). Reviewed by: dillon,jdp,alfred Approved by: jkh
* Fix null-pointer dereference crash when the system is intentionallydillon2000-02-161-1/+2
| | | | | | | | | | | | | | | | run out of KVM through a mmap()/fork() bomb that allocates hundreds of thousands of vm_map_entry structures. Add panic to make null-pointer dereference crash a little more verbose. Add a new sysctl, vm.max_proc_mmap, which specifies the maximum number of mmap()'d spaces (discrete vm_map_entry's in the process). The value defaults to around 9000 for a 128MB machine. The test is scaled for the number of processes sharing a vmspace (aka linux threads). Setting the value to 0 disables the feature. PR: kern/16573 Approved by: jkh
* Replace `.Os BSD' which caused a troff error with `.Bx' which alsochris2000-02-141-1/+1
| | | | happens to be the correct macro to use in this situation.
* Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC todillon1999-12-121-0/+29
| | | | | | | | | | | | | | | | | madvise(). This feature prevents the update daemon from gratuitously flushing dirty pages associated with a mapped file-backed region of memory. The system pager will still page the memory as necessary and the VM system will still be fully coherent with the filesystem. Modifications made by other means to the same area of memory, for example by write(), are unaffected. The feature works on a page-granularity basis. MAP_NOSYNC allows one to use mmap() to share memory between processes without incuring any significant filesystem overhead, putting it in the same performance category as SysV Shared memory and anonymous memory. Reviewed by: julian, alc, dg
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add $Id$, to make it simpler for members of the translation teams tonik1999-07-121-0/+1
| | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde
* Mostly remove the VM_STACK OPTION.julian1999-01-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the definitions of a few items so that structures are the same whether or not the option itself is enabled. This allows people to enable and disable the option without recompilng the world. As the author says: |I ran into a problem pulling out the VM_STACK option. I was aware of this |when I first did the work, but then forgot about it. The VM_STACK stuff |has some code changes in the i386 branch. There need to be corresponding |changes in the alpha branch before it can come out completely. what is done: | |1) Pull the VM_STACK option out of the header files it appears in. This |really shouldn't affect anything that executes with or without the rest |of the VM_STACK patches. The vm_map_entry will then always have one |extra element (avail_ssize). It just won't be used if the VM_STACK |option is not turned on. | |I've also pulled the option out of vm_map.c. This shouldn't harm anything, |since the routines that are enabled as a result are not called unless |the VM_STACK option is enabled elsewhere. | |2) Add what appears to be appropriate code the the alpha branch, still |protected behind the VM_STACK switch. I don't have an alpha machine, |so we would need to get some testers with alpha machines to try it out. | |Once there is some testing, we can consider making the change permanent |for both i386 and alpha. | [..] | |Once the alpha code is adequately tested, we can pull VM_STACK out |everywhere. | Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Convert caddr_t --> void * for sys/mman.h functions.alex1997-12-311-2/+2
| | | | | | | | | | | | | | | | mlock, mmap, mprotect, msync, munlock, and munmap are defined by POSIX as taking void *. The const modifier has been added to mlock, munlock, and mprotect as the standard dictates. minherit comes from OpenBSD and has been updated to conform with their recent change to void *. madvise and mincore are not defined by POSIX, but their arguments have been modified to be consistent with the POSIX-defined functions. mincore takes a const pointer, but madvise does not due to the MADV_FREE case. Discussed with: bde
OpenPOWER on IntegriCloud