This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Determining if an address is valid prior to using it.
- From: Nathan Weyer <nweyer at meritgames dot com>
- To: libc-help at sourceware dot org
- Date: Thu, 24 Jul 2008 09:51:48 -0400 (EDT)
- Subject: 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.