| Summary: | ioctl on invalid I_ATMARK is not POSIX compliant anymore | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Vittorio <vitti570> |
| Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 15 | CC: | aquini, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-08-30 12:55:41 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Until 2.6.38.8-35 ioctl gave the correct errno. This is running sockioctl01 from ltp-full-20110606. You should file this upstream. (In reply to comment #3) > This is not POSIX compliant, man 3 ioctl says that EINVAL (Invalid argument) > should be put in errno if the I_ATMARK command fails. I_ATMARK is for POSIX STREAMS devices and is not the same as SIOCATMARK, which takes no arguments. In any case I'm pretty sure ENOTTY is correct if you're trying to use it on a datagram socket. |
Description of problem: I just installed kernel-2.6.40.3-0.fc15.x86_64.rpm and I found that ioctl on an invalid I_ATMARK now sets errno to ENOTTY. This is not POSIX compliant, man 3 ioctl says that EINVAL (Invalid argument) should be put in errno if the I_ATMARK command fails. Instead now ENOTTY (Inappropriate ioctl for device) is given as errno. Version-Release number of selected component (if applicable): How reproducible: #include <stdio.h> #include <linux/sockios.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <errno.h> int main() { int n, s, optval; s=socket(PF_INET,SOCK_DGRAM,0); if( s == -1 ) perror("errno from socket:"); n=ioctl(s,SIOCATMARK,&optval); perror("errno from ioctl"); if( errno != EINVAL) printf("n=%d errno=%d\n",n,errno); return 0; } Steps to Reproduce: 1. Compile 2. Run 3. Actual results: Inappropriate ioctl for device Expected results: Invalid argument (EINVAL) Additional info: