Hi, 

I have a problem. I compiled my private shell in 64 bit mode and I use libfind
to make the find command a shell builtin.

Now find -exec cmd {} + needs to know ARG_MAX and calls sysconf(_SC_ARG_MAX).

If the shell is compiled in 32 bit mode, it will get 1048320
If the shell is compiled in 64 bit mode, it will get 2096640

If the shell will call "cmd" and it is a 64 bit binary everything will be OK.
If the shell will call "cmd" and it is a 32 bit binary we may see an
"arg list too long" error.

My questions are:

-       How do I get the 32 bit ARG_MAX value from inside a 64 bit program?

-       What is the best way to detect whether "cmd" is a 32 os a 64 bit binary?


Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to