File: spawn.h

package info (click to toggle)
labwc 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,980 kB
  • sloc: ansic: 34,416; perl: 5,836; xml: 875; sh: 162; python: 131; makefile: 12
file content (41 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download | duplicates (2)
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
38
39
40
41
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_SPAWN_H
#define LABWC_SPAWN_H

#include <sys/types.h>

/**
 * spawn_primary_client - execute asynchronously
 * @command: command to be executed
 */
pid_t spawn_primary_client(const char *command);

/**
 * spawn_async_no_shell - execute asynchronously
 * @command: command to be executed
 */
void spawn_async_no_shell(char const *command);

/**
 * spawn_piped - execute asynchronously
 * @command: command to be executed
 * @pipe_fd: set to the read end of a pipe
 *           connected to stdout of the command
 *
 * Notes:
 * The returned pid_t has to be waited for to
 * not produce zombies and the pipe_fd has to
 * be closed. spawn_piped_close() can be used
 * to ensure both.
 */
pid_t spawn_piped(const char *command, int *pipe_fd);

/**
 * spawn_piped_close - clean up a previous
 *                     spawn_piped() process
 * @pid: will be waitpid()'d for
 * @pipe_fd: will be close()'d
 */
void spawn_piped_close(pid_t pid, int pipe_fd);

#endif /* LABWC_SPAWN_H */