MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_pid

Function get_pid

tools/libutil/uucplock.c:208–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static pid_t
209get_pid(int fd, int *err)
210{
211 int bytes_read;
212 char buf[32];
213 pid_t pid;
214
215 bytes_read = read (fd, buf, sizeof (buf) - 1);
216 if (bytes_read > 0) {
217 buf[bytes_read] = '\0';
218 pid = (pid_t)strtol (buf, (char **) NULL, 10);
219 } else {
220 pid = -1;
221 *err = bytes_read ? errno : EINVAL;
222 }
223 return pid;
224}
225
226/* end of uucplock.c */

Callers 2

uu_lockFunction · 0.85
uu_lock_txfrFunction · 0.85

Calls 2

strtolFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected