This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Limits?


Hello!

Elias Biris wrote:
> 
> Hi all,
> 
> I'd like to ask where can I find information about the types of limits that are set in cygwin utilities for win2k? I am looking specifically for:
> 
> Maximum number of characters that by default can be used in a pathname
> Maximum number of characters that by default can be used in a filename (together with its path)
> Maximum number of characters that by default can be used in a command or commands that can be called by 'exec'
> 
> Sorry for the wide distribution but I could not find this for Cygwin specifically. All information will be gratefully appreciated.
> 

Try this little program:
-- snip -- snap --
#include <limits.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char** argv) {
        printf("Max pathname: '%d'\n",
               sysconf(_PC_PATH_MAX));
        printf("Max filename: '%d'\n",
               sysconf(_PC_NAME_MAX));
        printf("Max arguments: '%d'\n",
               sysconf(_SC_ARG_MAX));
}
-- snap -- snip --

The first line of output shows the guaranteed number of characters in a
relative path; the second line shows the guaranteed number of characters
in a filename alone (not preceeded by any path) (both may be limited by
the filesystem on which a file is located; have a look at fpathconf()
and pathconf() also); the third line shows the maximum number of
characters in the argument of an exec() call.


There is no manual page for sysconf() in my cygwin install, but on every
average unix box there is.

Regards,
    Jan

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]