Ignore:
Timestamp:
Oct 10, 2007, 4:32:54 AM (18 years ago)
Author:
bird
Message:

shfile_cloexec. signal types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shfile.c

    r1233 r1240  
    2727#include "shfile.h"
    2828#include <stdlib.h>
     29#include <stdio.h>
    2930
    3031#ifdef KBUILD_OS_WINDOWS
     
    210211
    211212
     213int shfile_cloexec(shfdtab *pfdtab, int fd, int closeit)
     214{
     215#ifdef SH_PURE_STUB_MODE
     216    return -1;
     217#elif defined(SH_STUB_MODE)
     218# ifdef _MSC_VER
     219    return -1;
     220# else
     221    int rc = fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0)
     222                              | (closeit ? FD_CLOEXEC : 0));
     223    fprintf(stderr, "shfile_cloexec(%d, %d) -> %d\n", fd, closeit, rc);
     224    return rc;
     225# endif
     226#else
     227#endif
     228
     229}
     230
     231
    212232int shfile_ioctl(shfdtab *pfdtab, int fd, unsigned long request, void *buf)
    213233{
     
    218238    return -1;
    219239# else
    220     return ioctl(fd, request, buf);
    221 # endif
    222 #else
    223 #endif
    224 }
     240    int rc = ioctl(fd, request, buf);
     241    fprintf(stderr, "ioctl(%d, %#x, %p) -> %d\n", fd, request, buf, rc);
     242    return rc;
     243# endif
     244#else
     245#endif
     246}
     247
    225248
    226249mode_t shfile_get_umask(shfdtab *pfdtab)
Note: See TracChangeset for help on using the changeset viewer.