Revision 70e72ce4 osdep.c

b/osdep.c
235 235

  
236 236
    return qemu_pipe(fds);
237 237
}
238

  
239
/*
240
 * Creates a pipe with FD_CLOEXEC set on both file descriptors
241
 */
242
int qemu_pipe(int pipefd[2])
243
{
244
    int ret;
245

  
246
#ifdef CONFIG_PIPE2
247
    ret = pipe2(pipefd, O_CLOEXEC);
248
    if (ret != -1 || errno != ENOSYS) {
249
        return ret;
250
    }
251
#endif
252
    ret = pipe(pipefd);
253
    if (ret == 0) {
254
        qemu_set_cloexec(pipefd[0]);
255
        qemu_set_cloexec(pipefd[1]);
256
    }
257

  
258
    return ret;
259
}
260 238
#endif
261 239

  
262 240
/*

Also available in: Unified diff