title: return http error code from CGI C module
body: <p>I've a CGI module written in C &amp; for some condition I want to return HTTP error 400 from this module. The problem is - I don't know how to return HTTP error from the module.</p>
  
  <p>Looks like the 'return(-1)' in my module, returns the 500 internal server error. I've tried returning 400 etc. but in vein. I've even tried "printf("Status:400");" before returning -1 (as suggested here: <a href="https://stackoverflow.com/questions/1318507/how-to-return-a-500-http-status-from-a-c-cgi-program">How to return a 500 HTTP status from a C++ CGI program</a>  ) but that didn't work. </p>
  
  <p>Any advice on this would be appreciated. </p>
  
  <p>Edit: [solved] I was able to return HTTP error code from the python module (which is called later by this C CGI module). So didn't get to try the suggestion mentioned in comments below. Thanks for offering help, though.</p>