tests/read-write.c: robustify against os specific issues

Do not assume that write syscall fails when only part of the specified
memory buffer is accessible.  With some kernels, one accessible byte
at the end of page is enough for write syscall to return 1.

* tests/read-write.c (main): Tweak the test that can lead to a partial
write.
1 file changed
tree: 619453f0b82c24278dd35812f94663a3e745f49d
  1. .gitignore
  2. .mailmap
  3. .travis.yml
  4. AUTHORS
  5. COPYING
  6. CREDITS.in
  7. ChangeLog-CVS
  8. HACKING-scripts
  9. INSTALL
  10. Makefile.am
  11. NEWS
  12. README
  13. README-hacking
  14. README-linux-ptrace
  15. README-mpers
  16. README.md
  17. access.c
  18. affinity.c
  19. aio.c
  20. alpha.c
  21. bjm.c
  22. block.c
  23. bootstrap
  24. bpf.c
  25. build_static_example.sh
  26. cacheflush.c
  27. capability.c
  28. caps0.h
  29. caps1.h
  30. chdir.c
  31. chmod.c
  32. clone.c
  33. configure.ac
  34. copy_file_range.c
  35. count.c
  36. debian/
  37. defs.h
  38. desc.c
  39. dirent.c
  40. dirent64.c
  41. empty.h
  42. epoll.c
  43. errnoent.sh
  44. evdev.c
  45. eventfd.c
  46. execve.c
  47. exit.c
  48. fadvise.c
  49. fallocate.c
  50. fanotify.c
  51. fchownat.c
  52. fcntl.c
  53. fetch_seccomp_fprog.c
  54. fetch_struct_flock.c
  55. fetch_struct_statfs.c
  56. file.c
  57. file_handle.c
  58. flock.c
  59. flock.h
  60. fstatfs.c
  61. fstatfs64.c
  62. futex.c
  63. gcc_compat.h
  64. generate_mpers_am.sh
  65. generate_sen.sh
  66. generate_xlat_in.sh
  67. get_robust_list.c
  68. getcpu.c
  69. getcwd.c
  70. getrandom.c
  71. git-set-file-times
  72. git-version-gen
  73. gitlog-to-changelog
  74. hostname.c
  75. inotify.c
  76. io.c
  77. ioctl.c
  78. ioctlsort.c
  79. ioperm.c
  80. iopl.c
  81. ioprio.c
  82. ipc_defs.h
  83. ipc_msg.c
  84. ipc_msgctl.c
  85. ipc_sem.c
  86. ipc_shm.c
  87. ipc_shmctl.c
  88. kcmp.c
  89. kernel_types.h
  90. kexec.c
  91. keyctl.c
  92. ldt.c
  93. link.c
  94. linux/
  95. lookup_dcookie.c
  96. loop.c
  97. lseek.c
  98. m4/
  99. maint/
  100. make-dist
  101. mem.c
  102. membarrier.c
  103. memfd_create.c
  104. mknod.c
  105. mount.c
  106. mpers.awk
  107. mpers.sh
  108. mpers_test.sh
  109. mpers_type.h
  110. mq.c
  111. mtd.c
  112. native_defs.h
  113. net.c
  114. numa.c
  115. open.c
  116. or1k_atomic.c
  117. pathtrace.c
  118. perf.c
  119. personality.c
  120. poll.c
  121. prctl.c
  122. print_mq_attr.c
  123. print_msgbuf.c
  124. print_sigevent.c
  125. print_statfs.c
  126. print_time.c
  127. print_timex.c
  128. printmode.c
  129. printrusage.c
  130. printsiginfo.c
  131. printsiginfo.h
  132. printstat.h
  133. process.c
  134. process_vm.c
  135. ptp.c
  136. ptrace.h
  137. qemu_multiarch_testing/
  138. quota.c
  139. readahead.c
  140. readlink.c
  141. reboot.c
  142. regs.h
  143. renameat.c
  144. resource.c
  145. rtc.c
  146. sched.c
  147. scsi.c
  148. seccomp.c
  149. seccomp_fprog.h
  150. sendfile.c
  151. sigaltstack.c
  152. sigevent.h
  153. signal.c
  154. signalent.sh
  155. signalfd.c
  156. sigreturn.c
  157. sock.c
  158. socketutils.c
  159. sram_alloc.c
  160. statfs.c
  161. statfs.h
  162. statfs64.c
  163. strace-graph
  164. strace-log-merge
  165. strace.1
  166. strace.c
  167. strace.spec
  168. swapon.c
  169. sync_file_range.c
  170. sync_file_range2.c
  171. syscall.c
  172. syscallent.sh
  173. sysctl.c
  174. sysinfo.c
  175. syslog.c
  176. sysmips.c
  177. term.c
  178. test/
  179. tests/
  180. time.c
  181. times.c
  182. travis-ci.sh
  183. truncate.c
  184. uid.c
  185. uid16.c
  186. umask.c
  187. umount.c
  188. uname.c
  189. unwind.c
  190. upeek.c
  191. userfaultfd.c
  192. util.c
  193. utime.c
  194. utimes.c
  195. v4l2.c
  196. vsprintf.c
  197. wait.c
  198. xattr.c
  199. xlat.h
  200. xlat/
  201. xlate.el
  202. xmalloc.c
README.md

This is strace -- a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.

strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details.

See the file NEWS for information on what has changed in recent versions.

Please send bug reports and enhancements to the strace mailing list.

Build Status Code Coverage