Oleksii Tsvietnov
Authored Content
Authored Comments
I couldn't compile the code because of two issues:
1. the full listing of a program has lost its #include
2. by some reasons three is no uint32_t on my Linux system
$ uname -r
5.0.7-200.fc29.x86_64
$ grep int32_ /usr/include/sys/types.h
typedef unsigned int u_int32_t;
After I fixed these two issues, I've managed to compiled the code.
And, one little note about a formatting of the usage() output. I think, it might make sense to add \n in the add, otherwise it doesn't look fine in a shell:
#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]\n"
It will definitely be a good next article! Here are a few other ideas... You mentioned _start() function, tell us more! ;) Of course it depends on many parameters, but if it's limited to something well used and popular, like (x86_64, Linux, gcc), then it's real to dive into the topic within 1-3 articles. Another good topic would be debugging, a few examples how you debug code than a program was coredumped and killed with different signals. You also touched slightly "errno is used as an out-of-band communication channel by the standard C library to communicate why a function might have failed". I think, it deserves its own article. To show on examples how a caller interacts with a program, what is EINVAL and ENOENT. Tell us more how you handle errors.