1219820Sjeff#ifndef _LIBIBVERBS_ALLOCA_H_
2219820Sjeff#define	_LIBIBVERBS_ALLOCA_H_
3219820Sjeff#include <stdlib.h>
4219820Sjeff#include <string.h>
5219820Sjeff#include <stdlib.h>
6219820Sjeff
7219820Sjeff#define	strdupa(_s)						\
8219820Sjeff({								\
9219820Sjeff	char *_d;						\
10219820Sjeff	int _len;						\
11219820Sjeff								\
12219820Sjeff	_len = strlen(_s) + 1;					\
13219820Sjeff	_d = alloca(_len);					\
14219820Sjeff	if (_d)							\
15219820Sjeff		memcpy(_d, _s, _len);				\
16219820Sjeff	_d;							\
17219820Sjeff})
18219820Sjeff#endif	/* _LIBIBVERBS_ALLOCA_H_ */
19