Also add a testcase.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@265
described in detail in <a href="#cache">Section 7</a>.
</li><br><p>
- <li><code>--wierd-hacks=hack1,hack2,...</code>
+ <li><code>--weird-hacks=hack1,hack2,...</code>
Pass miscellaneous hints to Valgrind which slightly modify the
simulated behaviour in nonstandard or dangerous ways, possibly
to help the simulation of strange features. By default no hacks
described in detail in <a href="#cache">Section 7</a>.
</li><br><p>
- <li><code>--wierd-hacks=hack1,hack2,...</code>
+ <li><code>--weird-hacks=hack1,hack2,...</code>
Pass miscellaneous hints to Valgrind which slightly modify the
simulated behaviour in nonstandard or dangerous ways, possibly
to help the simulation of strange features. By default no hacks
--suppressions=*) vgopts="$vgopts $arg"; shift;;
--cachesim=yes) vgopts="$vgopts $arg"; shift;;
--cachesim=no) vgopts="$vgopts $arg"; shift;;
- --wierd-hacks=*) vgopts="$vgopts $arg"; shift;;
+ --weird-hacks=*) vgopts="$vgopts $arg"; shift;;
# options for debugging Valgrind
--sanity-level=*) vgopts="$vgopts $arg"; shift;;
--single-step=yes) vgopts="$vgopts $arg"; shift;;
echo " --check-addrVs=no|yes experimental lighterweight checking? [yes]"
echo " yes == Valgrind's original behaviour"
echo " --cachesim=no|yes do cache profiling? [no]"
- echo " --wierd-hacks=hack1,hack2,... [no hacks selected]"
+ echo " --weird-hacks=hack1,hack2,... [no hacks selected]"
echo " recognised hacks are: ioctl-VTIME"
echo ""
echo
/* Number of parents of a backtrace. Default: 8. */
extern Int VG_(clo_backtrace_size);
/* Engage miscellaneous wierd hacks needed for some progs. */
-extern Char* VG_(clo_wierd_hacks);
+extern Char* VG_(clo_weird_hacks);
/* ---------------------------------------------------------------------
ULong VG_(clo_stop_after);
Int VG_(clo_dump_error);
Int VG_(clo_backtrace_size);
-Char* VG_(clo_wierd_hacks);
+Char* VG_(clo_weird_hacks);
/* This Bool is needed by wrappers in vg_clientmalloc.c to decide how
to behave. Initially we say False. */
VG_(clo_stop_after) = 1000000000000LL;
VG_(clo_dump_error) = 0;
VG_(clo_backtrace_size) = 4;
- VG_(clo_wierd_hacks) = NULL;
+ VG_(clo_weird_hacks) = NULL;
eventually_logfile_fd = VG_(clo_logfile_fd);
else if (STREQ(argv[i], "--trace-pthread=all"))
VG_(clo_trace_pthread_level) = 2;
- else if (STREQN(14, argv[i], "--wierd-hacks="))
- VG_(clo_wierd_hacks) = &argv[i][14];
+ else if (STREQN(14, argv[i], "--weird-hacks="))
+ VG_(clo_weird_hacks) = &argv[i][14];
else if (STREQN(13, argv[i], "--stop-after="))
VG_(clo_stop_after) = VG_(atoll)(&argv[i][13]);
writable, for some reason. Ask me not why. Since this
is strange and potentially troublesome we only do it if
the user asks specially. */
- if (VG_(strstr)(VG_(clo_wierd_hacks), "ioctl-VTIME") != NULL)
+ if (VG_(strstr)(VG_(clo_weird_hacks), "ioctl-VTIME") != NULL)
VKI_FD_SET(fd, &writefds);
VKI_FD_SET(fd, &readfds); break;
case __NR_write:
described in detail in <a href="#cache">Section 7</a>.
</li><br><p>
- <li><code>--wierd-hacks=hack1,hack2,...</code>
+ <li><code>--weird-hacks=hack1,hack2,...</code>
Pass miscellaneous hints to Valgrind which slightly modify the
simulated behaviour in nonstandard or dangerous ways, possibly
to help the simulation of strange features. By default no hacks
described in detail in <a href="#cache">Section 7</a>.
</li><br><p>
- <li><code>--wierd-hacks=hack1,hack2,...</code>
+ <li><code>--weird-hacks=hack1,hack2,...</code>
Pass miscellaneous hints to Valgrind which slightly modify the
simulated behaviour in nonstandard or dangerous ways, possibly
to help the simulation of strange features. By default no hacks
--- /dev/null
+
+/* A program which sets a readable fd to have a timeout, and therefore
+ needs --weird-hacks=ioctl-VTIME in order to run without
+ blocking. */
+
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <termio.h>
+
+int main ( void )
+{
+ int c;
+ int res;
+ struct termio tty, oldtty;
+
+ /**
+ ** Save the old tty settings, and get rid of echo
+ ** for the new tty settings
+ **/
+ ioctl(0, TCGETA, &oldtty);
+ tty = oldtty;
+ tty.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL);
+ tty.c_cc[VMIN] = 0;
+ tty.c_cc[VTIME] = 5;
+ res = ioctl(0, TCSETA, &tty);
+ printf("first ioctl returned %d\n", res);
+
+ /**
+ ** Now do whatever stuff you want non-echoed
+ **/
+ while (1) {
+ c = getchar();
+ printf("got %d\n", c);
+ }
+
+ /**
+ ** Now reset the old settings
+ **/
+ res = ioctl(0, TCSETA, &oldtty);
+ printf("second ioctl returned %d\n", res);
+
+return 0;
+}
--suppressions=*) vgopts="$vgopts $arg"; shift;;
--cachesim=yes) vgopts="$vgopts $arg"; shift;;
--cachesim=no) vgopts="$vgopts $arg"; shift;;
- --wierd-hacks=*) vgopts="$vgopts $arg"; shift;;
+ --weird-hacks=*) vgopts="$vgopts $arg"; shift;;
# options for debugging Valgrind
--sanity-level=*) vgopts="$vgopts $arg"; shift;;
--single-step=yes) vgopts="$vgopts $arg"; shift;;
echo " --check-addrVs=no|yes experimental lighterweight checking? [yes]"
echo " yes == Valgrind's original behaviour"
echo " --cachesim=no|yes do cache profiling? [no]"
- echo " --wierd-hacks=hack1,hack2,... [no hacks selected]"
+ echo " --weird-hacks=hack1,hack2,... [no hacks selected]"
echo " recognised hacks are: ioctl-VTIME"
echo ""
echo
/* Number of parents of a backtrace. Default: 8. */
extern Int VG_(clo_backtrace_size);
/* Engage miscellaneous wierd hacks needed for some progs. */
-extern Char* VG_(clo_wierd_hacks);
+extern Char* VG_(clo_weird_hacks);
/* ---------------------------------------------------------------------
ULong VG_(clo_stop_after);
Int VG_(clo_dump_error);
Int VG_(clo_backtrace_size);
-Char* VG_(clo_wierd_hacks);
+Char* VG_(clo_weird_hacks);
/* This Bool is needed by wrappers in vg_clientmalloc.c to decide how
to behave. Initially we say False. */
VG_(clo_stop_after) = 1000000000000LL;
VG_(clo_dump_error) = 0;
VG_(clo_backtrace_size) = 4;
- VG_(clo_wierd_hacks) = NULL;
+ VG_(clo_weird_hacks) = NULL;
eventually_logfile_fd = VG_(clo_logfile_fd);
else if (STREQ(argv[i], "--trace-pthread=all"))
VG_(clo_trace_pthread_level) = 2;
- else if (STREQN(14, argv[i], "--wierd-hacks="))
- VG_(clo_wierd_hacks) = &argv[i][14];
+ else if (STREQN(14, argv[i], "--weird-hacks="))
+ VG_(clo_weird_hacks) = &argv[i][14];
else if (STREQN(13, argv[i], "--stop-after="))
VG_(clo_stop_after) = VG_(atoll)(&argv[i][13]);
writable, for some reason. Ask me not why. Since this
is strange and potentially troublesome we only do it if
the user asks specially. */
- if (VG_(strstr)(VG_(clo_wierd_hacks), "ioctl-VTIME") != NULL)
+ if (VG_(strstr)(VG_(clo_weird_hacks), "ioctl-VTIME") != NULL)
VKI_FD_SET(fd, &writefds);
VKI_FD_SET(fd, &readfds); break;
case __NR_write: