]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
whoops
authorNicholas Nethercote <n.nethercote@gmail.com>
Sun, 15 Feb 2004 16:12:35 +0000 (16:12 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sun, 15 Feb 2004 16:12:35 +0000 (16:12 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2252

none/tests/Makefile.am
none/tests/closeall.c [new file with mode: 0644]
none/tests/closeall.stderr.exp [new file with mode: 0644]
none/tests/closeall.vgtest [new file with mode: 0644]

index 2864539e7c51f4197cf3e56ffc5b008f150084bc..a9c20dae04fcbe002ee0b037baa28f79881d612b 100644 (file)
@@ -50,6 +50,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        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 = \
@@ -59,7 +60,7 @@ 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
@@ -107,6 +108,7 @@ shortpush_SOURCES   = shortpush.c
 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)
diff --git a/none/tests/closeall.c b/none/tests/closeall.c
new file mode 100644 (file)
index 0000000..facf6a5
--- /dev/null
@@ -0,0 +1,17 @@
+#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 );
+}
diff --git a/none/tests/closeall.stderr.exp b/none/tests/closeall.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/closeall.vgtest b/none/tests/closeall.vgtest
new file mode 100644 (file)
index 0000000..23738b1
--- /dev/null
@@ -0,0 +1 @@
+prog: closeall