Function FD.adopt

Wrapper for adopting an fd immediately after being returned from external function

FD adopt(string errorMsg) (
  int fd
) @nogc @safe;

The usage should be FD fd = FD.adopt!"open"( .open("/path/to/file", O_RDWR) );

Throws

ErrnoException in case fd is invalid