Development libraries perform differently in each system. Never assume a library performs the same in your system as what's on the developer's website or what's in their documentation. Always verify the specific features of a library by debugging your own small test programs.
1. Make a new source file "test.c" for verifying a function of a library then compile it using the command "gcc -Wall test.c -o test":
2. Run the command strace to see how the function performs its operations:
1. Make a new source file "test.c" for verifying a function of a library then compile it using the command "gcc -Wall test.c -o test":
#include <header file>
int main(int argc, char **argv)
{
int foo; /* return value */
if (argc != 3)
{
printf("usage: test <function value 1> <function value 2>");
return -1;
}
foo = function(argv[1], argv[2]);
...
printf(" ", foo);
return 0;
}
2. Run the command strace to see how the function performs its operations:
strace -C -f -i -tt -T -v test;
strace -C -f -i -tt -T -p <running process pid> -u <username> -v;
Do you have a suggestion about how to improve this blog? Let's talk about it. Contact me at David.Brenner.Jr@Gmail.com or 720-584-5229.
Comments
Post a Comment
Comments to this blog will be reviewed within 72 hours. No trolling please