flag parameters
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest18 patches 22 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | flag parameters: socket and socketpairinclude/ net/ net/ +1 more | +30 | 0 replies | |
| 2/18 | flag parameters: pacceptinclude/ include/ include/ +2 more | +118 | 7 replies | |
| 3/18 | flag parameters: anon_inode_getfd extensionfs/ fs/ fs/ +3 more | +11 | 0 replies | |
| 4/18 | flag parameters: signalfdarch/ arch/ fs/ +5 more | +33 | 1 reply | |
| 5/18 | flag parameters: eventfdarch/ arch/ fs/ +4 more | +23 | 0 replies | |
| 6/18 | flag parameters: timerfd_createfs/ include/ | +8 | 0 replies | |
| 7/18 | flag parameters: epoll_createarch/ arch/ fs/ +4 more | +21 | 0 replies | |
| 8/18 | flag parameters: dup2arch/ arch/ fs/ +3 more | +19 | 0 replies | |
| 9/18 | flag parameters: pipearch/ arch/ arch/ +14 more | +35 | 0 replies | |
| 10/18 | flag parameters: inotify_initarch/ arch/ fs/ +4 more | +21 | 0 replies | |
| 11/18 | flag parametersi: NONBLOCK in anon_inode_getfdfs/ | +1 | 0 replies | |
| 12/18 | flag parameters: NONBLOCK in socket and socketpairinclude/ net/ | +12 | 0 replies | |
| 13/18 | flag parameters: NONBLOCK in signalfdfs/ include/ | +4 | 0 replies | |
| 14/18 | flag parameters: NONBLOCK in eventfdfs/ include/ | +4 | 0 replies | |
| 15/18 | flag parameters: NONBLOCK in timerfd_createfs/ include/ | +4 | 1 reply | |
| 16/18 | flag parameters: NONBLOCK in pipefs/ include/ kernel/ | +11 | 0 replies | |
| 17/18 | flag parameters: NONBLOCK in inotify_initfs/ include/ | +4 | 0 replies | |
| 18/18 | flag parameters: check magic constantsfs/ fs/ fs/ +3 more | +26 | 14 replies |
Reviews trailers per patch
1 of 18 patches has a Reviewed-by or Acked-by.
| Patch | Davide Libenzi |
|---|---|
| 1/18 | |
| 2/18 | |
| 3/18 | |
| 4/18 | |
| 5/18 | |
| 6/18 | |
| 7/18 | |
| 8/18 | |
| 9/18 | |
| 10/18 | |
| 11/18 | |
| 12/18 | |
| 13/18 | |
| 14/18 | |
| 15/18 | A-b |
| 16/18 | |
| 17/18 | |
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/18] flag parameters
This is an update for the previous series which should address the comments Andrew had. The controversial function Davide wrote is gone. There is no flag conversion anymore. We still introduce new names for the constants but the values are the same as the O_* constants.
This leads to some strange-looking code where we in one moment check for, say, SOCK_CLOEXEC, and in the next for O_CLOEXEC. But I added in a separate, new patch code which checks for the consistency of the constants.
I modified the headers in <linux/*> to define the new values by include <linux/fcntl.h> and then simply define the new constants based on the O_* constants. That's the safest a nd least troublesome way. Otherwise we would have to create arch-specific headers. None of the modified headers should be used by userlevel code. Therefore the namespace pollution is no issue.
For those who just turn in, these patches add flags to various functions so that new file descriptors can be created with atomically setting the close-on-exec flag. This is critical, in multi-threaded apps we otherwise can have file descriptor leakage or worse. Since it is so either and often needed, I also added code to create new file descriptors with O_NONBLOCK set.
In future there will be other uses. Like a O_* flag to enable the use of non-sequential descriptors.
Some interfaces are not exported at userlevel with enough flexibility to allow extending them. For those we need new userlevel interface. This is the case for:
- paccept
- epoll_create2
- dup3
- pipe2
- inotify_init1
We do /not/ need new interfaces for
- signalfd4
- eventfd2
- timerfd_create
- socket
- socketpair
These either have flags parameters in the interface exported by glibc or (in case of the socket functions) overload a parameter with a bitset.
Each semantic change has a test program. For archs other than x86 and x86-64 you'll have to add the appropriate syscall number.
The patches all apply individually in sequence and the source tree remains compilable and runnable.