site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com You are mistaken. man 2 setrlimit -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Feb 14, 2008, at 11:43 AM, David McGavran wrote: I would guess this has been asked and answered so any pointers are fine. I tried to check the digest but didn't find the answer. I am trying to setup a lot of mem mapped files. But at or around 240 I get EMFILE which man page says means I have too many open. If I am not mistaken on 10.5 at least we are allowed 12000 or so open files? Why can I only open 240 or so memory mapped files? The limit on the number of files for a process is by default 256, as a soft constraint, and the value of maxfiles, as a hard constraint. The value of maxfiles represents the maximum number of files permitted an individual process. In addition, there is a hard constraint based on whatever your parent process decides to constrain you to; the default value of this is "unlimited" (by which it means "whatever the current sysctl-based hard limits are"). Once lowered the value of the hard limit cannot be reaised except by a process with root privilege. The value of maxfiles is reported by the sysctlbyname() value for "kern.maxfilesperproc"; this in turn is constrained by the the sysctlbyname() value for "kern.maxfiles", which is a compile time system limit. Note that the use of actual file descriptors to implement POSIX shared memory is an implementation detail, so all of the above is potentially subject to change in its relevency if that implementation detail ever changes. What can I do to open more? Also note that other administrative constraints other than number of available file descriptors (such as available kernel memory) will potentially also cause your attempt to ail (e.g. ENOMEM, ENOSPC, SPERM, EACCES, etc.). This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert