0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

ircd::fs: Add fd::release() memfn.

This commit is contained in:
Jason Volk 2019-04-22 08:55:42 -07:00
parent f145c6774a
commit d08bcc2f32
2 changed files with 11 additions and 0 deletions

View file

@ -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);

View file

@ -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