mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
ircd::fs: Add fd::release() memfn.
This commit is contained in:
parent
f145c6774a
commit
d08bcc2f32
2 changed files with 11 additions and 0 deletions
|
@ -34,6 +34,8 @@ struct ircd::fs::fd
|
|||
operator bool() const;
|
||||
bool operator!() const;
|
||||
|
||||
int release() noexcept;
|
||||
|
||||
explicit fd(const int &);
|
||||
fd(const string_view &path, const opts &);
|
||||
fd(const string_view &path);
|
||||
|
|
|
@ -1621,6 +1621,15 @@ noexcept(false)
|
|||
syscall(::close, fdno);
|
||||
}
|
||||
|
||||
int
|
||||
ircd::fs::fd::release()
|
||||
noexcept
|
||||
{
|
||||
const int fdno(this->fdno);
|
||||
this->fdno = -1;
|
||||
return fdno;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// fs/device.h
|
||||
|
|
Loading…
Reference in a new issue