Change-Id: I7f3c211180797762abbb1362725da7d71f167620
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
--- /dev/null
+#include <stdio.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+
+int main()
+{
+ int i;
+ int fd;
+
+ struct rlimit limits = {
+ .rlim_cur = 16,
+ .rlim_max = 16,
+ };
+
+ setrlimit(RLIMIT_NOFILE, &limits);
+
+ for (i = 0; i < 100; ++i) {
+ fd = open("/dev/null", O_RDONLY);
+ if (fd < 0) {
+ printf("%d fds, error: %d\n", i, errno);
+ break;
+ }
+ }
+
+ return 0;
+}