• KO Myung-Hun's avatar
    dup, dup2, fcntl: support a directory fd on OS/2 kLIBC · c7e1cc41
    KO Myung-Hun authored
    On OS/2 kLIBC, dup(), dup2() and fcntl() do not work on a directory
    fd.
    
    * lib/dup.c (dup_nothrow): New.
    * lib/dup2.c (klibc_dup2dirfd): New. dup2() for a directory fd.
    (klibc_dup2): New.
    * lib/fcntl.c (klibc_fcntl): New.
    * m4/dup.m4 (gl_FUNC_DUP): Check if dup() works on a directory fd.
    * m4/dup2.m4 (gl_FUNC_DUP2): Check if dup2() works on a directory fd.
    * m4/fcntl.m4 (gl_FUNC_FCNTL): Check if F_DUPFD works on a directory
    fd.
    c7e1cc41
dup2.c 4.56 KB