![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing a file descriptor | robotball | Shell Programming and Scripting | 6 | 06-08-2008 11:41 PM |
| Problems with file descriptor | teo | High Level Programming | 11 | 05-09-2005 12:47 PM |
| File Descriptor Help | rahulrathod | UNIX for Dummies Questions & Answers | 3 | 10-14-2004 06:08 AM |
| file activity (open/closed) file descriptor info using KORN shell scripting | Gary Dunn | UNIX for Dummies Questions & Answers | 3 | 06-07-2004 02:54 PM |
| bad file descriptor? | ftb | UNIX for Dummies Questions & Answers | 1 | 02-20-2002 07:19 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Using getrlimit and the appropriate constants, this is what I am using now. Code:
struct rlimit RL; getrlimit(RLIMIT_NOFILE, &RL) for ( int fd = 3; fd <= RL.rlim_cur; ++fd ) close(fd); Apparently rlim_cur and rlim_max gives me 1024 on my machine. Thanks, Vino |
|
||||
|
You misunderstand. A process can call setrlimit() and reduce the number of open file desriptors allowed by the process. Or it can be reduced for all users.
The kernel on some versions of unix can be reconfigured to allow more than 1024 open file descriptors. The point: You cannot depend on 1024 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|