File: bash.preinst.h

package info (click to toggle)
bash 4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,372 kB
  • sloc: ansic: 103,485; sh: 7,655; yacc: 5,214; makefile: 4,357; perl: 4,227; asm: 48; awk: 23; sed: 16
file content (37 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef BASH_PREINST_H
#define BASH_PREINST_H

/*
 * This file is in the public domain.
 * You may freely use, modify, distribute, and relicense it.
 */

#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <stdarg.h>
#include <sys/types.h>

#if !defined(__GNUC__) && !defined(__attribute__)
# define __attribute__(x)
#endif
#define NORETURN __attribute__((__noreturn__))
#define PRINTFLIKE __attribute__((format(printf, 1, 2)))

enum wait_or_die_flags {
	ERROR_OK = 1,
	SIGPIPE_OK = 2
};

extern NORETURN PRINTFLIKE void die_errno(const char *fmt, ...);
extern NORETURN PRINTFLIKE void die(const char *fmt, ...);

extern int exists(const char *path);
extern void set_cloexec(int fd);
extern void xpipe(int pipefd[2]);

extern void wait_or_die(pid_t child, const char *desc, int flags);
extern pid_t spawn(const char * const cmd[], int outfd, int errfd);
extern void run(const char * const cmd[]);	/* spawn and wait */
extern FILE *spawn_pipe(pid_t *pid, const char * const cmd[], int errfd);

#endif