Find out the process address space

From: For-NG (
Date: 11/29/03

Date: 29 Nov 2003 04:16:07 -0800

Hi there,

 Is there a way to find out the process address space boundaries
(interms of addresses) programatically (in the user space only). Also
the start and end boundaries of different segments, if they can be
found out.

 More precisely, I want to find out an authentic way by which I can
say a given address is invalid for this process (or for the current
process), and I get EFAULT kind of error if I use this address for
system calls like write,sigaction etc. Is there any existing library
routine exists which can do so. More wanted for Linux.
 I hope I am clear in specifying my doubt.