string.h revision 289624
150276Speter/* $FreeBSD: head/sys/ofed/include/linux/string.h 289624 2015-10-20 11:40:04Z hselasky $ */
250276Speter/*-
3166124Srafan * Copyright (c) 2010 Isilon Systems, Inc.
450276Speter * Copyright (c) 2010 iX Systems, Inc.
550276Speter * Copyright (c) 2010 Panasas, Inc.
650276Speter * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
750276Speter * All rights reserved.
850276Speter *
950276Speter * Redistribution and use in source and binary forms, with or without
1050276Speter * modification, are permitted provided that the following conditions
1150276Speter * are met:
1250276Speter * 1. Redistributions of source code must retain the above copyright
1350276Speter *    notice unmodified, this list of conditions, and the following
1450276Speter *    disclaimer.
1550276Speter * 2. Redistributions in binary form must reproduce the above copyright
1650276Speter *    notice, this list of conditions and the following disclaimer in the
1750276Speter *    documentation and/or other materials provided with the distribution.
1850276Speter *
1950276Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2050276Speter * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2150276Speter * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2250276Speter * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2350276Speter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2450276Speter * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2550276Speter * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2650276Speter * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2750276Speter * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2850276Speter * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2950276Speter */
30166124Srafan
3150276Speter#ifndef	_LINUX_STRING_H_
3250276Speter#define	_LINUX_STRING_H_
3350276Speter
3450276Speter#include <linux/types.h>
3550276Speter#include <linux/gfp.h>
3650276Speter#include <linux/slab.h>
3750276Speter
3850276Speter#include <sys/libkern.h>
3950276Speter
4050276Speter#define strnicmp strncasecmp
4150276Speter
4250276Speter
4350276Speterstatic inline void *
44166124Srafankmemdup(const void *src, size_t len, gfp_t gfp)
4550276Speter{
4650276Speter	void *dst;
4750276Speter
4850276Speter	dst = kmalloc(len, gfp);
49166124Srafan	if (dst)
50166124Srafan		memcpy(dst, src, len);
51166124Srafan	return (dst);
52166124Srafan}
53166124Srafan
54166124Srafan#endif	/* _LINUX_STRING_H_ */
55166124Srafan