summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/alarm.c
diff options
context:
space:
mode:
authorfche <fche>2006-08-12 05:13:09 +0000
committerfche <fche>2006-08-12 05:13:09 +0000
commit814bc89d4635f101b2c0077598f31aad95ed15b7 (patch)
tree407a49dbaf446af4751f5068607a7fb8dad0611d /testsuite/systemtap.syscall/alarm.c
parent6b6d04673a1ef175821afc7d4fabdb496698e8e3 (diff)
downloadsystemtap-steved-814bc89d4635f101b2c0077598f31aad95ed15b7.tar.gz
systemtap-steved-814bc89d4635f101b2c0077598f31aad95ed15b7.tar.xz
systemtap-steved-814bc89d4635f101b2c0077598f31aad95ed15b7.zip
2006-08-12 Frank Ch. Eigler <fche@elastic.org>
* configure.ac, Makefile.am: Descend into testsuite/ directory. Remove local test logic. * configure, Makefile.in: Regenerated. * runtest.sh: Not yet removed. * HACKING: Update for new testsuite layout. 2006-08-12 Frank Ch. Eigler <fche@elastic.org> * all: Reorganized old pass-1..4 tests one dejagnu bucket. Moved over old pass-5 tests, except for disabled syscalls tests. * Makefile (installcheck): New target for running pass-1..5 tests against installed systemtap.
Diffstat (limited to 'testsuite/systemtap.syscall/alarm.c')
-rwxr-xr-xtestsuite/systemtap.syscall/alarm.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/alarm.c b/testsuite/systemtap.syscall/alarm.c
new file mode 100755
index 00000000..bae92253
--- /dev/null
+++ b/testsuite/systemtap.syscall/alarm.c
@@ -0,0 +1,44 @@
+/* COVERAGE: alarm nanosleep pause */
+#include <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+#include <string.h>
+#include <signal.h>
+
+static void
+sigrt_act_handler(int signo, siginfo_t *info, void *context)
+{
+}
+
+int main()
+{
+ struct timespec rem, t = {0,789};
+ struct sigaction sigrt_act;
+ memset(&sigrt_act, 0, sizeof(sigrt_act));
+ sigrt_act.sa_handler = (void *)sigrt_act_handler;
+ sigaction(SIGALRM, &sigrt_act, NULL);
+
+ alarm(1);
+ // alarm (1) = 0
+
+ pause();
+ // pause () =
+
+ alarm(0);
+ // alarm (0) = 0
+
+ sleep(1);
+ // nanosleep (\[1.000000000\], XXXX) = 0
+
+ usleep(1234);
+ // nanosleep (\[0.001234000\], 0x[0]+) = 0
+
+ nanosleep(&t, &rem);
+ // nanosleep (\[0.000000789\], XXXX) = 0
+
+ nanosleep(&t, NULL);
+ // nanosleep (\[0.000000789\], 0x[0]+) = 0
+
+ return 0;
+}
+