smc1.stderr.exp smc1.stdout.exp smc1.vgtest \
syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
+ system.stdout.exp system.vgtest
yield.stdout.exp yield.vgtest
check_PROGRAMS = \
munmap_exe map_unmap mremap rcl_assert \
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
tls.so tls2.so tls pth_blockedsig \
- syscall-restart1 syscall-restart2 \
+ syscall-restart1 syscall-restart2 system \
coolo_sigaction gxx304 yield
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include
shorts_SOURCES = shorts.c
syscall_restart1_SOURCES = syscall-restart1.c
syscall_restart2_SOURCES = syscall-restart2.c
+system_SOURCES = system.c
tls_SOURCES = tls.c tls2.c
tls_DEPENDENCIES = tls.so
tls_LDFLAGS = -Wl,-rpath,$(srcdir)
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+int main(int argc, char **argv)
+{
+ struct rlimit lim;
+ int fd;
+
+ getrlimit(RLIMIT_NOFILE, &lim);
+
+ for ( fd = 3; fd < lim.rlim_cur; fd++ )
+ close( fd );
+
+ exit( 0 );
+}