Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

memchr(3) [freebsd man page]

MEMCHR(3)						   BSD Library Functions Manual 						 MEMCHR(3)

NAME
memchr -- locate byte in byte string LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <string.h> void * memchr(const void *b, int c, size_t len); void * memrchr(const void *b, int c, size_t len); DESCRIPTION
The memchr() function locates the first occurrence of c (converted to an unsigned char) in string b. The memrchr() function behaves like memchr(), except that it locates the last occurrence of c in string b. RETURN VALUES
The memchr() and memrchr() functions return a pointer to the byte located, or NULL if no such byte exists within len bytes. SEE ALSO
memmem(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3), wmemchr(3) STANDARDS
The memchr() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The memrchr() function is a GNU extension and conforms to no standard. HISTORY
The memrchr() function first appeared in GNU libc 2.1.91, this implementation first appeared in FreeBSD 6.4, coming from OpenBSD 4.3. BSD
April 9, 2008 BSD

Check Out this Related Man Page

MEMCHR(3)						     Linux Programmer's Manual							 MEMCHR(3)

NAME
memchr, memrchr - scan memory for a character SYNOPSIS
#include <string.h> void *memchr(const void *s, int c, size_t n); void *memrchr(const void *s, int c, size_t n); DESCRIPTION
The memchr() function scans the first n bytes of the memory area pointed to by s for the character c. The first byte to match c (inter- preted as an unsigned character) stops the operation. The memrchr() function is like the memchr() function, except that it searches backwards from the end of the n bytes pointed to by s instead of forwards from the front. RETURN VALUE
The memchr() and memrchr() functions return a pointer to the matching byte or NULL if the character does not occur in the given memory area. CONFORMING TO
The memchr() function conforms to SVID 3, BSD 4.3, ISO 9899, POSIX. The memrchr() function is a GNU extension, available since glibc 2.1.91. SEE ALSO
index(3), rindex(3), strchr(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3) GNU
2002-02-20 MEMCHR(3)
Man Page

6 More Discussions You Might Find Interesting

1. Programming

C program in Unix / Linux - Time differences

Hi Friends, When Iam running c program in redhat linux 7.3 version and PCQ Linux 8.0 version, its taking around 20 seconds. But when Iam running it in HP-UX Release 11i, its taking around 3 minutes. Can anyone throw light on this. Thanks in advance, Praveen. (11 Replies)
Discussion started by: chprvkmr
11 Replies

2. Solaris

Apache config issue

I want to build a little website on a Sun Blade 100 running Solaris 10. I just went out to apache.org and downloaded Unix Source: httpd-2.2.8.tar.gz After unpacking the tarball, I CD'd into the subdirectory and ran the configure utility. Of course, it crapped out. I see that it is... (17 Replies)
Discussion started by: BrewDudeBob
17 Replies

3. Solaris

Need help in building gcc on solaris.

We are moving from old solaris to new version of solaris. I have copied the gcc compiler installed on old server to new solaris server. But just copying didn't work. So I am trying to build it on the new server. The server version is sailfish@st-kvar02 -> uname -a SunOS st-kvar02 5.10... (7 Replies)
Discussion started by: nalina.hv
7 Replies

4. Shell Programming and Scripting

Files with 0 file size and created today

hi, I am building a script to identify those files created/modified today and with file size 0. I am able to find the files with 0 file size and created/modified in last 24 hrs as shown below but not today (current date), I tried using (touch -t time filenm) but in my version of unix at work it... (7 Replies)
Discussion started by: rushs682
7 Replies

5. Programming

Wildcard Pattern Matching In C

I've been having problems lately trying to do pattern matching in C while implementing wildcards. Take for instance the following code: #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dirent.h> #include <string.h> ... (14 Replies)
Discussion started by: Azrael
14 Replies

6. AIX

Compiling problem - AIX 7.2

Hi We meet errors while running configuration scripts to prepare compiling source code on AIX 7.2. This error does not happen on AIX5.3 and AIX6.1 With the “/usr/bin/sh” from AIX7.2, sometimes , the script runs sucessfully, sometimes not. It’s unstable, and I don’t know why. When... (10 Replies)
Discussion started by: bobochacha29
10 Replies