Lines Matching refs:fds
45 msg_open(struct msg_fds *fds)
47 if (pipe(fds->pfd) == -1)
49 if (pipe(fds->cfd) == -1) {
50 close(fds->pfd[0]);
51 close(fds->pfd[1]);
58 msg_close(struct msg_fds *fds)
60 CLOSEFD(fds->pfd[0]);
61 CLOSEFD(fds->pfd[1]);
62 CLOSEFD(fds->cfd[0]);
63 CLOSEFD(fds->cfd[1]);
67 msg_write_child(const char *info, struct msg_fds *fds, void *msg, size_t len)
70 CLOSEFD(fds->cfd[1]);
71 CLOSEFD(fds->pfd[0]);
74 rv = write(fds->pfd[1], msg, len);
78 rv = read(fds->cfd[0], msg, len);
85 msg_write_parent(const char *info, struct msg_fds *fds, void *msg, size_t len)
88 CLOSEFD(fds->pfd[1]);
89 CLOSEFD(fds->cfd[0]);
92 rv = write(fds->cfd[1], msg, len);
96 rv = read(fds->pfd[0], msg, len);
103 msg_read_parent(const char *info, struct msg_fds *fds, void *msg, size_t len)
106 CLOSEFD(fds->pfd[1]);
107 CLOSEFD(fds->cfd[0]);
110 rv = read(fds->pfd[0], msg, len);
114 rv = write(fds->cfd[1], msg, len);
121 msg_read_child(const char *info, struct msg_fds *fds, void *msg, size_t len)
124 CLOSEFD(fds->cfd[1]);
125 CLOSEFD(fds->pfd[0]);
128 rv = read(fds->cfd[0], msg, len);
132 rv = write(fds->pfd[1], msg, len);