mirror of
https://github.com/cahirwpz/libnix.git
synced 2026-09-14 04:31:04 +00:00
17 lines
211 B
C
17 lines
211 B
C
#include <errno.h>
|
|
#include <unistd.h>
|
|
//
|
|
#include "stdio.h"
|
|
|
|
int dup(int d)
|
|
{ StdFileDes *sfd = _lx_fhfromfd(d);
|
|
|
|
if (sfd) {
|
|
return sfd->lx_dup(sfd);
|
|
}
|
|
else {
|
|
errno = EBADF;
|
|
return -1;
|
|
}
|
|
}
|