View Issue Details

IDProjectCategoryView StatusLast Update
00010321003.1(2013)/Issue7+TC1System Interfacespublic2016-03-24 16:32
Reporterphilip-guenther Assigned To 
PrioritynormalSeverityObjectionTypeEnhancement Request
Status ClosedResolutionDuplicate 
NamePhilip Guenther
OrganizationOpenBSD
User Reference
SectionFD_ISSET
Page Number1545
Line Number50609
Interp Status---
Final Accepted Text
Summary0001032: FD_ISSET() should take a const fd_set *
DescriptionImplementations are explicitly permitted to only provide a macro version of FD_ISSET(), as that was historically the case. Since FD_ISSET() doesn't assign through its second argument, such macros have generally accepted a const fd_set * pointer.

To match that, implementations that provide it as function should be required to accept such usage as well. Note that since implementations are permitted to provide FD_ISSET() as a macro *without* a function version, a compliant application cannot take its address, so this incompatible change to the function type cannot affect a compliant application.

(OpenBSD has recently switched to providing FD_* as macros indirecting to inline functions and the version that didn't accept const fd_set* was found to break at least the hylafax and nxcomp 3rd-party applications.)
Desired ActionThe declaration in the pselect,select section and in the <sys/select.h> section should be changed from:
    int FD_ISSET(int fd, fd_set *fdset);
to
    int FD_ISSET(int fd, const fd_set *fdset);
TagsNo tags attached.

Relationships

duplicate of 0000220 Closedajosey 1003.1(2008)/Issue 7 FD_ISSET can use const keyword 

Activities

EdSchouten

2016-03-10 06:08

updater   bugnote:0003093

Last edited: 2016-03-10 06:10

This is the same as http://austingroupbugs.net/view.php?id=220 which I filed but got closed. In my opinion it was incorrect that this got closed. The reasoning by msbrown was:

"What I should have written is that FD_ISSET() _can_ _be_ only a macro. I.e. there doesn't have to be an underlying function."

Though that is also true, that doesn't mean that 'const' keywords should intentionally be left out in case it *is* provided as a function. Also, even if it is a macro, requiring that the argument is 'const' also requires that the FD_ISSET() macro should work on constant fd_sets.

Issue History

Date Modified Username Field Change
2016-03-08 01:28 philip-guenther New Issue
2016-03-08 01:28 philip-guenther Name => Philip Guenther
2016-03-08 01:28 philip-guenther Organization => OpenBSD
2016-03-08 01:28 philip-guenther Section => FD_ISSET
2016-03-08 01:28 philip-guenther Page Number => 1545
2016-03-08 01:28 philip-guenther Line Number => 50609
2016-03-10 06:08 EdSchouten Note Added: 0003093
2016-03-10 06:09 EdSchouten Note Edited: 0003093
2016-03-10 06:10 EdSchouten Note Edited: 0003093
2016-03-24 16:27 nick Relationship added duplicate of 0000220
2016-03-24 16:32 Don Cragun Interp Status => ---
2016-03-24 16:32 Don Cragun Status New => Closed
2016-03-24 16:32 Don Cragun Resolution Open => Duplicate