-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchannel.h
36 lines (32 loc) · 936 Bytes
/
channel.h
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
/*
This file provides declaration of
communication functions to be used by MIMPI implementation.
Overview rules to apply:
- replace `pipe` with `channel`
- replace `write` (or any other file writing function) with `chsend` when used on channel's fd
- replace `read` (or any other file reading function) with `chrecv` when used on channel's fd
*/
#ifndef CHANNEL_H
#define CHANNEL_H
#include <stddef.h>
/*
This is required to be called in MIMPI_Init.
*/
void channels_init();
/*
This is required to be called in MIMPI_Finalize.
*/
void channels_finalize();
/*
Works similarly to `pipe`, but possibly takes more time to finish.
*/
int channel(int pipefd[2]);
/*
Works similarly to `write`, but possibly takes more time to finish.
*/
int chsend(int __fd, const void *__buf, size_t __n);
/*
Works similarly to `read`, but possibly takes more time to finish.
*/
int chrecv(int __fd, void *__buf, size_t __nbytes);
#endif /* CHANNEL_H */