mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd::util: Extend return value in syscall() suite.
This commit is contained in:
parent
c03bb7e4f2
commit
78c2af094e
1 changed files with 6 additions and 6 deletions
|
@ -641,15 +641,15 @@ struct values
|
|||
// Error-checking closure for POSIX system calls. Note the usage is
|
||||
// syscall(read, foo, bar, baz) not a macro like syscall(read(foo, bar, baz));
|
||||
//
|
||||
template<int ERROR_CODE = -1,
|
||||
template<long ERROR_CODE = -1,
|
||||
class function,
|
||||
class... args>
|
||||
auto
|
||||
syscall(function&& f,
|
||||
args&&... a)
|
||||
-> typename std::enable_if<std::is_same<int, decltype(f(a...))>::value, int>::type
|
||||
-> typename std::enable_if<std::is_convertible<long, decltype(f(a...))>::value, long>::type
|
||||
{
|
||||
const int ret
|
||||
const auto ret
|
||||
{
|
||||
f(std::forward<args>(a)...)
|
||||
};
|
||||
|
@ -664,15 +664,15 @@ syscall(function&& f,
|
|||
// Error-checking closure for POSIX system calls. Note the usage is
|
||||
// syscall(read, foo, bar, baz) not a macro like syscall(read(foo, bar, baz));
|
||||
//
|
||||
template<int ERROR_CODE = -1,
|
||||
template<long ERROR_CODE = -1,
|
||||
class function,
|
||||
class... args>
|
||||
auto
|
||||
uninterruptible_syscall(function&& f,
|
||||
args&&... a)
|
||||
-> typename std::enable_if<std::is_same<int, decltype(f(a...))>::value, int>::type
|
||||
-> typename std::enable_if<std::is_convertible<long, decltype(f(a...))>::value, long>::type
|
||||
{
|
||||
int ret; do
|
||||
long ret; do
|
||||
{
|
||||
ret = f(std::forward<args>(a)...);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue