> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/string/bstring.3.md).

# bstring.3

`bstring` — 字节字符串操作

## 名称

`bcmp`, `bcopy`, `bzero`, `memccpy`, `memchr`, `memcmp`, `memcpy`, `memmove`, `memset`

## 库

Lb libc

## 概要

`#include <string.h>`

`Ft int Fn bcmp const void *b1 const void *b2 size_t len Ft void Fn bcopy const void *src void *dst size_t len Ft void Fn bzero void *b size_t len Ft void * Fn memchr const void *b int c size_t len Ft int Fn memcmp const void *b1 const void *b2 size_t len Ft void * Fo memccpy void * restrict dst const void * restrict src int c size_t len Fc Ft void * Fn memcpy void *dst const void *src size_t len Ft void * Fn memmove void *dst const void *src size_t len Ft void * Fn memset void *b int c size_t len`

## 描述

这些函数对可变长度的字节字符串进行操作。它们不像 string(3) 中列出的例程那样检查结尾的 NUL 字节。

更多信息请参阅具体的手册页。

## 参见

[bcmp(3)](/man/string/bcmp.3.md), bcopy(3), [bzero(3)](/man/string/bzero.3.md), memccpy(3), memchr(3), [memcmp(3)](/man/string/memcmp.3.md), memcpy(3), memmove(3), memset(3)

## 标准

`memchr`、`memcmp`、`memcpy`、`memmove` 和 `memset` 函数遵循 ISO/IEC 9899:1990 ("ISO C89")。

## 历史

`bzero` 和 `memccpy` 函数出现于 4.3BSD；`bcmp` 和 `bcopy` 函数出现于 4.2BSD。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/string/bstring.3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
