-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess-api.h
More file actions
31 lines (25 loc) · 1.14 KB
/
process-api.h
File metadata and controls
31 lines (25 loc) · 1.14 KB
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
/* =============================================================================
process-api.h
The process struct is used to represent a child process when this program
is executed.
Author: David Sha
============================================================================= */
#ifndef _PROCESS_API_H_
#define _PROCESS_API_H_
/* #includes ================================================================ */
#include <sys/types.h>
/* structures =============================================================== */
typedef struct process {
pid_t pid;
int fd[2];
int parent_fd[2];
} process_t;
/* function prototypes ====================================================== */
void send_message(process_t *process, char *message, int length);
void receive_message(process_t *process, char *message, int length);
void check_process(process_t *process, char *simulation_time);
void start_process(process_t *process, char *simulation_time);
void suspend_process(process_t *process, char *simulation_time);
void continue_process(process_t *process, char *simulation_time);
char *terminate_process(process_t *process, char *simulation_time);
#endif