Reliability Block Diagrams (RBDs) are widely used in reliability engineering to model how the system reliability depends on the reliability of components or subsystems. In this paper, we present librbd, a C library providing a generic, efficient and open-source solution for time-dependent reliability evaluation of RBDs. The library has been developed as a part of a project for reliability evaluation of complex systems through a layered approach, combining different modeling formalisms and solution techniques at different system levels. The library achieves accuracy and efficiency comparable to, and mostly better than, those of other well-established tools, and it is well designed so that it can be easily used by other libraries and tools.