Re: memmem(3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No, please ignore, I did not get that I also have to include <features.h> in order to define __USE_GNU via _GNU_SOURCE:

#ifdef  _GNU_SOURCE
# define __USE_GNU      1
#endif

Andreas

On 09.01.19 20:07, Andreas Westfeld wrote:
SYNOPSIS
       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include <string.h>

should be

SYNOPSIS
       #define __USE_GNU         /* See feature_test_macros(7) */
       #include <string.h>

because <string.h> needs it for declaring memmem ... (see below). The same symbol replacement is necessary in man 3 mempcpy, strfry, memfrob, memchr and probably others.

Andreas

#ifdef __USE_GNU
/* Find the first occurrence of NEEDLE in HAYSTACK.
   NEEDLE is NEEDLELEN bytes long;
   HAYSTACK is HAYSTACKLEN bytes long.  */
extern void *memmem (const void *__haystack, size_t __haystacklen,
                     const void *__needle, size_t __needlelen)
     __THROW __attribute_pure__ __nonnull ((1, 3));
[...]



--
Andreas Westfeld, 0432 01CC F511 9E2B 0B57 5993 0B22 98F8 4AD8 EEEA
HTW Dresden, Fakultät Informatik/Mathematik
Informatikrecht/Informationssicherheit, Zimmer Z 337
Tel. +49-351-462-3372, http://www.htw-dresden.de/~westfeld

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux