{"id":90,"date":"2010-05-19T21:14:41","date_gmt":"2010-05-20T01:14:41","guid":{"rendered":"http:\/\/adamrosenfield.com\/blog\/?p=90"},"modified":"2010-05-19T21:15:58","modified_gmt":"2010-05-20T01:15:58","slug":"one-more-note-about-exit-statuses","status":"publish","type":"post","link":"http:\/\/adamrosenfield.com\/blog\/2010\/05\/19\/one-more-note-about-exit-statuses\/","title":{"rendered":"One more note about exit statuses"},"content":{"rendered":"<p><a href=\"http:\/\/adamrosenfield.com\/blog\/2010\/05\/13\/so-whats-in-an-exit-status-anyways\/\">Last week<\/a>, I mentioned in passing that Windows allows the full range of 32-bit exit codes.  That&#8217;s true, but only if you directly call <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682658%28VS.85%29.aspx\"><code>ExitProcess()<\/code><\/a> (or its less-friendly kin <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms686714%28v=VS.85%29.aspx\"><code>TerminateProcess()<\/code><\/a>).<\/p>\n<p>If you just call <code>exit()<\/code> (or return from <code>main()<\/code>, which implicitly calls <code>exit()<\/code>), then like in the *NIX world, you only get the bottom 8 bits of the exit status\u2014see <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/6wdz5232%28VS.71%29.aspx\">MSDN&#8217;s <code>exit()<\/code> documentation<\/a>.  So for portability&#8217;s sake, don&#8217;t use exit statuses above 255 unless you <em>really, really<\/em> need to.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week, I mentioned in passing that Windows allows the full range of 32-bit exit codes. That&#8217;s true, but only if you directly call ExitProcess() (or its less-friendly kin TerminateProcess()). If you just call exit() (or return from main(), which implicitly calls exit()), then like in the *NIX world, you only get the bottom 8 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":3,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":93,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions\/93"}],"wp:attachment":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}