This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Wierd problems with posix_memalign...
- From: Kimmo Fredriksson <kfredrik at cs dot joensuu dot fi>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 14 Aug 2003 13:42:55 +0000 (UTC)
- Subject: Wierd problems with posix_memalign...
- Replyto: Kimmo Fredriksson <kfredrik@cs.joensuu.fi>
Hi,
I'm having troubles with posix_memalign. The following works OK:
int r;
void *p;
r = posix_memalign( &p, 16, 65536 );
if( r ) fprintf( stderr, "%s\n", strerror( r ));
But e.g. this fails:
r = posix_memalign( &p, 16, 65 );
if( r ) fprintf( stderr, "%s\n", strerror( r ));
i.e. it outputs: Invalid argument
Why? It seems that the number of bytes (the last parameter) is "invalid".
This happens with at least gcc 2.96 and gcc 3.3.1.
My system is Linux 2.4.18 / RH8.0.
kf