The Open Group Base Specifications Issue 6
IEEE Std 1003.1, 2003 Edition
Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.

NAME

bcmp - memory operations (LEGACY)

SYNOPSIS

[XSI] [Option Start] #include <strings.h>

int bcmp(const void *
s1, const void *s2, size_t n); [Option End]

DESCRIPTION

The bcmp() function shall compare the first n bytes of the area pointed to by s1 with the area pointed to by s2.

RETURN VALUE

The bcmp() function shall return 0 if s1 and s2 are identical; otherwise, it shall return non-zero. Both areas are assumed to be n bytes long. If the value of n is 0, bcmp() shall return 0.

ERRORS

No errors are defined.


The following sections are informative.

EXAMPLES

None.

APPLICATION USAGE

The memcmp() function is preferred over this function.

For maximum portability, it is recommended to replace the function call to bcmp() as follows:

#define bcmp(b1,b2,len) memcmp((b1), (b2), (size_t)(len))

RATIONALE

None.

FUTURE DIRECTIONS

This function may be withdrawn in a future version.

SEE ALSO

memcmp() , the Base Definitions volume of IEEE Std 1003.1-2001, <strings.h>

CHANGE HISTORY

First released in Issue 4, Version 2.

Issue 5

Moved from X/OPEN UNIX extension to BASE.

Issue 6

This function is marked LEGACY.

End of informative text.


UNIX ® is a registered Trademark of The Open Group.
POSIX ® is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]