This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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: Determining if an address is valid prior to using it.


If I understand correctly, access() only applies to file system queries.

Is there a way to use it to check arbitrary memory locations?


----- Original Message -----
From: "Bruce Korb" <bruce.korb@gmail.com>
To: "Nathan Weyer" <nweyer@meritgames.com>
Sent: Wednesday, July 23, 2008 5:05:20 PM GMT -05:00 US/Canada Eastern
Subject: Re: Determining if an address is valid prior to using it.

Too much work.  Just supply the address as the first
argument to the access() call.  It will fail, but if
errno is set to EFAULT, then you know.



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