Is there any way (whether it is a syscall, procfs, sysfs) to get a size of a virtual address space portion that is reserved for userspace? If I understand it correctly, what I need is a kernel' TASK_SIZE constant, unless there are some other regions above this line which can be made accessible in userspace. Anyway it seems to be a kernel configuration constant which is shared by all processes. Unfortunately I haven't found any sign that it is exposed to usermode somewhere.
For example getrlimit(RLIMIT_AS) says infinite rather that exact numeric limit. sysconf() doesn't have anything similar at all. There is a vsize in /proc/<pid>/stat which is a currently allocated virtual memory size for a given process, but I'm looking for an upper limit for this field. Is there any way to obtain this limit?