How to determine the system value for _POSIX_PATH_MAX

Can anyone tell me how to find the system value for _POSIX_PATH_MAX in Linux mint? I know that it is available in the <limits.h> file, but I do not know how to find it.

+5
source share
3 answers

A tool for use under POSIX is called getconf (1):

  $ getconf _POSIX_PATH_MAX 256 
+3
source

Another way to get value.

 #include "stdio.h" #include "unistd.h" #include "limits.h" int main() { printf ("Value :: %d \n", _POSIX_PATH_MAX); return 0; } 
0
source

#define one of the following

 #define _POSIX_SOURCE #define _POSIX_C_SOURCE 1 /* or any value larger then 1 */ #define _XOPEN_SOURCE 

until #include ing <limits.h> , and the compiler will see _POSIX_PATH_MAX .

You can also specify this on the command line using the -D compiler option:

 gcc -c main.c -D_POSIX_C_SOURCE=1 

eg.

0
source

All Articles