diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/unix-v10/man3/memory.3 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/unix-v10/man3/memory.3')
| -rw-r--r-- | static/unix-v10/man3/memory.3 | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/static/unix-v10/man3/memory.3 b/static/unix-v10/man3/memory.3 new file mode 100644 index 00000000..2edea28c --- /dev/null +++ b/static/unix-v10/man3/memory.3 @@ -0,0 +1,118 @@ +.TH MEMORY 3 +.CT 2 mem_man +.SH NAME +memccpy, memchr, memcmp, memcpy, memmove, memset \(mi memory operations +.SH SYNOPSIS +.nf +.B char *memccpy(s1, s2, c, n) +.B char *s1, *s2; +.B int c, n; +.PP +.B char *memchr(s, c, n) +.B char *s; +.B int c, n; +.PP +.B int memcmp(s1, s2, n) +.B char *s1, *s2; +.B int n; +.PP +.B char *memcpy(s1, s2, n) +.B char *s1, *s2; +.B int n; +.PP +.B char *memmove(s1, s2, n) +.B char *s1, *s2; +.B int n; +.PP +.B char *memset(s, c, n) +.B char *s; +.B int c, n; +.fi +.SH DESCRIPTION +These functions operate efficiently on memory areas +(arrays of characters bounded by a count, not terminated by a null character). +They do not check for the overflow of any receiving memory area. +.PP +.I Memccpy +copies characters from memory area +.I s2 +into +.IR s1 , +stopping after the first occurrence of character +.I c +has been copied, or after +.I n +characters have been copied, whichever comes first. +It returns a pointer to the character after +the copy of +.I c +in +.IR s1 , +or zero if +.I c +was not found in the first +.I n +characters of +.IR s2 . +.PP +.PP +.I Memchr +returns a pointer to the first +occurrence of character +.I c +in the first +.I n +characters of memory area +.IR s, +or zero if +.I c +does not occur. +.PP +.I Memcmp +compares its arguments, looking at the first +.I n +characters only, and returns an integer +less than, equal to, or greater than 0, +according as +.I s1 +is lexicographically less than, equal to, or +greater than +.IR s2 . +.PP +.I Memcpy +copies +.I n +characters from memory area +.I s2 +to +.I s1. +It returns +.I s1. +.PP +.I Memmove +is the same as +.I memcpy, +except it is guaranteed to handle overlapping strings as +if the move had been made to a temporary and then to the destination. +.PP +.I Memset +sets the first +.I n +characters in memory area +.I s +to the value of character +.IR c . +It returns +.IR s . +.SH SEE ALSO +.IR string (3) +.SH BUGS +.I Memcmp +uses native character comparison, which is signed +on some machines, unsigned on others; +thus the sign of the value returned when a +character has its high-order bit set is implementation-dependent. +.br +Thanks to ANSI X3J11 for the +.IR memcpy/memmove +distinction. |
