util.h revision 274116
1168477Sscottl/*-
2168477Sscottl * Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
3168477Sscottl * All rights reserved.
4168477Sscottl *
5168477Sscottl * Redistribution and use in source and binary forms, with or without
6168477Sscottl * modification, are permitted provided that the following conditions
7168477Sscottl * are met:
8168477Sscottl * 1. Redistributions of source code must retain the above copyright
9168477Sscottl *    notice, this list of conditions and the following disclaimer.
10168477Sscottl * 2. Redistributions in binary form must reproduce the above copyright
11268139Smav *    notice, this list of conditions and the following disclaimer in the
12168477Sscottl *    documentation and/or other materials provided with the distribution.
13268139Smav *
14168477Sscottl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15168477Sscottl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16268139Smav * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17268139Smav * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18268139Smav * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19268139Smav * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20268139Smav * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21268139Smav * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22268139Smav * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23268139Smav * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24268139Smav * SUCH DAMAGE.
25268139Smav *
26268139Smav * $FreeBSD: head/lib/libdpv/util.h 274116 2014-11-04 23:46:01Z dteske $
27268139Smav */
28268139Smav
29268139Smav#ifndef _UTIL_H_
30268139Smav#define _UTIL_H_
31268139Smav
32168477Sscottl#include <sys/types.h>
33268139Smav
34268139Smav#include <paths.h>
35268139Smav
36168477Sscottl#define SHELL_SPAWN_DEBUG	0	/* Debug spawning of sh(1) commands */
37168477Sscottl
38168477Sscottl#ifdef _PATH_BSHELL
39168477Sscottl#define PATH_SHELL	_PATH_BSHELL
40168477Sscottl#else
41168477Sscottl#define PATH_SHELL	"/bin/sh"
42168477Sscottl#endif
43168477Sscottl
44168477Sscottl#define CMDBUFMAX	4096
45168477Sscottl
46168477Sscottl__BEGIN_DECLS
47168477Sscottlint	shell_spawn_pipecmd(const char *_cmd, const char *_label, pid_t *_pid);
48168477Sscottl__END_DECLS
49168477Sscottl
50168477Sscottl#endif /* !_UTIL_H_ */
51168477Sscottl