bcmp(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

bcmp(3c)

bstring(3C)              Standard C Library Functions              bstring(3C)

NAME
       bstring, bcopy, bcmp, bzero, explicit_bzero - memory operations

SYNOPSIS
       #include <strings.h>

       void bcopy(const void *s1, void *s2, size_t n);


       int bcmp(const void *s1, const void *s2, size_t n);


       void bzero(void *s, size_t n);


       void explicit_bzero(void *s, size_t n);

DESCRIPTION
       The bcopy(), bcmp(), bzero(), and explicit_bzero() functions operate as
       efficiently  as  possible on memory areas (arrays of bytes bounded by a
       count, not terminated by a null character). They do not check  for  the
       overflow  of  any receiving memory area. These functions are similar to
       the memcpy(), memcmp(), memset(), and explicit_memset()  functions  de‐
       scribed on the memory(3C) manual page.


       The  bcopy() function copies n bytes from memory area s1 to s2. Copying
       between objects that overlap will take place correctly.


       The bcmp() function compares the first n bytes of  its  arguments,  re‐
       turning  0  if  they are identical and 1 otherwise. The bcmp() function
       always returns 0 when n is 0.


       The bzero() function sets the first n bytes in memory area s to 0.


       The explicit_bzero() function performs the same operation  as  bzero().
       It differs from bzero() in that it will not be removed by compiler dead
       store analysis. The explicit_bzero() function is useful for clearing no
       longer needed sensitive data to ensure that it does not remain accessi‐
       ble in process memory.

USAGE
       These  functions  are  provided  for compatibility with older code. The
       memcpy(), memcmp(), and memset() functions defined by the  C  standards
       are more portable and preferred in newly written code.

WARNINGS
       The bcopy() function takes the first two parameters in the opposite or‐
       der of memcpy(). See memory(3C).

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface  StabilityCommitted  _  MT-LevelAsync-Signal-
       Safe _ StandardSee below


   Standard
       See standards(7) for descriptions of the following standards:

       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) INTERFACESAPPLICA‐
       BLE STANDARDS _ bcopy(), bcmp(), bzero()T{
         POSIX.1-2001 through 2004,
         SUS through SUSv3,
         XPG4v2 through XPG6

       T} _ explicit_bzero()None


SEE ALSO
       timingsafe_bcmp(3C),   freezero(3C),  memory(3C),  string(3C),  attrib‐
       utes(7), standards(7)

HISTORY
       The explicit_bzero() function first appeared in  OpenBSD  5.5  and  was
       added to Oracle Solaris in the Solaris 11.4.12 release.


       The  bcopy(),  bcmp(),  and bzero() functions were added to libc in the
       Solaris 2.5 release. In Solaris 2 releases prior to 2.5  they  were  in
       the libucb library.

Oracle Solaris 11.4               2 Jun 2022                       bstring(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3