[opensuse-packaging] FYI: glibc 2.8 may break some of your packages
HI all : Factory currenlty has glibc 2.8 which may break some of your packages, Im going to describe just one possible breakage, and hope someone else can contribute information about other breakages. glibc 2.8 no longer defines ARG_MAX constant in linux, so you may see: foobar.c:N: error: 'ARG_MAX' undeclared (first use in this function) To fix this problem you can use something like this #include <unistd.h> /* only if not already there !! */ #if defined(_SC_ARG_MAX) # if defined(ARG_MAX) # undef ARG_MAX # endif # define ARG_MAX sysconf (_SC_ARG_MAX) #endif HTH. Cristian. -- "Freedom of religion also means freedom **from** religion" - Anonymous Cristian Rodríguez R. Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opensuse.org/
Am Freitag 11 April 2008 schrieb Cristian Rodríguez:
HI all :
Hi Cristian, thanks for the details.
Factory currenlty has glibc 2.8 which may break some of your packages, Im going to describe just one possible breakage, and hope someone else can contribute information about other breakages.
We backed out most of this - leaving it to BETA for now. glibc 2.8 will be released pretty quickly, leaving our glibc 2.7 as pretty old, so we decided to take some risk, surely not expecting that many problems.
glibc 2.8 no longer defines ARG_MAX constant in linux, so you may see:
foobar.c:N: error: 'ARG_MAX' undeclared (first use in this function)
To fix this problem you can use something like this
Note, that the code should have done that before too, as the glibc info pages say: Each of the following limit parameters has a macro that is defined in `limits.h' only if the system has a fixed, uniform limit for the parameter in question. If the system allows different file systems or files to have different limits, then the macro is undefined; use `sysconf' to find out the limit that applies at a particular time on a particular machine. Greetings, Stephan -- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Fri, 11 Apr 2008, Stephan Kulow wrote:
glibc 2.8 no longer defines ARG_MAX constant in linux, so you may see:
foobar.c:N: error: 'ARG_MAX' undeclared (first use in this function)
Note, that the code should have done that before too, as the glibc info pages say:
Each of the following limit parameters has a macro that is defined in `limits.h' only if the system has a fixed, uniform limit for the parameter in question. If the system allows different file systems or files to have different limits, then the macro is undefined; use `sysconf' to find out the limit that applies at a particular time on a particular machine.
Sometimes it's also that an include of <limits.h> is just missing (e.g. for PATH_MAX). Older glibc could possibly include limits.h indirectly with other headers, so nobody noticed it missing, now you do. There's also one other problem which happened from time to time: "struct ucred" (from <sys/socket.h> (really <bits/socket.h>)) is a GNU extension, and therefore has to be guarded by -D_GNU_SOURCE. In older glibcs this accidentally wasn't the case and some programs came to rely on this. For those programs/files you need to define _GNU_SOURCE before the inclusion of the first header (or in CFLAGS). Ciao, Michael. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Cristian Rodríguez wrote:
#include <unistd.h> /* only if not already there !! */
#if defined(_SC_ARG_MAX) # if defined(ARG_MAX) # undef ARG_MAX # endif # define ARG_MAX sysconf (_SC_ARG_MAX) #endif
Any POSIX guru around to enlighten me about the proper usage of _PC_PATH_MAX? If I want to know the maximum length of any absolute pathname the application might possibly deal with, then the correct formula is #define PATH_MAX pathconf("/", _PC_PATH_MAX) ? The manpage says _PC_PATH_MAX returns the maximum length of a relative pathname when path or filedes is the current working directory. The corresponding macro is _POSIX_PATH_MAX. which isn't quite clear to me (do I have to add 1 for the leading slash and 1 for the terminating nul byte?). Also, in what case is this value different from 4096 on linux? thanks, Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Monday 14 April 2008 14:53:29 Michal Marek wrote:
do I have to add 1 for the leading slash and 1 for the terminating nul byte?). Also, in what case is this value different from 4096 on linux?
pathconf() gives you the buffer size needed; you don't need to add anything. The value on Linux is always 4096 (see include/linux/limits.h). Andreas --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Andreas Gruenbacher wrote:
On Monday 14 April 2008 14:53:29 Michal Marek wrote:
do I have to add 1 for the leading slash and 1 for the terminating nul byte?). Also, in what case is this value different from 4096 on linux?
pathconf() gives you the buffer size needed; you don't need to add anything. The value on Linux is always 4096 (see include/linux/limits.h).
OK, thanks for confirming my assumption. And I was actually wrong in thinking that new glibc stopped providing PATH_MAX, it was the package not including <limits.h>. So calling pathconf() isn't actually needed here. thanks, Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (5)
-
Andreas Gruenbacher
-
Cristian Rodríguez
-
Michael Matz
-
Michal Marek
-
Stephan Kulow