> On Aug. 24, 2017, 6:28 p.m., James Peach wrote: > > 3rdparty/stout/include/stout/os/write.hpp > > Lines 66 (patched) > > <https://reviews.apache.org/r/61797/diff/4/?file=1802875#file1802875line67> > > > > Write returns `ssize_t` here and in all the other variants in this file. > > > > OK I ended up later in the patch series and realized that this is > > returning `errno`. If you really want to do that, it needs to be much more > > explicit, since everyone reading this is going to assume that `write` > > returns a count. > > > > Other than introducing a new type, one option might be to return `bool` > > from these functions and let the caller examine `errno`.
I agree, returning `ssize_t` seems more reasonable to me. > On Aug. 24, 2017, 6:28 p.m., James Peach wrote: > > 3rdparty/stout/include/stout/os/write.hpp > > Lines 87 (patched) > > <https://reviews.apache.org/r/61797/diff/4/?file=1802875#file1802875line88> > > > > The recursion could be a problem in signal handlers with limited stack, > > but I couldn't see a better way to do this :) I'm not sure if a compiler can eliminate tail recursion in this case. I expect small number of arguments (say, less than 10), so even with quadratic memory complexity, stack should typically have size of only a few hundred bytes. - Andrei ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61797/#review183754 ----------------------------------------------------------- On Aug. 21, 2017, 8:54 p.m., Andrei Budnik wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61797/ > ----------------------------------------------------------- > > (Updated Aug. 21, 2017, 8:54 p.m.) > > > Review request for mesos, Alexander Rukletsov, Alexander Rojas, Benjamin > Bannier, Benjamin Mahler, and James Peach. > > > Bugs: MESOS-7791 > https://issues.apache.org/jira/browse/MESOS-7791 > > > Repository: mesos > > > Description > ------- > > Async-signal safe `write` function, which can take variable number of > arguments, should be used to improve signal safety. > > > Diffs > ----- > > 3rdparty/stout/include/stout/abort.hpp > d3291dce8ec3db6141124e9cd231d34409998a18 > 3rdparty/stout/include/stout/os/write.hpp > beb5bd83b52565a75e34d32b5bb17951bc799578 > > > Diff: https://reviews.apache.org/r/61797/diff/4/ > > > Testing > ------- > > sudo make check (mac os x, fedora 25) > internal CI > > > Thanks, > > Andrei Budnik > >
