| 25 |
|
|
| 26 |
|
#include "vfork.h" |
| 27 |
|
|
| 28 |
+ |
#ifndef BSD |
| 29 |
+ |
#include <errno.h> |
| 30 |
+ |
#endif |
| 31 |
|
|
| 32 |
+ |
|
| 33 |
|
int |
| 34 |
|
open_process(pd, av) /* open communication to separate process */ |
| 35 |
|
int pd[3]; |
| 105 |
|
int siz; |
| 106 |
|
{ |
| 107 |
|
register int cc = 0, nrem = siz; |
| 108 |
< |
|
| 108 |
> |
retry: |
| 109 |
|
while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) { |
| 110 |
|
bpos += cc; |
| 111 |
|
nrem -= cc; |
| 112 |
|
} |
| 113 |
< |
if (cc < 0) |
| 113 |
> |
if (cc < 0) { |
| 114 |
> |
#ifndef BSD |
| 115 |
> |
if (errno == EINTR) /* we were interrupted! */ |
| 116 |
> |
goto retry; |
| 117 |
> |
#endif |
| 118 |
|
return(cc); |
| 119 |
+ |
} |
| 120 |
|
return(siz-nrem); |
| 121 |
|
} |
| 122 |
|
|
| 128 |
|
int siz; |
| 129 |
|
{ |
| 130 |
|
register int cc = 0, nrem = siz; |
| 131 |
< |
|
| 131 |
> |
retry: |
| 132 |
|
while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) { |
| 133 |
|
bpos += cc; |
| 134 |
|
nrem -= cc; |
| 135 |
|
} |
| 136 |
< |
if (cc < 0) |
| 136 |
> |
if (cc < 0) { |
| 137 |
> |
#ifndef BSD |
| 138 |
> |
if (errno == EINTR) /* we were interrupted! */ |
| 139 |
> |
goto retry; |
| 140 |
> |
#endif |
| 141 |
|
return(cc); |
| 142 |
+ |
} |
| 143 |
|
return(siz-nrem); |
| 144 |
|
} |