[lkml]   [2011]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Applying inappropriate ioctl operation on socket should return ENOTTY
    On 08:57 Wed 04/27/11 Apr, Eric Dumazet wrote:
    > You quote manpage for a library call, not a system call.

    okay, let me quote the one for ioctl system call:

    man 2 ioctl

    int ioctl(int d, int request, ...);

    EBADF d is not a valid descriptor.
    EFAULT argp references an inaccessible memory area.
    EINVAL Request or argp is not valid.
    ENOTTY d is not associated with a character special device.
    ENOTTY The specified request does not apply to the kind of object
    that the descriptor d references.

    we see ENOTTY and EFAULT refine EVINAL and it should return ENOTTY or
    EFAULT whenever possible rather than EINVAL, otherwise we could always
    return EBADF or EINVAL.

    Regarding to isatty, well, it's only a library call, isn't it? :-) If
    you insist on the significance of the manpage of isatty, there are
    also a lot of ioctl operations return ENOTTY, if not less than those
    return EINVAL, for inappropriated command and eventually violate the
    ERRORS section of the manpage. Certainly we could complain to c
    library maintainers.

    > If you feel your glibc doesnt implement well this, please complain to
    > glibc maintainer.


     \ /
      Last update: 2011-04-27 10:25    [W:0.022 / U:77.036 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site