tbm_drm_helper: fix Svace TAINTED_INT defect
[platform/core/uifw/libtbm.git] / src / tbm_bufmgr.c
index 7d6f36a..bef7660 100644 (file)
@@ -36,6 +36,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "tbm_bufmgr_backend.h"
 #include "list.h"
 
+#include <sys/resource.h>
+
 #ifdef DEBUG
 int bDebug;
 #endif
@@ -1710,3 +1712,14 @@ tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *NativeDisplay)
        return 1;
 }
 /* LCOV_EXCL_STOP */
+
+int tbm_bufmgr_get_fd_limit(void)
+{
+       struct rlimit lim;
+
+       if (getrlimit(RLIMIT_NOFILE, &lim))
+               return 1024;
+
+       return (int)lim.rlim_cur;
+}
+