rtemsbsd/syscalls: Remove pipe()

- This call is provided by RTEMS and that is preferred

Closes #4518
This commit is contained in:
Chris Johns
2021-09-23 15:42:12 +10:00
parent d9dd59d9ef
commit 2e5f808b09
2 changed files with 0 additions and 207 deletions

View File

@@ -441,58 +441,6 @@ listen(int socket, int backlog)
return rtems_bsd_error_to_status_and_errno(error);
}
int
pipe(int fildes[2])
{
struct thread *td = rtems_bsd_get_curthread_or_null();
rtems_libio_t *iop[2];
int error;
if (RTEMS_BSD_SYSCALL_TRACE) {
printf("bsd: sys: pipe: %d\n", socket);
}
if (td == NULL) {
return rtems_bsd_error_to_status_and_errno(ENOMEM);
}
iop[0] = rtems_bsd_libio_iop_allocate();
if (iop[0] == NULL) {
return rtems_bsd_error_to_status_and_errno(ENFILE);
}
iop[1] = rtems_bsd_libio_iop_allocate();
if (iop[1] == NULL) {
rtems_bsd_libio_iop_free(iop[0]);
return rtems_bsd_error_to_status_and_errno(ENFILE);
}
error = kern_pipe(td, fildes, 0, NULL, NULL);
if (error != 0) {
goto out;
}
error = rtems_bsd_libio_iop_set_bsd_fd(
td, fildes[0], iop[0], &rtems_bsd_sysgen_nodeops);
if (error != 0) {
goto out;
}
error = rtems_bsd_libio_iop_set_bsd_fd(
td, fildes[1], iop[1], &rtems_bsd_sysgen_nodeops);
if (error == 0) {
fildes[0] = rtems_libio_iop_to_descriptor(iop[0]);
fildes[1] = rtems_libio_iop_to_descriptor(iop[1]);
if (RTEMS_BSD_SYSCALL_TRACE) {
printf("bsd: sys: pipe: %d -> %d, %d -> %d\n",
fildes[0],
rtems_bsd_libio_iop_to_descriptor(iop[0]),
fildes[1],
rtems_bsd_libio_iop_to_descriptor(iop[1]));
}
return 0;
}
out:
kern_close(td, rtems_bsd_libio_iop_to_descriptor(iop[0]));
kern_close(td, rtems_bsd_libio_iop_to_descriptor(iop[1]));
rtems_bsd_libio_iop_free(iop[0]);
rtems_bsd_libio_iop_free(iop[1]);
return rtems_bsd_error_to_status_and_errno(error);
}
int
poll(struct pollfd fds[], nfds_t nfds, int timeout)
{