Inserting arbitrary messages into strace output

Dmitry V. Levin ldv at altlinux.org
Fri Dec 19 04:04:17 UTC 2014


On Thu, Dec 18, 2014 at 10:35:59PM -0500, Justin Dearing wrote:
> Ok, so writing to an invalid descriptor makes sense. However, the line will
> still be decorated with the fact that its a write call. I'd like just the
> message written.
> 
> Or is the negative -1 file descriptor unique and not just a variation on
> this? http://ewontfix.com/10/

Unlike -42, which is treated as unsigned int (i.e. 2^32-42) by the kernel,
-1 is never a valid file descriptor.

BTW, should we change printfd() to print the file descriptor (when it's not
equal to -1) using %u format instead of %d?

> On Thu, Dec 18, 2014 at 10:22 PM, enh <enh at google.com> wrote:
> >
> > already implemented...
> >
> >   write(-1, "GOT HERE", strlen("GOT HERE"));


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20141219/ef7fc501/attachment.bin>


More information about the Strace-devel mailing list