lsearch(3) Library Functions Manual lsearch(3) NOM lsearch, lfind - Recherche lineaire dans un tableau BIBLIOTHEQUE Bibliotheque C standard (libc, -lc) SYNOPSIS #include void *lfind(size_t *n, size_t size; const void key[size], const void base[*n * size], size_t *n, size_t size, typeof(int (const void [size], const void [size])) *compar); void *lsearch(size_t *n, size_t size; const void key[size], void base[*n * size], size_t *n, size_t size, typeof(int (const void [size], const void [size])) *compar); DESCRIPTION lfind() and lsearch() perform a linear search for key in the array base which has *n elements of size bytes each. The comparison function referenced by compar is expected to have two arguments which point to the key object and to an array member, in that order, and which returns zero if the key object matches the array member, and nonzero otherwise. If lsearch() does not find a matching element, then the key object is inserted at the end of the table, and *n is incremented. In particular, one should know that a matching element exists, or that more room is available. VALEUR RENVOYEE lfind() renvoie un pointeur sur l'element du tableau correspondant, ou NULL si aucune correspondance n'est trouvee. lsearch() renvoie un pointeur sur un element correspondant du tableau, ou sinon sur le nouvel element ajoute. ATTRIBUTS Pour une explication des termes utilises dans cette section, consulter attributes(7). +---------------------------------+--------------------------+---------+ |Interface | Attribut | Valeur | +---------------------------------+--------------------------+---------+ |lfind(), lsearch() | Securite des threads | MT-Safe | +---------------------------------+--------------------------+---------+ NORMES POSIX.1-2008. HISTORIQUE POSIX.1-2001, SVr4, 4.3BSD. libc-4.6.27. BOGUES L'appellation est malheureuse. VOIR AUSSI bsearch(3), hsearch(3), tsearch(3) TRADUCTION La traduction francaise de cette page de manuel a ete creee par Christophe Blaess , Stephan Rafin , Thierry Vignaud , Francois Micaux, Alain Portal , Jean-Philippe Guerard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas Francois , Florentin Duneau , Simon Paillard , Denis Barbier , David Prevot , Jean-Baptiste Holcroft et Gregoire Scano Cette traduction est une documentation libre ; veuillez vous reporter a la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITE LEGALE. Si vous decouvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message a . Pages du manuel de Linux 6.18 8 fevrier 2026 lsearch(3)