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

Function sys_pipe2

freebsd/kern/sys_pipe.c:513–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511#endif
512
513int
514sys_pipe2(struct thread *td, struct pipe2_args *uap)
515{
516 int error, fildes[2];
517
518 if (uap->flags & ~(O_CLOEXEC | O_NONBLOCK))
519 return (EINVAL);
520 error = kern_pipe(td, fildes, uap->flags, NULL, NULL);
521 if (error)
522 return (error);
523 error = copyout(fildes, uap->fildes, 2 * sizeof(int));
524 if (error) {
525 (void)kern_close(td, fildes[0]);
526 (void)kern_close(td, fildes[1]);
527 }
528 return (error);
529}
530
531/*
532 * Allocate kva for pipe circular buffer, the space is pageable

Callers

nothing calls this directly

Calls 3

kern_pipeFunction · 0.85
kern_closeFunction · 0.85
copyoutFunction · 0.50

Tested by

no test coverage detected