Anonymous | Login | 2024-04-25 04:19 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000836 | [1003.1(2013)/Issue7+TC1] System Interfaces | Objection | Enhancement Request | 2014-04-24 13:15 | 2019-06-10 08:54 | ||
Reporter | eblake | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted | ||||
Status | Closed | ||||||
Name | Eric Blake | ||||||
Organization | Red Hat | ||||||
User Reference | eblake.accept | ||||||
Section | accept | ||||||
Page Number | 563 | ||||||
Line Number | 19506 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0000836: accept() should not modify address_len on failure | ||||||
Description |
The standard states that accept() modifies the address_len parameter on output to record the size of the stored address, but does not state whether this modification occurs even on failure. Thus, an implementation could feasibly set this parameter to 0 on failure, and an application that does:addrlen = sizeof(addr); do { ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR);risks failure, in comparison to: do { addrlen = sizeof(addr); ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR); But traditionally, implementations only modify the address_len parameter on success. Guaranteeing this fact will make it so that applications do not have to worry whether their EINTR retry loop has a subtle bug if the input size is set outside of the while loop. |
||||||
Desired Action |
At line 19523 [XSH accept() ERRORS], change:to:
|
||||||
Tags | tc2-2008 | ||||||
Attached Files | |||||||
|
There are no notes attached to this issue. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |