.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:55:27 1993 by Rik Faith (faith@cs.unc.edu) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" This file is distributed under the same license as original manpage .\" Copyright of the original manpage: .\" Copyright © 1993 David Metcalfe .\" Copyright © of Polish translation: .\" Adam Byrtek (PTM) , 1998. .\" Andrzej Krzysztofowicz (PTM) , 2002. .\" Robert Luberda , 2013. .\" Michał Kułach , 2014, 2016. .TH MEMCMP 3 2015\-08\-08 "" "Podręcznik programisty Linuksa" .SH NAZWA memcmp \- porównuje obszary pamięci .SH SKŁADNIA .nf \fB#include \fP .sp \fBint memcmp(const void *\fP\fIs1\fP\fB, const void *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .SH OPIS Funkcja \fBmemcmp\fP() porównuje pierwsze \fIn\fP bajtów (każdy interpretowany jako \fIunsigned char\fP) obszaru pamięci \fIs1\fP z obszarem \fIs2\fP. .SH "WARTOŚĆ ZWRACANA" Funkcja \fBmemcmp\fP() zwraca liczbę całkowitą mniejszą od zera, równą zeru lub większą od zera, jeżeli \fIs1\fP jest odpowiednio mniejszy niż, równy lub większy niż pierwsze \fIn\fP bajtów \fIs2\fP. Jeśli wartość zwracana jest niezerowa, dodatni lub ujemny znak tej wartości jest określany na podstawie znaku różnicy pomiędzy pierwszą parę bajtów (interpretowanych jako \fIunsigned char\fP), które się różnią pomiędzy \fIs1\fP i \fIs2\fP. Jeśli \fIn\fP jest zerem, zwracaną wartością jest zero. .SH ATRYBUTY Informacje o pojęciach używanych w tym rozdziale można znaleźć w podręczniku \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfejs Atrybut Wartość T{ \fBmemcmp\fP() T} Bezpieczeństwo wątkowe MT\-Safe .TE .SH "ZGODNE Z" POSIX.1\-2001, POSIX.1\-2008, C89, C99, SVr4, 4.3BSD. .SH UWAGI .PP Nie należy używać \fBmemcmp\fP() do porównywania danych krytycznych ze względu na bezpieczeństwo, takich jak sekrety kryptograficzne, ponieważ wymagany czas procesora zależy od liczby równający się sobie bajtów. W zamian, wymagana jest funkcja wykonująca porównanie w stałych czasie. Niektóre systemy operacyjne udostępniają taką\ funkcję (np. w systemie NetBSD jest to \fBconsttime_memequal\fP()), lecz nie określono jej w specyfikacji POSIX. Pod Linuksem może być\ konieczne samodzielne zaimplementowanie takiej funkcji. .SH "ZOBACZ TAKŻE" \fBbcmp\fP(3), \fBstrcasecmp\fP(3), \fBstrcmp\fP(3), \fBstrcoll\fP(3), \fBstrncasecmp\fP(3), \fBstrncmp\fP(3), \fBwmemcmp\fP(3) .SH "O STRONIE" Angielska wersja tej strony pochodzi z wydania 4.07 projektu Linux \fIman\-pages\fP. Opis projektu, informacje dotyczące zgłaszania błędów oraz najnowszą wersję oryginału można znaleźć pod adresem \%https://www.kernel.org/doc/man\-pages/. .SH TŁUMACZENIE Autorami polskiego tłumaczenia niniejszej strony podręcznika man są: Adam Byrtek (PTM) , Andrzej Krzysztofowicz (PTM) , Robert Luberda i Michał Kułach . .PP Polskie tłumaczenie jest częścią projektu manpages-pl; uwagi, pomoc, zgłaszanie błędów na stronie http://sourceforge.net/projects/manpages-pl/. Jest zgodne z wersją \fB 4.07 \fPoryginału.