New answers tagged

0

For dd, setting the block size simply tells dd how many bytes to read in each read-store-output cycle. bs=nnn has no impact on filesystem block size, as dd operates on raw devices or binary files, treating input simply as a stream of bytes, and does not know about filesystems.


0

This parameter separates the read/write columns for every device, and you also have the user id at the beginning of the table: dstat --full command explaination: versatile tool for generating system resource statistics -f, --full expand -C, -D, -I, -N and -S discovery lists The table header for me, with one example line, is like this: -------...


4

From C or C++ you would normally use pselect() to test if there is data ready for reading. You can do that without having to set the file descriptor mode to non-blocking.


1

Most Unix systems didn't implement asynchronous reads of local disks; attempting the call results in synchronous reads. In particular, in Linux the sleep for local disks is uninterruptible (which is annoying on scratched CDs). If local disk IO happens to be interruptible on your platform you can use alarm(); read(); to set the maximum time you are willing ...


7

You can do this from bash using a 0 timeout to read. if read -t 0 then read data fi To test a file descriptor other than stdin, say 3, use -u 3. To find how many chars are ready on stdin you can use a small perl script: #!/usr/bin/perl require 'sys/ioctl.ph'; $size = pack("L", 0); ioctl(*STDIN, FIONREAD(), $size) or die "ioctl fail: $!\n"; $size = unpack(...


6

POSIX allows non-blocking, zero-character reads which "may detect and return errors", including that the read would block: open(2) the device in O_NONBLOCKing mode; read(2) with a count of 0. If this read operation checks for errors in such cases, if a read would block then read will return -1 and set errno to EAGAIN (or possibly EWOULDBLOCK for sockets, ...


0

You could check what its waiting channel is with some frequency. The average waiting channel you encounter should be indicative of where the time is spent in the process. E.g.: Take downloading a Ubuntu image as a typical net-io-bound process: $ url='http://mirror.dkm.cz/ubuntu-releases/16.04/ubuntu-16.04-desktop-amd64.iso' $ wget "$url" & pid=$! ...



Top 50 recent answers are included