summaryrefslogtreecommitdiffstats
path: root/debian/bash.preinst.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 06:17:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 06:17:26 +0000
commit3abb3f4db4372683dde9d2565d27d807ffdd5ac4 (patch)
tree83da6f31e160b887fcf21342ac42b2ea21a457c0 /debian/bash.preinst.h
parentAdding upstream version 5.1. (diff)
downloadbash-3abb3f4db4372683dde9d2565d27d807ffdd5ac4.tar.xz
bash-3abb3f4db4372683dde9d2565d27d807ffdd5ac4.zip
Adding debian version 5.1-2+deb11u1.debian/5.1-2+deb11u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/bash.preinst.h')
-rw-r--r--debian/bash.preinst.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/bash.preinst.h b/debian/bash.preinst.h
new file mode 100644
index 0000000..82faf49
--- /dev/null
+++ b/debian/bash.preinst.h
@@ -0,0 +1,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