smengcl edited a comment on pull request #2710:
URL: https://github.com/apache/hadoop/pull/2710#issuecomment-783214670


   Thanks @GauthamBanasandra for the patch.
   
   I'm wondering if the 
[author](https://issues.apache.org/jira/browse/HDFS-11028) uses syscall write 
on purpose. According to the comment, heap could be corrupted if the `printf` 
call uses `malloc` or equivalent (depending on C/C++ library's implementation):
   
   
https://github.com/apache/hadoop/blob/8783461e2ec3aff2630ea3574a69beb1d5c61e84/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/connect_cancel.c#L43
   
   
https://github.com/apache/hadoop/blob/869317be0a1fdff23be5fc500dcd9ae4ecd7bc29/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/connect_cancel.cc#L47-L48
   
   How about wrapping the `<unistd.h>` header import line and the existing 
approach in `#ifndef WINDOWS`? And use `#else` to wrap the new approach. 
Assuming Windows is the platform you are aiming for.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to