On 26 Jan 2016 13:51, Fei Jie wrote:
> --- /dev/null
> +++ b/tests/mincore.c
> @@ -0,0 +1,43 @@
> +#include "tests.h"

files should have a comment header at the top with a license & description.

> +int main()

should be (void)

> +     int PAGESIZE = getpagesize();

don't use upper caps for this var name

> +     int global_len = PAGESIZE*2;

spaces around the *

> +     char *buf;
> +     buf = (char*)malloc(global_len);

the cast is pointless (so delete it), and just merge the two statements.

> +     if( MAP_FAILED == (global_pointer = (char *)mmap(NULL,global_len,\
> +             PROT_READ|PROT_WRITE|PROT_EXEC,MAP_SHARED,file_desc,0)) ) {

please do not inline assignments into if statements.  do the assignment,
then do the if statement checking its value.

drop the \ too.

the leading spacing is wrong ... should be:
        if (...

> +     unsigned char* global_vec = NULL;
> +     global_vec = malloc( (global_len+PAGESIZE-1) / PAGESIZE );
> +     if ((res =mincore(global_pointer, global_len, global_vec)) == -1) {

lots of whitespace errors here too
-mike

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to