This is an archive of the discontinued LLVM Phabricator instance.

Casting pid to ::pid_t when invoking syscall.
ClosedPublic

Authored by chaoren on Feb 27 2015, 3:38 PM.

Details

Summary

syscalls involving pid/tid on 32 bit binaries are failing with
"Invalid argument" because the uint64_t arguments are too wide.

Diff Detail

Event Timeline

chaoren updated this revision to Diff 20908.Feb 27 2015, 3:38 PM
chaoren retitled this revision from to Casting pid to ::pid_t when invoking syscall..
chaoren updated this object.
chaoren edited the test plan for this revision. (Show Details)
chaoren added reviewers: clayborg, ovyalov, sivachandra.
chaoren added a subscriber: Unknown Object (MLST).
clayborg accepted this revision.Feb 27 2015, 3:41 PM
clayborg edited edge metadata.

Sounds like you don't have the function prototype for syscall? Otherwise there would be a conversion to the correct type. You can fix this with a static_cast like you did, but in reality this shouldn't happen unless you don't have the syscall prototype.

This revision is now accepted and ready to land.Feb 27 2015, 3:41 PM

extern long int syscall (long int sysno, ...) THROW;

Variadic arguments.

This revision was automatically updated to reflect the committed changes.

Looks good then, thanks for making sure.