view doc/glibc-functions/memmem.texi @ 12280:39be377f1765

getgroups: don't expose GETGROUPS_T to user These days, most systems already declare getgroups with gid_t*. But in the rare case that GETGROUPS_T is still int but gid_t is short, the user should not have to uglify their code; let the replacement hide all the magic. Tested by configuring with ac_cv_type_getgroups=uint64_t on a platform with 32-bit gid_t, and ignoring compiler warnings. However, since we don't replace setgroups, the GETGROUPS_T workaround is still needed there for now. * lib/getgroups.c (rpl_getgroups): Change signature. Copy array an element at a time if GETGROUPS_T is wrong size. * lib/getugroups.h (getugroups): Change signature. * lib/unistd.in.h (getgroups): Likewise. * m4/getgroups.m4 (gl_FUNC_GETGROUPS): Use replacement if signature needs fixing. * m4/getugroups.m4 (gl_GETUGROUPS): No longer need AC_TYPE_GETGROUPS. * modules/group-member (Depends-on): Add getgroups. * lib/group-member.c (group_info, get_group_info): Use gid_t. (group_member): Rely on getgroups replacement. * lib/getugroups.c (getugroups): Use gid_t. * tests/test-getgroups.c (main): Likewise. * NEWS: Mention the signature change. * doc/posix-functions/getgroups.texi (getgroups): Mention the problem with signature. * doc/glibc-functions/setgroups.texi (setgroups): Mention that GETGROUPS_T is still useful for setgroups. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Thu, 12 Nov 2009 10:19:39 -0700
parents 5be97759685c
children 1d8a613275c6
line wrap: on
line source

@node memmem
@subsection @code{memmem}
@findex memmem

Gnulib module: memmem or memmem-simple

Portability problems fixed by either Gnulib module @code{memmem-simple}
or @code{memmem}:
@itemize
@item
This function is missing on some platforms:
MacOS X 10.3, FreeBSD 5.2.1, OpenBSD 4.0, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix 3.5, BeOS.
@item
This function has reversed arguments on some older platforms:
Linux libc 5.0.9
@end itemize

Portability problems fixed by Gnulib module @code{memmem}:
@itemize
@item
This function returns incorrect values in some cases, such as when
given an empty needle:
glibc <= 2.0, Cygwin 1.5.x.
@item
This function has quadratic instead of linear worst-case complexity on some
platforms:
glibc 2.8, FreeBSD 6.2, NetBSD 3.0, AIX 5.1, Cygwin 1.5.x.
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@end itemize