diff options
Diffstat (limited to 'usr/src/cmd/fs.d/autofs/autod_main.c')
| -rw-r--r-- | usr/src/cmd/fs.d/autofs/autod_main.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/usr/src/cmd/fs.d/autofs/autod_main.c b/usr/src/cmd/fs.d/autofs/autod_main.c index 3b64fcc902..5aa5ff13f5 100644 --- a/usr/src/cmd/fs.d/autofs/autod_main.c +++ b/usr/src/cmd/fs.d/autofs/autod_main.c @@ -90,13 +90,6 @@ extern int _autofssys(int, void *); #define CTIME_BUF_LEN 26 -/* - * XXX - this limit was imposed due to resource problems - even though - * we can and do try and set the rlimit to be able to handle more threads, - * fopen() doesn't allow more than 256 fp's. - */ -#define MAXTHREADS 64 - #define RESOURCE_FACTOR 8 #ifdef DEBUG #define AUTOFS_DOOR "/var/run/autofs_door" @@ -210,6 +203,19 @@ main(argc, argv) (void) ns_setup(NULL, NULL); /* + * we're using doors and its thread management now so we need to + * make sure we have more than the default of 256 file descriptors + * available. + */ + rlset.rlim_cur = RLIM_INFINITY; + rlset.rlim_max = RLIM_INFINITY; + if (setrlimit(RLIMIT_NOFILE, &rlset) == -1) + syslog(LOG_ERR, "setrlimit failed for %s: %s", AUTOMOUNTD, + strerror(errno)); + + (void) enable_extended_FILE_stdio(-1, -1); + + /* * establish our lock on the lock file and write our pid to it. * exit if some other process holds the lock, or if there's any * error in writing/locking the file. |
