2

I'm using strace, and the following line appears:

read(3,"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\3\2\0\0\0\0\0@\0\0\0\0\0\00P\265\31\0\0\0\0\0\0\0\0\0@\0008\0\n\0@\0G\0F\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0000\2\0\0\0\0\0\0000\2\0\0\0\0\0\0\10\0\0\0\0\0\0"..., 832) = 832

What is the format of the second argument? What are all those 0's,@'s and \?

I'm using Debian, with Intel i5 CPU x86_64.

4

The string is formatted using C syntax. Non-printable characters are shown using octal representation: null bytes are shown as \0 and the ELF file magic at the beginning as \177ELF. The output shows what the pointer given as second argument points to after the call to read has completed. = 832 at the end shows the return value.

  • In short, read() was used to read 832 bytes from an executable file, which returned 832 bytes of data. – Kusalananda Apr 4 '18 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.